mirror of
https://github.com/containers/podman.git
synced 2025-06-26 12:56:45 +08:00
Merge pull request #17739 from giuseppe/reenable-test
test: reenable idmap test
This commit is contained in:
@ -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" {
|
||||
|
@ -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#"))
|
||||
})
|
||||
|
Reference in New Issue
Block a user