diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 174f042c90..92aba5a133 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -727,6 +727,13 @@ func SkipIfNotSystemd(manager, reason string) { } } +func SkipOnOSVersion(os, version string) { + info := GetHostDistributionInfo() + if info.Distribution == os && info.Version == version { + Skip(fmt.Sprintf("Test doesn't work on %s %s", os, version)) + } +} + func SkipIfNotFedora() { info := GetHostDistributionInfo() if info.Distribution != "fedora" { diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go index b5c00add5c..38111896be 100644 --- a/test/e2e/run_userns_test.go +++ b/test/e2e/run_userns_test.go @@ -109,13 +109,16 @@ var _ = Describe("Podman UserNS support", func() { }) It("podman uidmapping and gidmapping with an idmapped volume", func() { - Skip("it depends on a breaking change in crun: https://github.com/containers/crun/pull/1147") SkipIfRunc(podmanTest, "Test not supported yet with runc, see issue #17433") + SkipOnOSVersion("fedora", "36") session := podmanTest.Podman([]string{"run", "--uidmap=0:1:500", "--gidmap=0:200:5000", "-v", "my-foo-volume:/foo:Z,idmap", "alpine", "stat", "-c", "#%u:%g#", "/foo"}) session.WaitWithDefaultTimeout() if strings.Contains(session.ErrorToString(), "Operation not permitted") { Skip("not sufficiently privileged") } + if strings.Contains(session.ErrorToString(), "Invalid argument") { + Skip("the file system doesn't support idmapped mounts") + } Expect(session).Should(Exit(0)) Expect(session.OutputToString()).To(ContainSubstring("#0:0#")) })