瀏覽代碼

add cleanupin tests to remove leftover containers

Victor Vieux 11 年之前
父節點
當前提交
f854529ae8
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      runtime_test.go

+ 7 - 0
runtime_test.go

@@ -94,6 +94,13 @@ func init() {
 		globalRuntime = runtime
 	}
 
+	// Cleanup any leftover container
+	for _, container := range globalRuntime.List() {
+		if err := globalRuntime.Destroy(container); err != nil {
+			log.Fatalf("Error destroying leftover container: %s", err)
+		}
+	}
+
 	// Create the "Server"
 	srv := &Server{
 		runtime:     globalRuntime,