Skip to content

Commit

Permalink
Merge pull request #17739 from giuseppe/reenable-test
Browse files Browse the repository at this point in the history
test: reenable idmap test
  • Loading branch information
openshift-merge-robot authored Mar 13, 2023
2 parents 3920799 + fb4f6f9 commit 519cfa8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions test/e2e/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
5 changes: 4 additions & 1 deletion test/e2e/run_userns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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#"))
})
Expand Down

0 comments on commit 519cfa8

Please sign in to comment.