Skip to content

Commit 638e5ce

Browse files
petr-mullerclaude
authored andcommitted
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 <noreply@anthropic.com>
1 parent 29f54c3 commit 638e5ce

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test/extended/builds/optimized.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var _ = g.Describe("[sig-builds][Feature:Builds] Optimized image builds", func()
2626
skipLayers = buildv1.ImageOptimizationSkipLayers
2727
testDockerfile = fmt.Sprintf(`
2828
FROM %s
29-
RUN yum list installed
29+
RUN rpm -qa
3030
USER 1001
3131
`, image.ShellImage())
3232
)
@@ -85,7 +85,9 @@ USER 1001
8585

8686
s, err := result.Logs()
8787
o.Expect(err).NotTo(o.HaveOccurred())
88-
o.Expect(s).To(o.ContainSubstring("Installed Packages"))
88+
// rpm -qa outputs package names directly (e.g. "bash-5.1.8-9.el9.x86_64") without headers,
89+
// Verify the `rpm -qa` command succeeded by checking for bash
90+
o.Expect(s).To(o.ContainSubstring("bash"))
8991
o.Expect(s).To(o.ContainSubstring(fmt.Sprintf("\"OPENSHIFT_BUILD_NAMESPACE\"=\"%s\"", oc.Namespace())))
9092
o.Expect(s).To(o.ContainSubstring("Build complete, no image push requested"))
9193
e2e.Logf("Build logs:\n%v", result)

0 commit comments

Comments
 (0)