From e36483b1e644f8fb6f14a62c062ea635fb6851ed Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 28 Nov 2017 13:41:19 -0500 Subject: [PATCH] Fix tests - use rm -a -f instead of nested commands Signed-off-by: Matthew Heon Closes: #68 Approved by: rhatdan --- test/kpod_create.bats | 2 +- test/kpod_export.bats | 1 + test/kpod_kill.bats | 2 +- test/kpod_logs.bats | 1 + test/kpod_mount.bats | 2 +- test/kpod_pause.bats | 1 + test/kpod_ps.bats | 2 +- test/kpod_rm.bats | 2 +- test/kpod_run.bats | 2 +- test/kpod_run_ns.bats | 5 +++++ test/kpod_stop.bats | 2 +- 11 files changed, 15 insertions(+), 7 deletions(-) diff --git a/test/kpod_create.bats b/test/kpod_create.bats index 7346834c79..6d7704b5d4 100644 --- a/test/kpod_create.bats +++ b/test/kpod_create.bats @@ -7,7 +7,7 @@ function setup() { } function teardown() { - run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f `${KPOD_BINARY} ${KPOD_OPTIONS} ps -a -q`" + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f -a" cleanup_test } diff --git a/test/kpod_export.bats b/test/kpod_export.bats index 5b8517afc1..db4d295d9d 100644 --- a/test/kpod_export.bats +++ b/test/kpod_export.bats @@ -3,6 +3,7 @@ load helpers function teardown() { + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f -a" cleanup_test } diff --git a/test/kpod_kill.bats b/test/kpod_kill.bats index c0f01e8b4b..6fe67d6437 100644 --- a/test/kpod_kill.bats +++ b/test/kpod_kill.bats @@ -3,7 +3,7 @@ load helpers function teardown() { - run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f `${KPOD_BINARY} ${KPOD_OPTIONS} ps -a -q`" + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm --force --all" cleanup_test } diff --git a/test/kpod_logs.bats b/test/kpod_logs.bats index d5dc8622e2..9cac321dbf 100644 --- a/test/kpod_logs.bats +++ b/test/kpod_logs.bats @@ -3,6 +3,7 @@ load helpers function teardown() { + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f -a" cleanup_test } diff --git a/test/kpod_mount.bats b/test/kpod_mount.bats index 46d10ad2e6..400a52fdfd 100644 --- a/test/kpod_mount.bats +++ b/test/kpod_mount.bats @@ -5,7 +5,7 @@ load helpers IMAGE="redis:alpine" function teardown() { - run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f `${KPOD_BINARY} ${KPOD_OPTIONS} ps -a -q`" + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f -a" cleanup_test } diff --git a/test/kpod_pause.bats b/test/kpod_pause.bats index 3d6ab7b918..812a2e9796 100644 --- a/test/kpod_pause.bats +++ b/test/kpod_pause.bats @@ -7,6 +7,7 @@ function setup() { } function teardown() { + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f -a" cleanup_test } diff --git a/test/kpod_ps.bats b/test/kpod_ps.bats index 99127cb8f9..f5641115d0 100644 --- a/test/kpod_ps.bats +++ b/test/kpod_ps.bats @@ -8,7 +8,7 @@ function setup() { } function teardown() { - run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f `${KPOD_BINARY} ${KPOD_OPTIONS} ps -a -q`" + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm --force --all" cleanup_test } diff --git a/test/kpod_rm.bats b/test/kpod_rm.bats index ad8d43062f..74d22e9eaa 100644 --- a/test/kpod_rm.bats +++ b/test/kpod_rm.bats @@ -7,7 +7,7 @@ function setup() { } function teardown() { - run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f `${KPOD_BINARY} ${KPOD_OPTIONS} ps -a -q`" + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm --force --all" cleanup_test } diff --git a/test/kpod_run.bats b/test/kpod_run.bats index ee21430f8e..b132fb546e 100644 --- a/test/kpod_run.bats +++ b/test/kpod_run.bats @@ -3,7 +3,7 @@ load helpers function teardown() { - run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f `${KPOD_BINARY} ${KPOD_OPTIONS} ps -a -q`" + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f -a" cleanup_test } diff --git a/test/kpod_run_ns.bats b/test/kpod_run_ns.bats index eb0af6076e..cc3a6b211a 100644 --- a/test/kpod_run_ns.bats +++ b/test/kpod_run_ns.bats @@ -2,6 +2,11 @@ load helpers +function teardown() { + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f -a" + cleanup_test +} + function setup() { copy_images } diff --git a/test/kpod_stop.bats b/test/kpod_stop.bats index 631aa59958..926d0991c7 100644 --- a/test/kpod_stop.bats +++ b/test/kpod_stop.bats @@ -3,7 +3,7 @@ load helpers function teardown() { - run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f `${KPOD_BINARY} ${KPOD_OPTIONS} ps -a -q`" + run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f -a" cleanup_test }