Skip to content

Commit

Permalink
Remove windows_server and windows_client
Browse files Browse the repository at this point in the history
  • Loading branch information
EricEdens committed Oct 13, 2020
1 parent 17ea8e8 commit 041f921
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 41 deletions.
156 changes: 121 additions & 35 deletions cli_tools_tests/module/diskinspect/disk_inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ func TestInspectDisk(t *testing.T) {
}

for _, tt := range []struct {
caseName string
imageURI string
expected disk.InspectionResult
}{
{
"projects/opensuse-cloud/global/images/opensuse-leap-15-2-v20200702",
disk.InspectionResult{
imageURI: "projects/opensuse-cloud/global/images/opensuse-leap-15-2-v20200702",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "opensuse",
Major: "15",
Expand All @@ -67,29 +68,22 @@ func TestInspectDisk(t *testing.T) {
BIOSBootableWithHybridMBROrProtectiveMBR: true,
},
}, {
"projects/suse-sap-cloud/global/images/sles-15-sp1-sap-v20200803",
disk.InspectionResult{
imageURI: "projects/suse-sap-cloud/global/images/sles-15-sp1-sap-v20200803",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "sles-sap",
Major: "15",
Minor: "1",
UEFIBootable: true,
BIOSBootableWithHybridMBROrProtectiveMBR: true,
},
}, {
"projects/compute-image-tools-test/global/images/windows-7-ent-x86-nodrivers",
disk.InspectionResult{
Architecture: "x86",
Distro: "windows",
Major: "6",
Minor: "1",
UEFIBootable: false,
BIOSBootableWithHybridMBROrProtectiveMBR: false,
},
}, {
// UEFI inspection test for GPT UEFI
"projects/gce-uefi-images/global/images/rhel-7-v20200403",
disk.InspectionResult{
},

// UEFI
{
caseName: "UEFI inspection test for GPT UEFI",
imageURI: "projects/gce-uefi-images/global/images/rhel-7-v20200403",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "rhel",
Major: "7",
Expand All @@ -98,9 +92,9 @@ func TestInspectDisk(t *testing.T) {
BIOSBootableWithHybridMBROrProtectiveMBR: false,
},
}, {
// UEFI inspection test for MBR-only
"projects/debian-cloud/global/images/debian-9-stretch-v20200714",
disk.InspectionResult{
caseName: "UEFI inspection test for MBR-only",
imageURI: "projects/debian-cloud/global/images/debian-9-stretch-v20200714",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "debian",
Major: "9",
Expand All @@ -109,20 +103,20 @@ func TestInspectDisk(t *testing.T) {
BIOSBootableWithHybridMBROrProtectiveMBR: false,
},
}, {
// UEFI inspection test for GPT UEFI - windows
"projects/gce-uefi-images/global/images/windows-server-2019-dc-core-v20200609",
disk.InspectionResult{
caseName: "UEFI inspection test for GPT UEFI - windows",
imageURI: "projects/gce-uefi-images/global/images/windows-server-2019-dc-core-v20200609",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "windows",
Major: "10",
Major: "2019",
Minor: "",
UEFIBootable: true,
BIOSBootableWithHybridMBROrProtectiveMBR: false,
},
}, {
// UEFI inspection test for GPT UEFI with BIOS boot
"projects/gce-uefi-images/global/images/ubuntu-1804-bionic-v20200317",
disk.InspectionResult{
caseName: "UEFI inspection test for GPT UEFI with BIOS boot",
imageURI: "projects/gce-uefi-images/global/images/ubuntu-1804-bionic-v20200317",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "ubuntu",
Major: "18",
Expand All @@ -131,9 +125,9 @@ func TestInspectDisk(t *testing.T) {
BIOSBootableWithHybridMBROrProtectiveMBR: true,
},
}, {
// UEFI inspection test for GPT UEFI with hybrid MBR
"projects/compute-image-tools-test/global/images/image-ubuntu-2004-hybrid-mbr",
disk.InspectionResult{
caseName: "UEFI inspection test for GPT UEFI with hybrid MBR",
imageURI: "projects/compute-image-tools-test/global/images/image-ubuntu-2004-hybrid-mbr",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "ubuntu",
Major: "20",
Expand All @@ -142,9 +136,9 @@ func TestInspectDisk(t *testing.T) {
BIOSBootableWithHybridMBROrProtectiveMBR: true,
},
}, {
// UEFI inspection test for MBR-only UEFI
"projects/compute-image-tools-test/global/images/image-uefi-mbr-only",
disk.InspectionResult{
caseName: "UEFI inspection test for MBR-only UEFI",
imageURI: "projects/compute-image-tools-test/global/images/image-uefi-mbr-only",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "ubuntu",
Major: "16",
Expand All @@ -153,11 +147,103 @@ func TestInspectDisk(t *testing.T) {
BIOSBootableWithHybridMBROrProtectiveMBR: false,
},
},



// Windows Server
{
imageURI: "projects/windows-cloud/global/images/windows-server-2008-r2-dc-v20200114",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "windows",
Major: "2008",
Minor: "r2",
},
}, {
imageURI: "projects/compute-image-tools-test/global/images/windows-2012-r2-vmware-import",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "windows",
Major: "2012",
Minor: "r2",
},
}, {
imageURI: "projects/compute-image-tools-test/global/images/windows-2016-import",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "windows",
Major: "2016",
Minor: "",
},
}, {
imageURI: "projects/compute-image-tools-test/global/images/windows-2019",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "windows",
Major: "2019",
Minor: "",
},
},

// Windows Desktop
{
imageURI: "projects/compute-image-tools-test/global/images/windows-7-ent-x86-nodrivers",
expected: disk.InspectionResult{
Architecture: "x86",
Distro: "windows",
Major: "7",
Minor: "",
},
}, {
imageURI: "projects/compute-image-tools-test/global/images/windows-7-import",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "windows",
Major: "7",
Minor: "",
},
}, {
imageURI: "projects/compute-image-tools-test/global/images/windows-8-1-ent-x86-nodrivers",
expected: disk.InspectionResult{
Architecture: "x86",
Distro: "windows",
Major: "8",
Minor: "1",
},
}, {
imageURI: "projects/compute-image-tools-test/global/images/windows-8-1-x64",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "windows",
Major: "8",
Minor: "1",
},
}, {
imageURI: "projects/compute-image-tools-test/global/images/windows-10-1909-ent-x86-nodrivers",
expected: disk.InspectionResult{
Architecture: "x86",
Distro: "windows",
Major: "10",
Minor: "",
},
}, {
imageURI: "projects/compute-image-tools-test/global/images/windows-10-1709-import",
expected: disk.InspectionResult{
Architecture: "x64",
Distro: "windows",
Major: "10",
Minor: "",
},
},
} {
// Without this, each parallel test will reference the last tt instance.
// https://github.com/golang/go/wiki/CommonMistakes#using-goroutines-on-loop-iterator-variables
currentTest := tt
t.Run(currentTest.imageURI, func(t *testing.T) {
name := currentTest.caseName
if name == "" {
name = currentTest.imageURI
}
t.Run(name, func(t *testing.T) {
t.Parallel()
inspector, err := disk.NewInspector(daisycommon.WorkflowAttributes{
Project: project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class Distro(enum.Enum):
SLES = 'sles'
UBUNTU = 'ubuntu'
WINDOWS = 'windows'
WINDOWS_DESKTOP = 'windows-desktop'
WINDOWS_SERVER = 'windows-server'


def distro_for(name: str):
Expand Down
8 changes: 4 additions & 4 deletions daisy_workflows/image_import/inspection/tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ def test_happy_case(self):
inspection_results = model.InspectionResults(
device="/dev/sdb",
os=model.OperatingSystem(
distro=model.Distro.WINDOWS_SERVER,
version=model.Version(major="6", minor="1"),
distro=model.Distro.WINDOWS,
version=model.Version(major="8", minor="1"),
),
architecture=model.Architecture.x86,
)

expected = {
"device": "/dev/sdb",
"os": {
"distro": "windows-server",
"distro": "windows",
"version": {
"major": "6",
"major": "8",
"minor": "1",
}
},
Expand Down

0 comments on commit 041f921

Please sign in to comment.