summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-14 07:50:15 -0400
committerGitHub <noreply@github.com>2022-03-14 07:50:15 -0400
commit219f1162407b8f4c2c05aa07166b999d64ead113 (patch)
tree0a25a2cf34698a2e3e7651a1bcda6cbcb0b08b44 /test
parent0144cabc41b82e4c1b59f681ca845c01ae1735de (diff)
parente8968c867f7af21f9e5eec661f7e057a74127511 (diff)
downloadpodman-219f1162407b8f4c2c05aa07166b999d64ead113.tar.gz
podman-219f1162407b8f4c2c05aa07166b999d64ead113.tar.bz2
podman-219f1162407b8f4c2c05aa07166b999d64ead113.zip
Merge pull request #13221 from LStandman/main
Add support for --chrootdirs
Diffstat (limited to 'test')
-rw-r--r--test/e2e/create_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/e2e/create_test.go b/test/e2e/create_test.go
index 6a4a394ef..339fa66d8 100644
--- a/test/e2e/create_test.go
+++ b/test/e2e/create_test.go
@@ -706,4 +706,34 @@ var _ = Describe("Podman create", func() {
Expect(create.ErrorToString()).To(ContainSubstring("cannot specify a new uid/gid map when entering a pod with an infra container"))
})
+
+ It("podman create --chrootdirs inspection test", func() {
+ session := podmanTest.Podman([]string{"create", "--chrootdirs", "/var/local/qwerty", ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ setup := podmanTest.Podman([]string{"container", "inspect", session.OutputToString()})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup).Should(Exit(0))
+
+ data := setup.InspectContainerToJSON()
+ Expect(data).To(HaveLen(1))
+ Expect(data[0].Config.ChrootDirs).To(HaveLen(1))
+ Expect(data[0].Config.ChrootDirs[0]).To(Equal("/var/local/qwerty"))
+ })
+
+ It("podman create --chrootdirs functionality test", func() {
+ session := podmanTest.Podman([]string{"create", "-t", "--chrootdirs", "/var/local/qwerty", ALPINE, "/bin/cat"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ ctrID := session.OutputToString()
+
+ setup := podmanTest.Podman([]string{"start", ctrID})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup).Should(Exit(0))
+
+ setup = podmanTest.Podman([]string{"exec", ctrID, "cmp", "/etc/resolv.conf", "/var/local/qwerty/etc/resolv.conf"})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup).Should(Exit(0))
+ })
})