snapshots: separate implementations into packages
Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
c7f77f475a
commit
e3f83fd53d
8 changed files with 22 additions and 16 deletions
24
snapshot/testutil/helpers.go
Normal file
24
snapshot/testutil/helpers.go
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue