snapshots: separate implementations into packages

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2017-01-13 15:31:21 -08:00
parent c7f77f475a
commit e3f83fd53d
8 changed files with 22 additions and 16 deletions

View file

@ -0,0 +1,24 @@
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)
}
}