Files
podman/test/podman_run_ns.bats
baude d0fb2e48e5 Don't pull cached images
In our tests, each test instance is already seeded with images.  In that case,
we do not need to pull down an image that is already seeded.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #191
Approved by: baude
2018-01-08 15:44:49 +00:00

45 lines
1.0 KiB
Bash

#!/usr/bin/env bats
load helpers
function teardown() {
cleanup_test
}
function setup() {
copy_images
}
@test "run pidns test" {
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run ${ALPINE} sh -c 'echo \$\$'"
echo $output
[ "$status" -eq 0 ]
pid=$(echo $output | tr -d '\r')
[ $pid = "1" ]
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run --pid=host ${ALPINE} sh -c 'echo \$\$'"
echo $output
pid=$(echo $output | tr -d '\r')
[ "$status" -eq 0 ]
[ $pid != "1" ]
run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run --pid=badpid ${ALPINE} sh -c 'echo $$'
echo $output
[ "$status" -ne 0 ]
}
@test "run ipcns test" {
tmp=$(mktemp /dev/shm/foo.XXXXX)
run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run --ipc=host ${ALPINE} ls $tmp
echo $output
out=$(echo $output | tr -d '\r')
[ "$status" -eq 0 ]
[ $out != $tmp ]
rm -f $tmp
run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run --ipc=badpid ${ALPINE} sh -c 'echo $$'
echo $output
[ "$status" -ne 0 ]
}