Skip to content
Open
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
2 changes: 1 addition & 1 deletion cmd/image-builder/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ func TestBasenameFor(t *testing.T) {
}

// XXX: move into as manifestgen.FakeDepsolve
func fakeDepsolve(cacheDir string, depsolveWarningsOutput io.Writer, packageSets map[string][]rpmmd.PackageSet, d distro.Distro, arch string) (map[string]depsolvednf.DepsolveResult, error) {
func fakeDepsolve(solver *depsolvednf.Solver, cacheDir string, depsolveWarningsOutput io.Writer, packageSets map[string][]rpmmd.PackageSet, d distro.Distro, arch string) (map[string]depsolvednf.DepsolveResult, error) {
depsolvedSets := make(map[string]depsolvednf.DepsolveResult)

for name, pkgSetChain := range packageSets {
Expand Down
2 changes: 1 addition & 1 deletion cmd/image-builder/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func generateManifest(dataDir string, extraRepos []string, img *imagefilter.Resu
RpmDownloader: opts.RpmDownloader,
UseBootstrapContainer: opts.UseBootstrapContainer,
CustomSeed: opts.CustomSeed,
Depsolver: manifestgenDepsolver,
Depsolve: manifestgenDepsolver,
Cachedir: opts.RpmmdCacheDir,
}
if opts.WithSBOM {
Expand Down
2 changes: 1 addition & 1 deletion cmd/image-builder/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func uploaderForCmdAWS(cmd *cobra.Command, targetArchStr string, bootMode *platf
return nil, fmt.Errorf("Invalid tag format: %s (expected key=value)", tag)
}
slicedTags = append(slicedTags, awscloud.AWSTag{
Name: parts[0],
Name: parts[0],
Value: parts[1],
})
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/gobwas/glob v0.2.3
github.com/mattn/go-isatty v0.0.20
github.com/osbuild/blueprint v1.16.0
github.com/osbuild/images v0.218.0
github.com/osbuild/images v0.222.0
github.com/spf13/cobra v1.9.1
github.com/stretchr/testify v1.11.1
go.yaml.in/yaml/v3 v3.0.3
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,10 @@ github.com/opencontainers/selinux v1.12.0 h1:6n5JV4Cf+4y0KNXW48TLj5DwfXpvWlxXplU
github.com/opencontainers/selinux v1.12.0/go.mod h1:BTPX+bjVbWGXw7ZZWUbdENt8w0htPSrlgOOysQaU62U=
github.com/osbuild/blueprint v1.16.0 h1:f/kHih+xpeJ1v7wtIfzdHPZTsiXsqKeDQ1+rrue6298=
github.com/osbuild/blueprint v1.16.0/go.mod h1:HPlJzkEl7q5g8hzaGksUk7ifFAy9QFw9LmzhuFOAVm4=
github.com/osbuild/images v0.218.0 h1:Rh4KIvcdu569PfiBN/wmq/baCIWz91dZ2gO2ti5vnnA=
github.com/osbuild/images v0.218.0/go.mod h1:Cs7zFV8rmbVHn+19ArNdjd1AtFk+LC9dOOHuxiSLghw=
github.com/osbuild/images v0.221.0 h1:KT4IDdj8WqzmGKmrx3mPRcx9cWLPghkgZ7scl8hpZJQ=
github.com/osbuild/images v0.221.0/go.mod h1:Cs7zFV8rmbVHn+19ArNdjd1AtFk+LC9dOOHuxiSLghw=
github.com/osbuild/images v0.222.0 h1:NBv2DyEdHqv/khRDx7nCh/eT3E/WY3td5TwK6dOUWHY=
github.com/osbuild/images v0.222.0/go.mod h1:Cs7zFV8rmbVHn+19ArNdjd1AtFk+LC9dOOHuxiSLghw=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down
107 changes: 107 additions & 0 deletions test/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand All @@ -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):
Copy link
Contributor

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?

Copy link
Member

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-cli is the right place to have this type of test...

We do test this in osbuild/images for other distros, we should just add almalinux there, see https://github.com/osbuild/images/blob/main/pkg/distro/generic/rhel10_test.go#L240

It 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.

Copy link
Member Author

@supakeen supakeen Nov 24, 2025

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 azure image 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?

Copy link
Member

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 azure image types were only included starting from RHEL 8.x and/or that RHEL 8.x actually exists and has all required architectures?

I'll need to look at what we actually test to be able to answer.

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?

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.

Copy link
Member

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.

OK, that is a fair point, because we test only distro definitions. ibcli still reuses the DistroFactory, RepoRegistry and the embedded repo definitions from osbuild/images. So we should be definitely able to test all of this at the source of it, meaning osbuild/images.

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 azure image types were only included starting from RHEL 8.x and/or that RHEL 8.x actually exists and has all required architectures?

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.

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 = [
Copy link
Contributor

Choose a reason for hiding this comment

The 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)?

Copy link
Member Author

Choose a reason for hiding this comment

The 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
Expand Down
Loading