From e07e65f0163205d775a5de6b1316e87e261bb2a4 Mon Sep 17 00:00:00 2001 From: Petr Muller Date: Fri, 23 Jan 2026 13:53:37 +0100 Subject: [PATCH] test: Use rpm -qa in optimized builds test Replace 'yum list installed' with 'rpm -qa' to work with both microdnf-only and dnf/yum images. Update output check accordingly. Co-Authored-By: Claude Sonnet 4.5 --- test/extended/builds/optimized.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/extended/builds/optimized.go b/test/extended/builds/optimized.go index f874144074c0..778e9ca71155 100644 --- a/test/extended/builds/optimized.go +++ b/test/extended/builds/optimized.go @@ -26,7 +26,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds] Optimized image builds", func() skipLayers = buildv1.ImageOptimizationSkipLayers testDockerfile = fmt.Sprintf(` FROM %s -RUN yum list installed +RUN rpm -qa USER 1001 `, image.ShellImage()) ) @@ -85,7 +85,9 @@ USER 1001 s, err := result.Logs() o.Expect(err).NotTo(o.HaveOccurred()) - o.Expect(s).To(o.ContainSubstring("Installed Packages")) + // rpm -qa outputs package names directly (e.g. "bash-5.1.8-9.el9.x86_64") without headers, + // Verify the `rpm -qa` command succeeded by checking for bash + o.Expect(s).To(o.ContainSubstring("bash")) o.Expect(s).To(o.ContainSubstring(fmt.Sprintf("\"OPENSHIFT_BUILD_NAMESPACE\"=\"%s\"", oc.Namespace()))) o.Expect(s).To(o.ContainSubstring("Build complete, no image push requested")) e2e.Logf("Build logs:\n%v", result)