From 73baee2dcf546b2561bdd9a500b0af08cb62b1be Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 5 Oct 2018 11:10:28 -0700 Subject: [PATCH] integration-cli: fix netns test cleanup 1. Using MNT_FORCE flag does not make sense for nsfs. Using MNT_DETACH though might help. 2. When -check.vv is added to TESTFLAGS, there are a lot of messages like this one: > unmount of /tmp/dxr/d847fd103a4ba/netns failed: invalid argument and some like > unmount of /tmp/dxr/dd245af642d94/netns failed: no such file or directory The first one means directory is not a mount point, the second one means it's gone. Do ignore both of these. Signed-off-by: Kir Kolyshkin --- internal/test/daemon/daemon_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/test/daemon/daemon_unix.go b/internal/test/daemon/daemon_unix.go index 9dd9e36f0c..eb604fec75 100644 --- a/internal/test/daemon/daemon_unix.go +++ b/internal/test/daemon/daemon_unix.go @@ -21,7 +21,7 @@ func cleanupNetworkNamespace(t testingT, execRoot string) { // new exec root. netnsPath := filepath.Join(execRoot, "netns") filepath.Walk(netnsPath, func(path string, info os.FileInfo, err error) error { - if err := unix.Unmount(path, unix.MNT_FORCE); err != nil { + if err := unix.Unmount(path, unix.MNT_DETACH); err != nil && err != unix.EINVAL && err != unix.ENOENT { t.Logf("unmount of %s failed: %v", path, err) } os.Remove(path)