Skip to content

Commit 355b44b

Browse files
authored
Merge pull request #30856 from openshift-cherrypick-robot/cherry-pick-30722-to-release-4.21
[release-4.21] OCPBUGS-78064: Update optimized builds test to use rpm -qa instead of dnf
2 parents 29f54c3 + 638e5ce commit 355b44b

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)