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 <kolyshkin@gmail.com> (cherry picked from commit 73baee2dcf546b2561bdd9a500b0af08cb62b1be) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 90cb9b6545fbf7f91cf3eb427f627a7353ea684f Component: engine
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
8c5907db72
commit
b4531f8e24
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user