Skip to content

Commit

Permalink
distro/rhel85: update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
achilleas-k committed Jul 9, 2021
1 parent 2888d8a commit cfd9016
Showing 1 changed file with 79 additions and 6 deletions.
85 changes: 79 additions & 6 deletions internal/distro/rhel85/distro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,42 @@ func TestFilenameFromType(t *testing.T) {
want1 string
wantErr bool
}{
{
name: "qcow2",
args: args{"qcow2"},
want: "disk.qcow2",
want1: "application/x-qemu-disk",
},
{
name: "openstack",
args: args{"openstack"},
want: "disk.qcow2",
want1: "application/x-qemu-disk",
},
{
name: "vhd",
args: args{"vhd"},
want: "disk.vhd",
want1: "application/x-vhd",
},
{
name: "vmdk",
args: args{"vmdk"},
want: "disk.vmdk",
want1: "application/x-vmdk",
},
{
name: "tar",
args: args{"tar"},
want: "root.tar.xz",
want1: "application/x-tar",
},
{
name: "tar-installer",
args: args{"tar-installer"},
want: "installer.iso",
want1: "application/x-iso9660-image",
},
{
name: "edge-container",
args: args{"edge-container"},
Expand Down Expand Up @@ -139,17 +175,41 @@ func TestImageType_Name(t *testing.T) {
{
arch: "x86_64",
imgNames: []string{
"qcow2",
"openstack",
"vhd",
"vmdk",
"ami",
"edge-commit",
"edge-container",
"edge-installer",
"tar",
"tar-installer",
},
},
{
arch: "aarch64",
imgNames: []string{
"qcow2",
"openstack",
"ami",
"edge-commit",
"edge-container",
"edge-installer",
"tar",
},
},
{
arch: "ppc64le",
imgNames: []string{
"qcow2",
"tar",
},
},
{
arch: "s390x",
imgNames: []string{
"qcow2",
"tar",
},
},
}
Expand Down Expand Up @@ -224,6 +284,11 @@ func TestArchitecture_ListImageTypes(t *testing.T) {
{
arch: "x86_64",
imgNames: []string{
"qcow2",
"openstack",
"vhd",
"vmdk",
"ami",
"edge-commit",
"edge-container",
"edge-installer",
Expand All @@ -234,19 +299,27 @@ func TestArchitecture_ListImageTypes(t *testing.T) {
{
arch: "aarch64",
imgNames: []string{
"qcow2",
"openstack",
"ami",
"edge-commit",
"edge-container",
"edge-installer",
"tar",
},
},
{
arch: "ppc64le",
imgNames: []string{"tar"},
arch: "ppc64le",
imgNames: []string{
"qcow2",
"tar",
},
},
{
arch: "s390x",
imgNames: []string{"tar"},
arch: "s390x",
imgNames: []string{
"qcow2",
"tar",
},
},
}

Expand Down

0 comments on commit cfd9016

Please sign in to comment.