Unify testutil.Unmount on Windows and Unix

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
This commit is contained in:
Paul "TBBle" Hampson
2020-12-13 20:51:13 +11:00
committed by Gabriel Adrian Samfira
parent 474a257b16
commit 84cc3e496b
4 changed files with 12 additions and 14 deletions

View File

@@ -23,17 +23,9 @@ import (
"os"
"testing"
"github.com/containerd/containerd/mount"
"github.com/stretchr/testify/assert"
)
// Unmount unmounts a given mountPoint and sets t.Error if it fails
func Unmount(t testing.TB, mountPoint string) {
t.Log("unmount", mountPoint)
err := mount.UnmountAll(mountPoint, umountflags)
assert.NoError(t, err)
}
// RequiresRoot skips tests that require root, unless the test.root flag has
// been set
func RequiresRoot(t testing.TB) {