mirror of
https://github.com/restic/restic.git
synced 2026-11-28 15:26:48 +00:00
Cleanup mount after test
This commit is contained in:
1 parent
d7888d4dd5
commit
a4d122e5ae
1 file changed
+11
@@ -9,6 +9,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"bazil.org/fuse"
|
||||||
|
|
||||||
"github.com/restic/restic"
|
"github.com/restic/restic"
|
||||||
"github.com/restic/restic/backend"
|
"github.com/restic/restic/backend"
|
||||||
"github.com/restic/restic/repository"
|
"github.com/restic/restic/repository"
|
||||||
@@ -62,6 +64,15 @@ func TestMount(t *testing.T) {
|
|||||||
go cmdMount(t, global, mountpoint, ready)
|
go cmdMount(t, global, mountpoint, ready)
|
||||||
<-ready
|
<-ready
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
err := fuse.Unmount(mountpoint)
|
||||||
|
OK(t, err)
|
||||||
|
if TestCleanup {
|
||||||
|
err = os.RemoveAll(mountpoint)
|
||||||
|
OK(t, err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
mountpointDir, err := os.Open(mountpoint)
|
mountpointDir, err := os.Open(mountpoint)
|
||||||
OK(t, err)
|
OK(t, err)
|
||||||
names, err := mountpointDir.Readdirnames(-1)
|
names, err := mountpointDir.Readdirnames(-1)
|
||||||
|
|||||||
Reference in new issue
Block a user