Skip to content

Commit c608346

Browse files
committed
e2e: skip if cluster version less than 4.22
We don't want this test to run on older versions because we don't have the selinux data in older MG releases, which means the test is gonna failed. Signed-off-by: Talor Itzhak <titzhak@redhat.com>
1 parent 72d9e43 commit c608346

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/e2e/must-gather/must_gather_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ var _ = Describe("[must-gather] NRO data collected", func() {
190190
})
191191

192192
It("check SELinux data files have been collected", func(ctx context.Context) {
193+
minVersion, err := platform.ParseVersion("4.22")
194+
Expect(err).ToNot(HaveOccurred(), "failed to parse minimum version")
195+
supported, err := configuration.PlatVersion.AtLeast(minVersion)
196+
Expect(err).ToNot(HaveOccurred(), "failed to compare versions: %v vs %v", configuration.PlatVersion, minVersion)
197+
if !supported {
198+
Skip(fmt.Sprintf("SELinux data collection is only supported on cluster version %s or newer, got %s", minVersion, configuration.PlatVersion))
199+
}
200+
193201
destDirContent, err := os.ReadDir(destDir)
194202
Expect(err).NotTo(HaveOccurred(), "unable to read contents from destDir:%s. error: %w", destDir, err)
195203

0 commit comments

Comments
 (0)