Move detach flags to platform specific

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2017-08-22 17:20:25 -07:00
parent f74cea71dd
commit 96a75ab1ab
7 changed files with 22 additions and 11 deletions

View File

@@ -9,13 +9,12 @@ import (
"github.com/containerd/containerd/mount"
"github.com/stretchr/testify/assert"
"golang.org/x/sys/unix"
)
// Unmount unmounts a given mountPoint and sets t.Error if it fails
func Unmount(t *testing.T, mountPoint string) {
t.Log("unmount", mountPoint)
if err := mount.UnmountAll(mountPoint, unix.MNT_DETACH); err != nil {
if err := mount.UnmountAll(mountPoint, umountflags); err != nil {
t.Error("Could not umount", mountPoint, err)
}
}