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,19 +3,23 @@
load helpers
IMAGE="redis:alpine"
ROOT="$TESTDIR/crio"
RUNROOT="$TESTDIR/crio-run"
KPOD_OPTIONS="--root $ROOT --runroot $RUNROOT ${STORAGE_OPTS}"
ROOT="${TESTDIR}/crio"
RUNROOT="${TESTDIR}/crio-run"
# Do not add --storage-driver vfs
KPOD_OPTIONS="--root ${ROOT} --runroot ${RUNROOT} --runtime ${RUNTIME_BINARY}"
function teardown() {
cleanup_test
}
@test "kpod export output flag" {
start_crio
[ "$status" -eq 0 ]
run crioctl pod run --config "$TESTDATA"/sandbox_config.json
echo "$output"
[ "$status" -eq 0 ]
pod_id="$output"
run crioctl image pull "$IMAGE"
echo "$output"
[ "$status" -eq 0 ]
run crioctl ctr create --config "$TESTDATA"/container_config.json --pod "$pod_id"
echo "$output"
@ -25,11 +29,7 @@ KPOD_OPTIONS="--root $ROOT --runroot $RUNROOT ${STORAGE_OPTS}"
echo "$output"
[ "$status" -eq 0 ]
cleanup_ctrs
[ "$status" -eq 0 ]
cleanup_pods
[ "$status" -eq 0 ]
stop_crio
[ "$status" -eq 0 ]
rm -f container.tar
[ "$status" -eq 0 ]
}