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

@ -1,11 +1,8 @@
#/usr/bin/env bats
#!/usr/bin/env bats
load helpers
IMAGE="alpine:latest"
ROOT="$TESTDIR/crio"
RUNROOT="$TESTDIR/crio-run"
KPOD_OPTIONS="--root $ROOT --runroot $RUNROOT $STORAGE_OPTS"
function teardown() {
cleanup_test
@ -18,14 +15,15 @@ function teardown() {
run ${KPOD_BINARY} $KPOD_OPTIONS diff $IMAGE
echo "$output"
[ "$status" -eq 0 ]
run ${KPOD_BINARY} $KPOD_OPTIONS rmi $IMAGE
echo "$output"
run ${KKPOD_BINARY} $KPOD_OPTIONS rmi $IMAGE
[ "$status" -eq 0 ]
}
@test "test diff on non-existent layer" {
run ${KPOD_BINARY} $KPOD_OPTIONS diff "abc123"
[ "$status" -ne 0 ]
echo "$output"
[ "$status" -ne 0 ]
}
@test "test diff with json output" {
@ -36,5 +34,7 @@ function teardown() {
run ${KPOD_BINARY} $KPOD_OPTIONS diff --format json $IMAGE
echo "$output"
[ "$status" -eq 0 ]
run ${KKPOD_BINARY} $KPOD_OPTIONS rmi $IMAGE
run ${KPOD_BINARY} $KPOD_OPTIONS rmi $IMAGE
echo "$output"
[ "$status" -eq 0 ]
}