-
Notifications
You must be signed in to change notification settings - Fork 20
test/smoke: assert alma linux image types #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,8 @@ def test_smoke_has_expected_images_centos(build_container): | |
| "vagrant-libvirt": ["x86_64"], | ||
| "vagrant-virtualbox": ["x86_64"], | ||
| "image-installer": ["x86_64", "aarch64"], | ||
| "container": ["x86_64", "aarch64"], | ||
| "container-minimal": ["x86_64", "aarch64"], | ||
| } | ||
|
|
||
| for distro in ["centos-9", "centos-10"]: | ||
|
|
@@ -39,6 +41,111 @@ def test_smoke_has_expected_images_centos(build_container): | |
| assert f"{distro} type:{type_} arch:{arch}" in output | ||
|
|
||
|
|
||
| def test_smoke_has_expected_images_almalinux_8(build_container): | ||
| output = subprocess.check_output(podman_run + [ | ||
| build_container, | ||
| "list", | ||
| ], text=True) | ||
|
|
||
| type_arch = { | ||
| "ami": ["aarch64", "x86_64"], | ||
| "ec2": ["aarch64", "x86_64"], | ||
| "gce": ["x86_64"], | ||
| "image-installer": ["aarch64", "x86_64"], | ||
| "minimal-raw": ["aarch64", "x86_64"], | ||
| "network-installer": ["aarch64", "x86_64"], | ||
| "oci": ["x86_64"], | ||
| "openstack": ["aarch64", "x86_64"], | ||
| "ova": ["x86_64"], | ||
| "qcow2": ["aarch64", "x86_64", "ppc64le", "s390x"], | ||
| "tar": ["aarch64", "x86_64", "ppc64le", "s390x"], | ||
| "vhd": ["aarch64", "x86_64"], | ||
| "vmdk": ["x86_64"], | ||
| "wsl": ["aarch64", "x86_64"], | ||
| } | ||
|
|
||
| versions = [ | ||
| "almalinux-8.4", | ||
| "almalinux-8.5", | ||
| "almalinux-8.6", | ||
| "almalinux-8.7", | ||
| "almalinux-8.8", | ||
| "almalinux-8.9", | ||
| "almalinux-8.10", | ||
| ] | ||
|
|
||
| expected_to_not_exist = [ | ||
| # alma linux did not have ppc64le before 8.5 and no s390x before 8.6, lets | ||
| # skip testing their existence | ||
| ("almalinux-8.4", "tar", "ppc64le"), | ||
| ("almalinux-8.4", "tar", "s390x"), | ||
| ("almalinux-8.4", "qcow2", "ppc64le"), | ||
| ("almalinux-8.4", "qcow2", "s390x"), | ||
|
|
||
| ("almalinux-8.5", "tar", "s390x"), | ||
| ("almalinux-8.5", "qcow2", "s390x"), | ||
|
|
||
| # there was no vhd for aarch64 before 8.6 | ||
| ("almalinux-8.4", "vhd", "aarch64"), | ||
| ("almalinux-8.5", "vhd", "aarch64"), | ||
| ] | ||
|
|
||
| for distro in versions: | ||
| for type_, arches in type_arch.items(): | ||
| for arch in arches: | ||
| if (distro, type_, arch) in expected_to_not_exist: | ||
| continue | ||
| assert f"{distro} type:{type_} arch:{arch}" in output | ||
|
|
||
|
|
||
| def test_smoke_has_expected_images_almalinux_9_and_10(build_container): | ||
| output = subprocess.check_output(podman_run + [ | ||
| build_container, | ||
| "list", | ||
| ], text=True) | ||
|
|
||
| type_arch = { | ||
| "tar": ["aarch64", "x86_64", "ppc64le", "s390x"], | ||
| "qcow2": ["aarch64", "x86_64", "ppc64le", "s390x"], | ||
| "ec2": ["x86_64", "aarch64"], | ||
| "azure": ["x86_64", "aarch64"], | ||
| "wsl": ["x86_64", "aarch64"], | ||
| "vagrant-libvirt": ["x86_64"], | ||
| "vagrant-virtualbox": ["x86_64"], | ||
| "image-installer": ["x86_64", "aarch64"], | ||
| "container": ["x86_64", "aarch64"], | ||
| "container-minimal": ["x86_64", "aarch64"], | ||
| } | ||
|
|
||
| versions = [ | ||
| "almalinux-9.0", | ||
| "almalinux-9.1", | ||
| "almalinux-9.2", | ||
| "almalinux-9.3", | ||
| "almalinux-9.4", | ||
| "almalinux-9.5", | ||
| "almalinux-9.6", | ||
| "almalinux-9.7", | ||
| "almalinux-9.8", | ||
|
|
||
| "almalinux-10.0", | ||
| "almalinux-10.1", | ||
| "almalinux-10.2", | ||
|
|
||
| "almalinux_kitten-10", | ||
| ] | ||
|
|
||
| expected_to_not_exist = [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that we do not use it, could we just remove it (YAGNI and all that)?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep; I will after we resolve the other comment here to make sure if this is the right place for this to live at all :) |
||
| ] | ||
|
|
||
| for distro in versions: | ||
| for type_, arches in type_arch.items(): | ||
| for arch in arches: | ||
| if (distro, type_, arch) in expected_to_not_exist: | ||
| continue | ||
| assert f"{distro} type:{type_} arch:{arch}" in output | ||
|
|
||
|
|
||
| def test_smoke_has_expected_images_fedora(build_container): | ||
| """ | ||
| Ensure that image types that are built in by Fedora are available | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a similarly comprehensive test for rhel? And if not, should we create one for rhel first maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if
image-builder-cliis the right place to have this type of test...We do test this in
osbuild/imagesfor other distros, we should just add almalinux there, see https://github.com/osbuild/images/blob/main/pkg/distro/generic/rhel10_test.go#L240It still makes sense to have at least some smoke tests (the one for centos) in ibcli, but I'm not sure if it makes sense to duplicate the testing that is done in osbuild/images here.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a hard time adding this into images as it doesn't verify that repository files for the listed distribution versions also exist. I also had a hard time figuring out how to processing excluded image types there. For example I don't think we have tests there that
azureimage types were only included starting from RHEL 8.x and/or that RHEL 8.x actually exists and has all required architectures?Why do you feel CentOS makes sense and Alma Linux does not (in the smoke tests here?). Is it because the CentOS ones map directly on the types they build in Koji?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to look at what we actually test to be able to answer.
No, I didn't mean CentOS specifically. What I meant is that it makes sense to have a smoke test with a single distro. It could be any distro from my PoV.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, that is a fair point, because we test only distro definitions. ibcli still reuses the
DistroFactory,RepoRegistryand the embedded repo definitions fromosbuild/images. So we should be definitely able to test all of this at the source of it, meaningosbuild/images.We do test for this, see https://github.com/osbuild/images/blob/79b9da6b393fd3ccf30c233362b5a10be5d61eb8/pkg/distro/generic/rhel8_test.go
We almost certainly don't test for all conditionals in our distro definitions, but we have the basis for it.