e3f83fd53d
Signed-off-by: Stephen J Day <stephen.day@docker.com>
24 lines
424 B
Go
24 lines
424 B
Go
package testutil
|
|
|
|
import (
|
|
"os/exec"
|
|
"testing"
|
|
|
|
"github.com/docker/containerd"
|
|
)
|
|
|
|
func UnmountAll(t *testing.T, mounts []containerd.Mount) {
|
|
for _, mount := range mounts {
|
|
Unmount(t, mount.Target)
|
|
}
|
|
}
|
|
|
|
func Unmount(t *testing.T, mountPoint string) {
|
|
t.Log("unmount", mountPoint)
|
|
umount := exec.Command("umount", mountPoint)
|
|
err := umount.Run()
|
|
if err != nil {
|
|
|
|
t.Error("Could not umount", mountPoint, err)
|
|
}
|
|
}
|