From a4d122e5ae6c3f7dab95ff6437055c58de5db60d Mon Sep 17 00:00:00 2001 From: Matthieu Rakotojaona Date: Sun, 19 Jul 2015 16:33:37 +0200 Subject: [PATCH] Cleanup mount after test --- cmd/restic/integration_fuse_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/restic/integration_fuse_test.go b/cmd/restic/integration_fuse_test.go index 4dc725b16..107b1e831 100644 --- a/cmd/restic/integration_fuse_test.go +++ b/cmd/restic/integration_fuse_test.go @@ -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)