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:
parent
e838611fdd
commit
e16bb3feb3
19 changed files with 350 additions and 295 deletions
|
@ -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,14 +10,15 @@ function teardown() {
|
|||
|
||||
@test "kpod save output 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
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
rm -f alpine.tar
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "kpod save oci flag" {
|
||||
|
@ -37,26 +35,28 @@ function teardown() {
|
|||
|
||||
@test "kpod save using stdout" {
|
||||
run ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${KPOD_BINARY} ${KPOD_OPTIONS} save > alpine.tar $IMAGE
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi $IMAGE
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
rm -f alpine.tar
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "kpod save quiet flag" {
|
||||
run ${KPOD_BINARY} ${KPOD_OPTIONS} pull $IMAGE
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${KPOD_BINARY} ${KPOD_OPTIONS} save -q -o alpine.tar $IMAGE
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi $IMAGE
|
||||
echo "$output"
|
||||
[ "$status" -eq 0 ]
|
||||
rm -f alpine.tar
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "kpod save non-existent image" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue