Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bib/internal/imagetypes/imagetypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var supportedImageTypes = map[string]imageType{
"vmdk": imageType{Export: "vmdk"},
"vhd": imageType{Export: "vpc"},
"gce": imageType{Export: "gce"},
"ova": imageType{Export: "archive"},
// the iso image types are RPM based and legacy/deprecated
"anaconda-iso": imageType{Export: "bootiso", ISO: true, Legacy: true},
"iso": imageType{Export: "bootiso", ISO: true, Legacy: true},
Expand Down
6 changes: 3 additions & 3 deletions bib/internal/imagetypes/imagetypes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ func TestImageTypes(t *testing.T) {
},
"bad-image-type": {
imageTypes: []string{"bad"},
expectedErr: errors.New(`unsupported image type "bad", valid types are ami, anaconda-iso, gce, iso, qcow2, raw, vhd, vmdk`),
expectedErr: errors.New(`unsupported image type "bad", valid types are ami, anaconda-iso, gce, iso, ova, qcow2, raw, vhd, vmdk`),
},
"bad-in-good": {
imageTypes: []string{"ami", "raw", "vmdk", "qcow2", "something-else-what-is-this"},
expectedErr: errors.New(`unsupported image type "something-else-what-is-this", valid types are ami, anaconda-iso, gce, iso, qcow2, raw, vhd, vmdk`),
expectedErr: errors.New(`unsupported image type "something-else-what-is-this", valid types are ami, anaconda-iso, gce, iso, ova, qcow2, raw, vhd, vmdk`),
},
"all-bad": {
imageTypes: []string{"bad1", "bad2", "bad3", "bad4", "bad5", "bad42"},
expectedErr: errors.New(`unsupported image type "bad1", valid types are ami, anaconda-iso, gce, iso, qcow2, raw, vhd, vmdk`),
expectedErr: errors.New(`unsupported image type "bad1", valid types are ami, anaconda-iso, gce, iso, ova, qcow2, raw, vhd, vmdk`),
},
}

Expand Down
31 changes: 27 additions & 4 deletions test/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,10 +858,9 @@ def test_manifest_customization_custom_file_smoke(tmp_path, build_container):
def find_stage_options_from(manifest_str, stage_type):
manifest = json.loads(manifest_str)
for pipl in manifest["pipelines"]:
if pipl["name"] == "image":
for st in pipl["stages"]:
if st["type"] == stage_type:
return st["options"]
for st in pipl["stages"]:
if st["type"] == stage_type:
return st["options"]
raise ValueError(f"cannot find {stage_type} stage manifest:\n{manifest_str}")


Expand Down Expand Up @@ -1032,3 +1031,27 @@ def test_manifest_image_disk_yaml(tmp_path, build_container):
], encoding="utf8")
write_device_options = find_stage_options_from(manifest_str, "org.osbuild.write-device")
assert write_device_options["from"] == "input://tree/usr/lib/modules/5.0-x86_64/aboot.img"


@pytest.mark.parametrize("tc", gen_testcases("anaconda-iso"))
def test_ova_manifest_smoke(build_container, tc):
testutil.pull_container(tc.container_ref, tc.target_arch)

output = subprocess.check_output([
*testutil.podman_run_common,
build_container,
"manifest",
*tc.bib_rootfs_args(),
"--type=ova",
f"{tc.container_ref}",
])
# just some basic validation that we generate a ova
assert find_stage_options_from(output, "org.osbuild.tar") == {
"filename": "image.ova",
"format": "ustar",
"paths": [
"image.ovf",
"image.mf",
"image.vmdk"
]
}
Loading