From f5560fc2013159a206d7683381bb7c8b288a19b2 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 10 Aug 2017 16:50:48 -0400 Subject: [PATCH] kpod.bats: fix syntax errors and check "rmi" The cleanup routine at the end of one of the test functions wasn't in the function, so it was executed at the wrong time. Some calls to "[ -eq" didn't put whitespace between the righthand value and "]". Make sure to check on the exit status returned by "kpod rmi" every time we call it. Signed-off-by: Nalin Dahyabhai --- test/kpod.bats | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/kpod.bats b/test/kpod.bats index c00a8346..7655c4db 100644 --- a/test/kpod.bats +++ b/test/kpod.bats @@ -198,8 +198,9 @@ function teardown() { run bash -c "${KPOD_BINARY} $KPOD_OPTIONS inspect redis:alpine | python -m json.tool" echo "$output" [ "$status" -eq 0 ] -} run ${KPOD_BINARY} $KPOD_OPTIONS rmi redis:alpine + [ "$status" -eq 0 ] +} @test "kpod inspect non-existent container" { @@ -212,12 +213,13 @@ function teardown() { run ${KPOD_BINARY} $KPOD_OPTIONS pull redis:alpine [ "$status" -eq 0 ] run ${KPOD_BINARY} $KPOD_OPTIONS --format {{.ID}} inspect redis:alpine - [ "$status" -eq 0] + [ "$status" -eq 0 ] inspectOutput="$output" run ${KPOD_BINARY} $KPOD_OPTIONS images --quiet redis:alpine - [ "$status" -eq 0] + [ "$status" -eq 0 ] [ "$output" -eq "$inspectOutput" ] run ${KPOD_BINARY} $KPOD_OPTIONS rmi redis:alpine + [ "$status" -eq 0 ] } @test "kpod inspect specified type" { @@ -225,8 +227,9 @@ function teardown() { [ "$status" -eq 0 ] run bash -c "${KPOD_BINARY} $KPOD_OPTIONS inspect --type image redis:alpine | python -m json.tool" echo "$output" - [ "$status" -eq 0] + [ "$status" -eq 0 ] run ${KPOD_BINARY} $KPOD_OPTIONS rmi redis:alpine + [ "$status" -eq 0 ] } @test "kpod images" {