diff --git a/internal/distro/distro_test.go b/internal/distro/distro_test.go index 449b3f258..6f11ebcb2 100644 --- a/internal/distro/distro_test.go +++ b/internal/distro/distro_test.go @@ -21,7 +21,7 @@ func TestDistro_Pipeline(t *testing.T) { t.Errorf("Could not read pipelines directory '%s': %v", pipelinePath, err) } for _, fileInfo := range fileInfos { - type compose struct { + type composeRequest struct { Distro string `json:"distro"` Arch string `json:"arch"` OutputFormat string `json:"output-format"` @@ -33,9 +33,9 @@ func TestDistro_Pipeline(t *testing.T) { Checksums map[string]string `json:"checksums"` } var tt struct { - Compose *compose `json:"compose"` - RpmMD *rpmMD `json:"rpmmd"` - Pipeline *osbuild.Pipeline `json:"pipeline,omitempty"` + ComposeRequest *composeRequest `json:"compose-request"` + RpmMD *rpmMD `json:"rpmmd"` + Pipeline *osbuild.Pipeline `json:"pipeline,omitempty"` } file, err := ioutil.ReadFile(pipelinePath + fileInfo.Name()) if err != nil { @@ -45,28 +45,28 @@ func TestDistro_Pipeline(t *testing.T) { if err != nil { t.Errorf("Colud not parse test-case '%s': %v", fileInfo.Name(), err) } - if tt.Compose == nil || tt.Compose.Blueprint == nil { + if tt.ComposeRequest == nil || tt.ComposeRequest.Blueprint == nil { t.Logf("Skipping '%s'.", fileInfo.Name()) continue } - t.Run(tt.Compose.OutputFormat, func(t *testing.T) { + t.Run(tt.ComposeRequest.OutputFormat, func(t *testing.T) { distros, err := distro.NewDefaultRegistry([]string{"../.."}) if err != nil { t.Fatal(err) } - d := distros.GetDistro(tt.Compose.Distro) + d := distros.GetDistro(tt.ComposeRequest.Distro) if d == nil { - t.Errorf("unknown distro: %v", tt.Compose.Distro) + t.Errorf("unknown distro: %v", tt.ComposeRequest.Distro) return } - size := d.GetSizeForOutputType(tt.Compose.OutputFormat, 0) - got, err := d.Pipeline(tt.Compose.Blueprint, + size := d.GetSizeForOutputType(tt.ComposeRequest.OutputFormat, 0) + got, err := d.Pipeline(tt.ComposeRequest.Blueprint, nil, tt.RpmMD.Packages, tt.RpmMD.BuildPackages, tt.RpmMD.Checksums, - tt.Compose.Arch, - tt.Compose.OutputFormat, + tt.ComposeRequest.Arch, + tt.ComposeRequest.OutputFormat, size) if (err != nil) != (tt.Pipeline == nil) { t.Errorf("distro.Pipeline() error = %v", err) diff --git a/test/cases/ami_empty_blueprint.json b/test/cases/ami_empty_blueprint.json index 678afa807..6e55052f1 100644 --- a/test/cases/ami_empty_blueprint.json +++ b/test/cases/ami_empty_blueprint.json @@ -2,7 +2,7 @@ "boot": { "type": "qemu-extract" }, - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "filename": "image.raw.xz", diff --git a/test/cases/disk_empty_blueprint.json b/test/cases/disk_empty_blueprint.json index 74aaae325..167cd5f04 100644 --- a/test/cases/disk_empty_blueprint.json +++ b/test/cases/disk_empty_blueprint.json @@ -1,5 +1,5 @@ { - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "partitioned-disk", diff --git a/test/cases/disk_local_boot.json b/test/cases/disk_local_boot.json index cf4f7d27b..7c6a3ebec 100644 --- a/test/cases/disk_local_boot.json +++ b/test/cases/disk_local_boot.json @@ -2,7 +2,7 @@ "boot": { "type": "nspawn" }, - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "partitioned-disk", diff --git a/test/cases/ext4_empty_blueprint.json b/test/cases/ext4_empty_blueprint.json index bab6837ab..4d22c3e69 100644 --- a/test/cases/ext4_empty_blueprint.json +++ b/test/cases/ext4_empty_blueprint.json @@ -1,5 +1,5 @@ { - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "ext4-filesystem", diff --git a/test/cases/ext4_local_boot.json b/test/cases/ext4_local_boot.json index 4e5ffd7e6..6d4879d56 100644 --- a/test/cases/ext4_local_boot.json +++ b/test/cases/ext4_local_boot.json @@ -2,7 +2,7 @@ "boot": { "type": "nspawn" }, - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "ext4", diff --git a/test/cases/groups_blueprint.json b/test/cases/groups_blueprint.json index ad7698f9b..bfe0b1ead 100644 --- a/test/cases/groups_blueprint.json +++ b/test/cases/groups_blueprint.json @@ -2,7 +2,7 @@ "boot": { "type": "nspawn-extract" }, - "compose": { + "compose-request": { "output-format": "tar", "distro": "fedora-30", "arch": "x86_64", diff --git a/test/cases/openstack_empty_blueprint.json b/test/cases/openstack_empty_blueprint.json index 7c5f5111f..884a30d04 100644 --- a/test/cases/openstack_empty_blueprint.json +++ b/test/cases/openstack_empty_blueprint.json @@ -1,5 +1,5 @@ { - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "openstack", diff --git a/test/cases/openstack_local_boot.json b/test/cases/openstack_local_boot.json index 8e246fc69..3b7ab5b4a 100644 --- a/test/cases/openstack_local_boot.json +++ b/test/cases/openstack_local_boot.json @@ -2,7 +2,7 @@ "boot": { "type": "qemu" }, - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "openstack", diff --git a/test/cases/qcow2_empty_blueprint.json b/test/cases/qcow2_empty_blueprint.json index f8382d9ae..f60454d40 100644 --- a/test/cases/qcow2_empty_blueprint.json +++ b/test/cases/qcow2_empty_blueprint.json @@ -1,5 +1,5 @@ { - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "qcow2", diff --git a/test/cases/qcow2_local_boot.json b/test/cases/qcow2_local_boot.json index 75d5ab111..64cc000e6 100644 --- a/test/cases/qcow2_local_boot.json +++ b/test/cases/qcow2_local_boot.json @@ -2,7 +2,7 @@ "boot": { "type": "qemu" }, - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "qcow2", diff --git a/test/cases/rhel82_ami.json b/test/cases/rhel82_ami.json index 5370f5e78..6c223aa78 100644 --- a/test/cases/rhel82_ami.json +++ b/test/cases/rhel82_ami.json @@ -2,7 +2,7 @@ "boot": { "type": "qemu-extract" }, - "compose": { + "compose-request": { "distro": "rhel-8.2", "arch": "x86_64", "filename": "image.raw.xz", diff --git a/test/cases/rhel82_ext4_filesystem.json b/test/cases/rhel82_ext4_filesystem.json index 9b8d8b590..6fedbfeaa 100644 --- a/test/cases/rhel82_ext4_filesystem.json +++ b/test/cases/rhel82_ext4_filesystem.json @@ -1,5 +1,5 @@ { - "compose": { + "compose-request": { "distro": "rhel-8.2", "arch": "x86_64", "filename": "filesystem.img", diff --git a/test/cases/rhel82_groups.json b/test/cases/rhel82_groups.json index c185aa8cf..1dfced1c8 100644 --- a/test/cases/rhel82_groups.json +++ b/test/cases/rhel82_groups.json @@ -1,5 +1,5 @@ { - "compose": { + "compose-request": { "output-format": "tar", "distro": "rhel-8.2", "arch": "x86_64", diff --git a/test/cases/rhel82_openstack.json b/test/cases/rhel82_openstack.json index cca9cbd43..e360caf25 100644 --- a/test/cases/rhel82_openstack.json +++ b/test/cases/rhel82_openstack.json @@ -2,7 +2,7 @@ "boot": { "type": "qemu" }, - "compose": { + "compose-request": { "distro": "rhel-8.2", "arch": "x86_64", "filename": "disk.qcow2", diff --git a/test/cases/rhel82_partitioned_disk.json b/test/cases/rhel82_partitioned_disk.json index 42f3c65b3..e798ffe19 100644 --- a/test/cases/rhel82_partitioned_disk.json +++ b/test/cases/rhel82_partitioned_disk.json @@ -1,5 +1,5 @@ { - "compose": { + "compose-request": { "distro": "rhel-8.2", "arch": "x86_64", "filename": "disk.img", diff --git a/test/cases/rhel82_qcow2.json b/test/cases/rhel82_qcow2.json index b1cc610dd..4e21760cd 100644 --- a/test/cases/rhel82_qcow2.json +++ b/test/cases/rhel82_qcow2.json @@ -2,7 +2,7 @@ "boot": { "type": "qemu" }, - "compose": { + "compose-request": { "distro": "rhel-8.2", "arch": "x86_64", "filename": "disk.qcow2", diff --git a/test/cases/rhel82_tar.json b/test/cases/rhel82_tar.json index 7e457f647..ed4affe04 100644 --- a/test/cases/rhel82_tar.json +++ b/test/cases/rhel82_tar.json @@ -1,5 +1,5 @@ { - "compose": { + "compose-request": { "output-format": "tar", "distro": "rhel-8.2", "arch": "x86_64", diff --git a/test/cases/rhel82_vhd.json b/test/cases/rhel82_vhd.json index 9e69e2ec2..499f487de 100644 --- a/test/cases/rhel82_vhd.json +++ b/test/cases/rhel82_vhd.json @@ -2,7 +2,7 @@ "boot": { "type": "qemu" }, - "compose": { + "compose-request": { "distro": "rhel-8.2", "arch": "x86_64", "filename": "disk.vhd", diff --git a/test/cases/rhel82_vmdk.json b/test/cases/rhel82_vmdk.json index 6730d03f2..463f87aa1 100644 --- a/test/cases/rhel82_vmdk.json +++ b/test/cases/rhel82_vmdk.json @@ -2,7 +2,7 @@ "boot": { "type": "qemu" }, - "compose": { + "compose-request": { "distro": "rhel-8.2", "arch": "x86_64", "filename": "disk.vmdk", diff --git a/test/cases/tar_local_boot.json b/test/cases/tar_local_boot.json index c65848a73..7af1ccff9 100644 --- a/test/cases/tar_local_boot.json +++ b/test/cases/tar_local_boot.json @@ -2,7 +2,7 @@ "boot": { "type": "nspawn-extract" }, - "compose": { + "compose-request": { "output-format": "tar", "distro": "fedora-30", "arch": "x86_64", diff --git a/test/cases/vhd_empty_blueprint.json b/test/cases/vhd_empty_blueprint.json index 9a95b70c2..5aae43288 100644 --- a/test/cases/vhd_empty_blueprint.json +++ b/test/cases/vhd_empty_blueprint.json @@ -1,5 +1,5 @@ { - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "vhd", diff --git a/test/cases/vhd_local_boot.json b/test/cases/vhd_local_boot.json index ddcc634a4..8de40171d 100644 --- a/test/cases/vhd_local_boot.json +++ b/test/cases/vhd_local_boot.json @@ -2,7 +2,7 @@ "boot": { "type": "qemu" }, - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "vhd", diff --git a/test/cases/vmdk_empty_blueprint.json b/test/cases/vmdk_empty_blueprint.json index f5f5e5466..d1a3f1aa5 100644 --- a/test/cases/vmdk_empty_blueprint.json +++ b/test/cases/vmdk_empty_blueprint.json @@ -1,5 +1,5 @@ { - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "vmdk", diff --git a/test/cases/vmdk_local_boot.json b/test/cases/vmdk_local_boot.json index 0e9b9bf91..1b6e1af13 100644 --- a/test/cases/vmdk_local_boot.json +++ b/test/cases/vmdk_local_boot.json @@ -2,7 +2,7 @@ "boot": { "type": "qemu" }, - "compose": { + "compose-request": { "distro": "fedora-30", "arch": "x86_64", "output-format": "vmdk", diff --git a/test/run b/test/run index d97e23104..c99a727b8 100755 --- a/test/run +++ b/test/run @@ -194,7 +194,7 @@ def run_test(case, private_key, store): print(f"osbuild successfully built pipeline {output_id}") - filename = os.path.join(store, "refs", output_id, case["compose"]["filename"]) + filename = os.path.join(store, "refs", output_id, case["compose-request"]["filename"]) fn, ex = os.path.splitext(filename) if ex == ".xz": @@ -248,11 +248,11 @@ def main(): case = json.load(f) if arg.distros: - if case["compose"]["distro"] not in arg.distros: + if case["compose-request"]["distro"] not in arg.distros: continue if arg.arches: - if case["compose"]["arch"] not in arg.arches: + if case["compose-request"]["arch"] not in arg.arches: continue print(f"RUNNING: {filename}")