Refactor kpod tests

Move kpod tests from kpod.bats to kpod_[commandname].bats
Also make sure all status checks have a echo $output before them.

Signed-off-by: Ryan Cole <rcyoalne@gmail.com>

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Signed-off-by: umohnani8 <umohnani@redhat.com>
This commit is contained in:
Daniel J Walsh 2017-08-31 08:46:26 -04:00 committed by umohnani8
parent e838611fdd
commit e16bb3feb3
19 changed files with 350 additions and 295 deletions

View file

@ -3,9 +3,6 @@
load helpers
IMAGE="alpine:latest"
ROOT="$TESTDIR/crio"
RUNROOT="$TESTDIR/crio-run"
KPOD_OPTIONS="--root $ROOT --runroot $RUNROOT $STORAGE_OPTS"
function teardown() {
cleanup_test
@ -13,17 +10,20 @@ function teardown() {
@test "kpod load input flag" {
run ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
echo "$output"
[ "$status" -eq 0 ]
run ${KPOD_BINARY} ${KPOD_OPTIONS} save -o alpine.tar $IMAGE
echo "$output"
[ "$status" -eq 0 ]
run ${KPOD_BINARY} $KPOD_OPTIONS rmi $IMAGE
run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi $IMAGE
echo "$output"
[ "$status" -eq 0 ]
run ${KPOD_BINARY} ${KPOD_OPTIONS} load -i alpine.tar
echo "$output"
[ "$status" -eq 0 ]
rm -f alpine.tar
[ "$status" -eq 0 ]
run ${KPOD_BINARY} $KPOD_OPTIONS rmi $IMAGE
run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi $IMAGE
echo "$output"
[ "$status" -eq 0 ]
}
@ -38,24 +38,25 @@ function teardown() {
echo "$output"
[ "$status" -eq 0 ]
rm -f alpine.tar
[ "$status" -eq 0 ]
run ${KPOD_BINARY} $KPOD_OPTIONS rmi $IMAGE
[ "$status" -eq 0 ]
}
@test "kpod load using quiet flag" {
run ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
echo "$output"
[ "$status" -eq 0 ]
run ${KPOD_BINARY} ${KPOD_OPTIONS} save -o alpine.tar $IMAGE
echo "$output"
[ "$status" -eq 0 ]
run ${KPOD_BINARY} $KPOD_OPTIONS rmi $IMAGE
run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi $IMAGE
echo "$output"
[ "$status" -eq 0 ]
run ${KPOD_BINARY} ${KPOD_OPTIONS} load -q -i alpine.tar
echo "$output"
[ "$status" -eq 0 ]
rm -f alpine.tar
[ "$status" -eq 0 ]
run ${KPOD_BINARY} $KPOD_OPTIONS rmi $IMAGE
run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi $IMAGE
[ "$status" -eq 0 ]
}