From 3180e387955c7777ab15ed2dfe7e587b54e8c308 Mon Sep 17 00:00:00 2001
From: Matthew Heon <matthew.heon@gmail.com>
Date: Tue, 28 Nov 2017 21:50:58 -0500
Subject: Move removal of containers into teardown helper

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #68
Approved by: rhatdan
---
 test/helpers.bash     | 1 +
 test/kpod_create.bats | 1 -
 test/kpod_export.bats | 1 -
 test/kpod_kill.bats   | 1 -
 test/kpod_logs.bats   | 1 -
 test/kpod_mount.bats  | 1 -
 test/kpod_pause.bats  | 1 -
 test/kpod_ps.bats     | 1 -
 test/kpod_rm.bats     | 1 -
 test/kpod_run.bats    | 1 -
 test/kpod_run_ns.bats | 1 -
 test/kpod_stop.bats   | 1 -
 12 files changed, 1 insertion(+), 11 deletions(-)

(limited to 'test')

diff --git a/test/helpers.bash b/test/helpers.bash
index 3280e70fd..d9616ad45 100644
--- a/test/helpers.bash
+++ b/test/helpers.bash
@@ -161,6 +161,7 @@ function wait_until_reachable() {
 }
 
 function cleanup_test() {
+	run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm --force --all"
 	rm -rf "$TESTDIR"
 }
 
diff --git a/test/kpod_create.bats b/test/kpod_create.bats
index 6d7704b5d..3d3efcff3 100644
--- a/test/kpod_create.bats
+++ b/test/kpod_create.bats
@@ -7,7 +7,6 @@ function setup() {
 }
 
 function teardown() {
-    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 db4d295d9..5b8517afc 100644
--- a/test/kpod_export.bats
+++ b/test/kpod_export.bats
@@ -3,7 +3,6 @@
 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 6fe67d643..6f4f2e268 100644
--- a/test/kpod_kill.bats
+++ b/test/kpod_kill.bats
@@ -3,7 +3,6 @@
 load helpers
 
 function teardown() {
-    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 9cac321db..d5dc8622e 100644
--- a/test/kpod_logs.bats
+++ b/test/kpod_logs.bats
@@ -3,7 +3,6 @@
 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 400a52fdf..aced0858d 100644
--- a/test/kpod_mount.bats
+++ b/test/kpod_mount.bats
@@ -5,7 +5,6 @@ load helpers
 IMAGE="redis:alpine"
 
 function teardown() {
-    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 812a2e979..3d6ab7b91 100644
--- a/test/kpod_pause.bats
+++ b/test/kpod_pause.bats
@@ -7,7 +7,6 @@ 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 f5641115d..859cbaa99 100644
--- a/test/kpod_ps.bats
+++ b/test/kpod_ps.bats
@@ -8,7 +8,6 @@ function setup() {
 }
 
 function teardown() {
-    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 b84cb2de5..e9843659a 100644
--- a/test/kpod_rm.bats
+++ b/test/kpod_rm.bats
@@ -7,7 +7,6 @@ function setup() {
 }
 
 function teardown() {
-    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 b132fb546..65f3e9df4 100644
--- a/test/kpod_run.bats
+++ b/test/kpod_run.bats
@@ -3,7 +3,6 @@
 load helpers
 
 function teardown() {
-    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 cc3a6b211..233f8158b 100644
--- a/test/kpod_run_ns.bats
+++ b/test/kpod_run_ns.bats
@@ -3,7 +3,6 @@
 load helpers
 
 function teardown() {
-    run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm -f -a"
     cleanup_test
 }
 
diff --git a/test/kpod_stop.bats b/test/kpod_stop.bats
index 89a20f0f2..0c1bd329c 100644
--- a/test/kpod_stop.bats
+++ b/test/kpod_stop.bats
@@ -3,7 +3,6 @@
 load helpers
 
 function teardown() {
-    run bash -c "${KPOD_BINARY} ${KPOD_OPTIONS} rm --force --all"
     cleanup_test
 }
 
-- 
cgit v1.2.3-54-g00ecf