Skip to content

Commit 500563a

Browse files
authored
Merge pull request #2222 from mattcary/cp-arm-lssd
Cherry-pick arm lssd disable #2219
2 parents 859f82a + 8e8e39c commit 500563a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

test/e2e/tests/setup_e2e_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ var (
6262
hdMachineType = flag.String("hyperdisk-machine-type", "c3-standard-4", "Type of machine to provision instance on, or `none' to skip")
6363
hdMinCpuPlatform = flag.String("hyperdisk-min-cpu-platform", "sapphirerapids", "Minimum CPU architecture")
6464

65+
// Some architectures don't have local ssd. Give way to opt out of tests like datacache.
66+
skipLocalSsdTests = flag.Bool("skip-local-ssd-tests", false, "Skip local ssd tests like datacache")
67+
6568
testContexts = []*remote.TestContext{}
6669
hyperdiskTestContexts = []*remote.TestContext{}
6770
computeService *compute.Service
@@ -183,6 +186,13 @@ func NewDefaultTestContext(zone string, instanceNumber string) *remote.TestConte
183186
return NewTestContext(zone, *minCpuPlatform, *machineType, instanceNumber)
184187
}
185188

189+
func getLocalSsdCount() int64 {
190+
if *skipLocalSsdTests {
191+
return 0
192+
}
193+
return common.LocalSSDCountForDataCache
194+
}
195+
186196
func NewTestContext(zone, minCpuPlatform, machineType string, instanceNumber string) *remote.TestContext {
187197
nodeID := fmt.Sprintf("%s-%s-%s-%s", *vmNamePrefix, zone, machineType, instanceNumber)
188198
klog.Infof("Setting up node %s", nodeID)
@@ -199,7 +209,7 @@ func NewTestContext(zone, minCpuPlatform, machineType string, instanceNumber str
199209
CloudtopHost: *cloudtopHost,
200210
EnableConfidentialCompute: *enableConfidentialCompute,
201211
ComputeService: computeService,
202-
LocalSSDCount: common.LocalSSDCountForDataCache,
212+
LocalSSDCount: getLocalSsdCount(),
203213
}
204214

205215
if machineType == *hdMachineType {

test/e2e/tests/single_zone_e2e_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,9 @@ var _ = Describe("GCE PD CSI Driver", func() {
14831483
It("Should create disks, attach them to instance with local ssd, setup caching between LSSD->detach->reattach to same instance", func() {
14841484
Expect(testContexts).ToNot(BeEmpty())
14851485
testContext := getRandomTestContext()
1486+
if testContext.Instance.GetLocalSSD() == 0 {
1487+
Skip("Skipping data cache as no local ssd in context")
1488+
}
14861489

14871490
p, z, _ := testContext.Instance.GetIdentity()
14881491
client := testContext.Client

0 commit comments

Comments
 (0)