summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2017-11-22 11:00:50 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2017-11-22 16:46:53 +0000
commitbd4e106de3d890bd2b0520083c9ad7d314b61487 (patch)
treeafe04f2de5f9571fe3712d62a33ae7da4317419b /test
parent2a3934f1dae43589c50df8fa545d20405f64d7af (diff)
downloadpodman-bd4e106de3d890bd2b0520083c9ad7d314b61487.tar.gz
podman-bd4e106de3d890bd2b0520083c9ad7d314b61487.tar.bz2
podman-bd4e106de3d890bd2b0520083c9ad7d314b61487.zip
Add support for pid ns
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #54 Approved by: umohnani8
Diffstat (limited to 'test')
-rw-r--r--test/kpod_run_ns.bats28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/kpod_run_ns.bats b/test/kpod_run_ns.bats
new file mode 100644
index 000000000..eb0af6076
--- /dev/null
+++ b/test/kpod_run_ns.bats
@@ -0,0 +1,28 @@
+#!/usr/bin/env bats
+
+load helpers
+
+function setup() {
+ copy_images
+}
+
+@test "run pidns test" {
+
+ ${KPOD_BINARY} ${KPOD_OPTIONS} pull ${ALPINE}
+
+ run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run ${ALPINE} sh -c 'echo \$\$'"
+ echo $output
+ [ "$status" -eq 0 ]
+ pid=$(echo $output | tr -d '\r')
+ [ $pid = "1" ]
+
+ run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run --pid=host ${ALPINE} sh -c 'echo \$\$'"
+ echo $output
+ pid=$(echo $output | tr -d '\r')
+ [ "$status" -eq 0 ]
+ [ $pid != "1" ]
+
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} run --pid=badpid ${ALPINE} sh -c 'echo $$'
+ echo $output
+ [ "$status" -ne 0 ]
+}