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