mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
Add support for pid ns
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #54 Approved by: umohnani8
This commit is contained in:

committed by
Atomic Bot

parent
2a3934f1da
commit
bd4e106de3
28
test/kpod_run_ns.bats
Normal file
28
test/kpod_run_ns.bats
Normal file
@ -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 ]
|
||||
}
|
Reference in New Issue
Block a user