Skip to content

Commit

Permalink
OVF e2e: Use Debian 11 for 3 disk test (#1809)
Browse files Browse the repository at this point in the history
The Ubuntu 16.04 three-disk tests have been flaky for the past couple of weeks. While researching this, I found that Ubuntu 16.04 became EOL in 2021: https://ubuntu.com/about/release-cycle

This replaces the three-disk test with Debian 11. The goal is to isolate whether the flakiness comes from Ubuntu 16.04, or having multiple disks during OVF import.
  • Loading branch information
EricEdens committed Dec 6, 2021
1 parent 128bc29 commit 50f80fb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ func TestSuite(
e2e.Wrapper,
}
for _, testType := range testTypes {
instanceExportUbuntu3DisksTestCase := junitxml.NewTestCase(
testSuiteName, fmt.Sprintf("[%v][OVFInstanceExport] %v", testType, "Ubuntu 3 disks, one data disk larger than 10GB"))
instanceExportDebian3DisksTestCase := junitxml.NewTestCase(
testSuiteName, fmt.Sprintf("[%v][OVFInstanceExport] %v", testType, "Debian 3 disks, one data disk larger than 10GB"))

testsMap[testType] = map[*junitxml.TestCase]func(
context.Context, *junitxml.TestCase, *log.Logger, *testconfig.Project, e2e.CLITestType){}
testsMap[testType][instanceExportUbuntu3DisksTestCase] = runInstanceOVFExportUbuntu3Disks
testsMap[testType][instanceExportDebian3DisksTestCase] = runInstanceOVFExportDebian3Disks
}

e2e.CLITestSuite(ctx, tswg, testSuites, logger, testSuiteRegex, testCaseRegex,
testProjectConfig, testSuiteName, testsMap)
}

func runInstanceOVFExportUbuntu3Disks(ctx context.Context, testCase *junitxml.TestCase, logger *log.Logger,
func runInstanceOVFExportDebian3Disks(ctx context.Context, testCase *junitxml.TestCase, logger *log.Logger,
testProjectConfig *testconfig.Project, testType e2e.CLITestType) {

buildID := path.RandString(10)
Expand All @@ -99,12 +99,11 @@ func runInstanceOVFExportUbuntu3Disks(ctx context.Context, testCase *junitxml.Te
props := &instanceOvfExportTestProperties{
instanceName: fmt.Sprintf("test-instance-ubuntu-3-disks-%v", buildID),
verificationStartupScript: loadScriptContent(
"scripts/ovf_import_test_ubuntu_3_disks.sh", logger),
"scripts/ovf_import_test_3_disks.sh", logger),
zone: testProjectConfig.TestZone,
expectedStartupOutput: "All tests passed!",
failureMatches: []string{"FAILED:", "TestFailed:"},
sourceGMI: "projects/compute-image-test-pool-001/global/machineImages/ubuntu-1604-three-disks-do-not-delete",
os: "ubuntu-1604",
sourceGMI: "projects/compute-image-test-pool-001/global/machineImages/debian-11-three-disks-do-not-delete",
destinationURI: fmt.Sprintf("gs://%v/%v/", exportBucket, exportPath),
exportBucket: exportBucket,
exportPath: exportPath,
Expand Down Expand Up @@ -250,15 +249,18 @@ func verifyExportedOVFUsingOVFImport(
verificationInstanceName := fmt.Sprintf("ovf-export-verification-instance--%v", props.buildID)
logger.Printf("Verifying exported OVF by importing it via OVF import as `%v`", verificationInstanceName)

ovfImportError := e2e.RunCliTool(logger, testCase, "gcloud", []string{
args := []string{
"beta", "compute", "instances", "import",
verificationInstanceName,
fmt.Sprintf("--source-uri=%v", props.destinationURI),
fmt.Sprintf("--os=%v", props.os),
fmt.Sprintf("--zone=%v", props.zone),
fmt.Sprintf("--project=%v", testProjectConfig.TestProjectID),
"--docker-image-tag=latest",
})
}
if props.os != "" {
args = append(args, fmt.Sprintf("--os=%v", props.os))
}
ovfImportError := e2e.RunCliTool(logger, testCase, "gcloud", args)
if ovfImportError != nil {
e2e.Failure(testCase, logger, fmt.Sprintf("Failed importing exported OVF as instance: %v", ovfImportError))
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ func TestSuite(
e2e.GcloudGaLatestWrapperRelease,
}
for _, testType := range testTypes {
instanceImportUbuntu3DisksTestCaseNetworkSettingsName := junitxml.NewTestCase(
testSuiteName, fmt.Sprintf("[%v] %v", testType, "Ubuntu 3 disks, one data disk larger than 10GB, network setting (name only)"))
instanceImportDebian3DisksTestCaseNetworkSettingsName := junitxml.NewTestCase(
testSuiteName, fmt.Sprintf("[%v] %v", testType, "Debian 3 disks, one data disk larger than 10GB, network setting (name only)"))
instanceImportWindows2012R2TwoDisksNetworkSettingsPath := junitxml.NewTestCase(
testSuiteName, fmt.Sprintf("[%v] %v", testType, "Windows 2012 R2 two disks, network setting (path)"))
instanceImportWindows2016 := junitxml.NewTestCase(
Expand All @@ -95,7 +95,7 @@ func TestSuite(

testsMap[testType] = map[*junitxml.TestCase]func(
context.Context, *junitxml.TestCase, *log.Logger, *testconfig.Project, e2e.CLITestType){}
testsMap[testType][instanceImportUbuntu3DisksTestCaseNetworkSettingsName] = runOVFInstanceImportUbuntu3DisksNetworkSettingsName
testsMap[testType][instanceImportDebian3DisksTestCaseNetworkSettingsName] = runOVFInstanceImportDebian3DisksNetworkSettingsName
testsMap[testType][instanceImportWindows2012R2TwoDisksNetworkSettingsPath] = runOVFInstanceImportWindows2012R2TwoDisksNetworkSettingsPath
testsMap[testType][instanceImportWindows2016] = runOVFInstanceImportWindows2016
testsMap[testType][instanceImportWindows2008R2FourNICs] = runOVFInstanceImportWindows2008R2FourNICs
Expand Down Expand Up @@ -178,20 +178,20 @@ func fallbackWhenSSDQuotaExhausted(ctx context.Context, testCase *junitxml.TestC
runOVFInstanceImportTest(ctx, buildTestArgs(props, testProjectConfig)[testType], testType, testProjectConfig, logger, testCase, props)
}

func runOVFInstanceImportUbuntu3DisksNetworkSettingsName(ctx context.Context, testCase *junitxml.TestCase, logger *log.Logger,
func runOVFInstanceImportDebian3DisksNetworkSettingsName(ctx context.Context, testCase *junitxml.TestCase, logger *log.Logger,
testProjectConfig *testconfig.Project, testType e2e.CLITestType) {

suffix := path.RandString(5)
props := &ovfInstanceImportTestProperties{
instanceName: fmt.Sprintf("test-instance-ubuntu-3-disks-%v", suffix),
OvfImportTestProperties: ovfimporttestsuite.OvfImportTestProperties{
VerificationStartupScript: ovfimporttestsuite.LoadScriptContent(
"scripts/ovf_import_test_ubuntu_3_disks.sh", logger),
"scripts/ovf_import_test_3_disks.sh", logger),
Zone: testProjectConfig.TestZone,
ExpectedStartupOutput: "All tests passed!",
FailureMatches: []string{"FAILED:", "TestFailed:"},
SourceURI: fmt.Sprintf("gs://%v/ova/ubuntu-1604-three-disks", ovaBucket),
Os: "ubuntu-1604",
SourceURI: fmt.Sprintf("gs://%v/ova/debian-11-three-disks.ova", ovaBucket),
Os: "debian-11",
MachineType: "n1-standard-4",
Network: fmt.Sprintf("%v-vpc-1", testProjectConfig.TestProjectID),
Subnet: fmt.Sprintf("%v-subnet-1", testProjectConfig.TestProjectID),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ func TestSuite(
e2e.GcloudBetaLatestWrapperLatest,
}
for _, testType := range testTypes {
machineImageImportUbuntu3DisksNetworkSettingsNameTestCase := junitxml.NewTestCase(
testSuiteName, fmt.Sprintf("[%v] %v", testType, "Ubuntu 3 disks, one data disk larger than 10GB, Network setting (name only)"))
machineImageImportDebian3DisksNetworkSettingsNameTestCase := junitxml.NewTestCase(
testSuiteName, fmt.Sprintf("[%v] %v", testType, "Debian 3 disks, one data disk larger than 10GB, Network setting (name only)"))
machineImageImportWindows2012R2TwoDisksNetworkSettingsPathTestCase := junitxml.NewTestCase(
testSuiteName, fmt.Sprintf("[%v] %v", testType, "Windows 2012 R2 two disks, Network setting (path)"))
machineImageImportStorageLocationTestCase := junitxml.NewTestCase(
testSuiteName, fmt.Sprintf("[%v] %v", testType, "Centos 7.4, Storage location"))

testsMap[testType] = map[*junitxml.TestCase]func(
context.Context, *junitxml.TestCase, *log.Logger, *testconfig.Project, e2e.CLITestType){}
testsMap[testType][machineImageImportUbuntu3DisksNetworkSettingsNameTestCase] = runOVFMachineImageImportUbuntu3DisksNetworkSettingsName
testsMap[testType][machineImageImportDebian3DisksNetworkSettingsNameTestCase] = runOVFMachineImageImportDebian3DisksNetworkSettingsName
testsMap[testType][machineImageImportWindows2012R2TwoDisksNetworkSettingsPathTestCase] = runOVFMachineImageImportWindows2012R2TwoDisksNetworkSettingsPath
testsMap[testType][machineImageImportStorageLocationTestCase] = runOVFMachineImageImportCentos74StorageLocation
}
Expand All @@ -114,20 +114,20 @@ func TestSuite(
testProjectConfig, testSuiteName, testsMap)
}

func runOVFMachineImageImportUbuntu3DisksNetworkSettingsName(ctx context.Context, testCase *junitxml.TestCase, logger *log.Logger,
func runOVFMachineImageImportDebian3DisksNetworkSettingsName(ctx context.Context, testCase *junitxml.TestCase, logger *log.Logger,
testProjectConfig *testconfig.Project, testType e2e.CLITestType) {

suffix := path.RandString(5)
props := &ovfMachineImageImportTestProperties{
machineImageName: fmt.Sprintf("test-machine-image-ubuntu-3-disks-%v", suffix),
OvfImportTestProperties: ovfimporttestsuite.OvfImportTestProperties{
VerificationStartupScript: ovfimporttestsuite.LoadScriptContent(
"scripts/ovf_import_test_ubuntu_3_disks.sh", logger),
"scripts/ovf_import_test_3_disks.sh", logger),
Zone: testProjectConfig.TestZone,
ExpectedStartupOutput: "All tests passed!",
FailureMatches: []string{"TestFailed:"},
SourceURI: fmt.Sprintf("gs://%v/ova/ubuntu-1604-three-disks", ovaBucket),
Os: "ubuntu-1604",
SourceURI: fmt.Sprintf("gs://%v/ova/debian-11-three-disks.ova", ovaBucket),
Os: "debian-11",
InstanceMetadata: skipOSConfigMetadata,
MachineType: "n1-standard-4",
Network: fmt.Sprintf("%v-vpc-1", testProjectConfig.TestProjectID),
Expand Down

0 comments on commit 50f80fb

Please sign in to comment.