forked from TrueCloudLab/restic
Cleanup mount after test
This commit is contained in:
parent
d7888d4dd5
commit
a4d122e5ae
1 changed files with 11 additions and 0 deletions
|
@ -9,6 +9,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"bazil.org/fuse"
|
||||
|
||||
"github.com/restic/restic"
|
||||
"github.com/restic/restic/backend"
|
||||
"github.com/restic/restic/repository"
|
||||
|
@ -62,6 +64,15 @@ func TestMount(t *testing.T) {
|
|||
go cmdMount(t, global, mountpoint, 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)
|
||||
OK(t, err)
|
||||
names, err := mountpointDir.Readdirnames(-1)
|
||||
|
|
Loading…
Reference in a new issue