From 6ba56befad0ba68fca1be106388a776a9d02e9b1 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 23 Jan 2016 19:10:43 +0100 Subject: [PATCH] Abort fuse integration test on error Before, the fuse integration test was run and the tests were never finished, because the testing code did not detect any errors when the fusermount binary returned an error. This commit fixes it. --- cmd/restic/integration_fuse_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/restic/integration_fuse_test.go b/cmd/restic/integration_fuse_test.go index 807b335fc..5c5c2021f 100644 --- a/cmd/restic/integration_fuse_test.go +++ b/cmd/restic/integration_fuse_test.go @@ -54,6 +54,10 @@ func waitForMount(dir string) error { } func cmdMount(t testing.TB, global GlobalOptions, dir string, ready, done chan struct{}) { + defer func() { + ready <- struct{}{} + }() + cmd := &CmdMount{global: &global, ready: ready, done: done} OK(t, cmd.Execute([]string{dir})) if TestCleanup { @@ -104,7 +108,7 @@ func TestMount(t *testing.T) { // We remove the mountpoint now to check that cmdMount creates it RemoveAll(t, mountpoint) - ready := make(chan struct{}, 1) + ready := make(chan struct{}, 2) done := make(chan struct{}) go cmdMount(t, global, mountpoint, ready, done) <-ready