aboutsummaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorLStandman <65296484+LStandman@users.noreply.github.com>2022-02-12 13:45:49 +0200
committerLStandman <65296484+LStandman@users.noreply.github.com>2022-03-14 10:31:58 +0200
commite8968c867f7af21f9e5eec661f7e057a74127511 (patch)
tree0a25a2cf34698a2e3e7651a1bcda6cbcb0b08b44 /test/e2e
parent0144cabc41b82e4c1b59f681ca845c01ae1735de (diff)
downloadpodman-e8968c867f7af21f9e5eec661f7e057a74127511.tar.gz
podman-e8968c867f7af21f9e5eec661f7e057a74127511.tar.bz2
podman-e8968c867f7af21f9e5eec661f7e057a74127511.zip
Add support for --chrootdirs
Signed-off-by: LStandman <65296484+LStandman@users.noreply.github.com>
Diffstat (limited to 'test/e2e')
-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))
+ })
})