Attempt fix for persistent bash parameter expansion issues

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #68
Approved by: rhatdan
This commit is contained in:
Matthew Heon
2017-11-28 22:17:13 -05:00
committed by Atomic Bot
parent 3180e38795
commit 4a68a5303c
5 changed files with 30 additions and 30 deletions

View File

@ -162,6 +162,7 @@ function wait_until_reachable() {
function cleanup_test() {
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm --force --all"
echo "$output"
rm -rf "$TESTDIR"
}

View File

@ -11,13 +11,13 @@ function setup() {
}
@test "run a container based on local image" {
run ${KPOD_BINARY} ${KPOD_OPTIONS} run $BB ls
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run $BB ls"
echo "$output"
[ "$status" -eq 0 ]
}
@test "run a container based on a remote image" {
run ${KPOD_BINARY} ${KPOD_OPTIONS} run ${BB_GLIBC} ls
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run ${BB_GLIBC} ls"
echo "$output"
[ "$status" -eq 0 ]
}
@ -27,11 +27,11 @@ function setup() {
skip "SELinux not enabled"
fi
run ${KPOD_BINARY} ${KPOD_OPTIONS} run ${ALPINE} cat /proc/self/attr/current
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run ${ALPINE} cat /proc/self/attr/current"
echo "$output"
firstLabel=$output
run ${KPOD_BINARY} ${KPOD_OPTIONS} run ${ALPINE} cat /proc/self/attr/current
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run ${ALPINE} cat /proc/self/attr/current"
echo "$output"
[ "$output" != "${firstLabel}" ]
}
@ -46,19 +46,19 @@ function setup() {
}
@test "run capabilities test" {
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} run --cap-add all ${ALPINE} cat /proc/self/status
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run --cap-add all ${ALPINE} cat /proc/self/status"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} run --cap-add sys_admin ${ALPINE} cat /proc/self/status
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run --cap-add sys_admin ${ALPINE} cat /proc/self/status"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} run --cap-drop all ${ALPINE} cat /proc/self/status
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run --cap-drop all ${ALPINE} cat /proc/self/status"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} run --cap-drop setuid ${ALPINE} cat /proc/self/status
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run --cap-drop setuid ${ALPINE} cat /proc/self/status"
echo "$output"
[ "$status" -eq 0 ]
@ -83,7 +83,7 @@ function setup() {
[ "$status" -eq 0 ]
[ "$output" = "BAR" ]
run ${KPOD_BINARY} ${KPOD_OPTIONS} run -env FOO ${ALPINE} printenv
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run -env FOO ${ALPINE} printenv"
echo "$output"
[ "$status" -ne 0 ]
@ -99,9 +99,9 @@ IMAGE="docker.io/library/fedora:latest"
@test "run limits test" {
${KPOD_BINARY} ${KPOD_OPTIONS} pull ${IMAGE}
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} pull ${IMAGE}"
run ${KPOD_BINARY} ${KPOD_OPTIONS} run --ulimit rtprio=99 --cap-add=sys_nice ${IMAGE} cat /proc/self/sched
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} run --ulimit rtprio=99 --cap-add=sys_nice ${IMAGE} cat /proc/self/sched"
echo $output
[ "$status" -eq 0 ]

View File

@ -11,35 +11,34 @@ function setup() {
}
@test "kpod save output flag" {
run ${KPOD_BINARY} ${KPOD_OPTIONS} save -o alpine.tar $ALPINE
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} save -o alpine.tar $ALPINE"
echo "$output"
[ "$status" -eq 0 ]
rm -f alpine.tar
}
@test "kpod save oci flag" {
run ${KPOD_BINARY} ${KPOD_OPTIONS} save -o alpine.tar --format oci-archive $ALPINE
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} save -o alpine.tar --format oci-archive $ALPINE"
echo "$output"
[ "$status" -eq 0 ]
rm -f alpine.tar
}
@test "kpod save using stdout" {
run ${KPOD_BINARY} ${KPOD_OPTIONS} save > alpine.tar $ALPINE
echo "$output"
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} save $ALPINE > alpine.tar"
[ "$status" -eq 0 ]
rm -f alpine.tar
}
@test "kpod save quiet flag" {
run ${KPOD_BINARY} ${KPOD_OPTIONS} save -q -o alpine.tar $ALPINE
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} save -q -o alpine.tar $ALPINE"
echo "$output"
[ "$status" -eq 0 ]
rm -f alpine.tar
}
@test "kpod save non-existent image" {
run ${KPOD_BINARY} ${KPOD_OPTIONS} save -o alpine.tar FOOBAR
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} save -o alpine.tar FOOBAR"
echo "$output"
[ "$status" -ne 0 ]
}

View File

@ -9,42 +9,42 @@ function teardown() {
}
@test "kpod tag with shortname:latest" {
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} tag $IMAGE foobar:latest
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} tag $IMAGE foobar:latest"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} inspect foobar:latest
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} inspect foobar:latest"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} rmi --force foobar:latest
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rmi --force foobar:latest"
[ "$status" -eq 0 ]
}
@test "kpod tag with shortname" {
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} tag $IMAGE foobar
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} tag $IMAGE foobar"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} inspect foobar:latest
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} inspect foobar:latest"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} rmi --force foobar:latest
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rmi --force foobar:latest"
[ "$status" -eq 0 ]
}
@test "kpod tag with shortname:tag" {
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} tag $IMAGE foobar:v
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} tag $IMAGE foobar:v"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} inspect foobar:v
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} inspect foobar:v"
echo "$output"
[ "$status" -eq 0 ]
run bash -c ${KPOD_BINARY} ${KPOD_OPTIONS} rmi --force foobar:v
run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rmi --force foobar:v"
[ "$status" -eq 0 ]
}

View File

@ -7,7 +7,7 @@ function teardown() {
}
@test "kpod version test" {
run bash -c ${KPOD_BINARY} version
run bash -c "${KPOD_BINARY} version"
echo "$output"
[ "$status" -eq 0 ]
}