1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Better test cleanup with defer

This fixes a few misuses of `deleteAllContainers()` cleanup
method in integration-cli suite by moving call to the
beginning of the method and guaranteeing their execution
(including panics) with `defer`s.

Also added some forgotten cleanup calls while I'm at it.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
This commit is contained in:
Ahmet Alp Balkan 2015-02-19 22:56:02 -08:00
parent a78ce5c228
commit 70407ce40c
16 changed files with 290 additions and 251 deletions

View file

@ -56,6 +56,8 @@ func TestRunRedirectStdout(t *testing.T) {
// Test recursive bind mount works by default
func TestRunWithVolumesIsRecursive(t *testing.T) {
defer deleteAllContainers()
tmpDir, err := ioutil.TempDir("", "docker_recursive_mount_test")
if err != nil {
t.Fatal(err)
@ -87,7 +89,5 @@ func TestRunWithVolumesIsRecursive(t *testing.T) {
t.Fatal("Recursive bind mount test failed. Expected file not found")
}
deleteAllContainers()
logDone("run - volumes are bind mounted recursively")
}