Explorar o código

libnetwork: fix TestParallel "bad file descriptor"

When running inside a container, testns == origns. Consequently, closing
testns causes the deferred netns.Set(origns) call to fail. Stop closing
the aliased original namespace handle.

Signed-off-by: Cory Snider <csnider@mirantis.com>
Cory Snider %!s(int64=2) %!d(string=hai) anos
pai
achega
f39b83e232
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      libnetwork/libnetwork_linux_test.go

+ 3 - 1
libnetwork/libnetwork_linux_test.go

@@ -1046,7 +1046,9 @@ func runParallelTests(t *testing.T, thrNumber int) {
 			<-thrdone
 		}
 
-		testns.Close()
+		if testns != origins {
+			testns.Close()
+		}
 		if err := net2.Delete(); err != nil {
 			t.Fatal(err)
 		}