aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@suse.com>2018-07-09 19:20:45 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-09 20:02:29 +0000
commita62b3436db1929b5f73e247f4d1913072db09db1 (patch)
tree86bb0d735922cb282ae2fd069cdb362d55b0c024 /test
parent4855998f1cf533b27e48b2ded5541841fe6a3ea6 (diff)
downloadpodman-a62b3436db1929b5f73e247f4d1913072db09db1.tar.gz
podman-a62b3436db1929b5f73e247f4d1913072db09db1.tar.bz2
podman-a62b3436db1929b5f73e247f4d1913072db09db1.zip
urfave/cli: fix regression in short-opts parsing
Add the actual argument, not the one we're looking for when searching the to-be-translated short-opt string. Otherwise, we're likely to hit an infinite loop. Signed-off-by: Valentin Rothberg <vrothberg@suse.com> Closes: #1066 Approved by: rhatdan
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_userns_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go
index 512857bcb..57c11848a 100644
--- a/test/e2e/run_userns_test.go
+++ b/test/e2e/run_userns_test.go
@@ -43,6 +43,25 @@ var _ = Describe("Podman UserNS support", func() {
Expect(ok).To(BeTrue())
})
+ // It essentially repeats the test above but with the `-it` short option
+ // that broke execution at:
+ // https://github.com/projectatomic/libpod/pull/1066#issuecomment-403562116
+ // To avoid a potential future regression, use this as a test.
+ It("podman uidmapping and gidmapping with short-opts", func() {
+ if os.Getenv("SKIP_USERNS") != "" {
+ Skip("Skip userns tests.")
+ }
+ if _, err := os.Stat("/proc/self/uid_map"); err != nil {
+ Skip("User namespaces not supported.")
+ }
+
+ session := podmanTest.Podman([]string{"run", "--uidmap=0:1:70000", "--gidmap=0:20000:70000", "-it", "busybox", "echo", "hello"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ ok, _ := session.GrepString("hello")
+ Expect(ok).To(BeTrue())
+ })
+
It("podman uidmapping and gidmapping --net=host", func() {
if os.Getenv("SKIP_USERNS") != "" {
Skip("Skip userns tests.")