diff options
author | Jakob Unterwurzacher | 2016-07-02 20:06:20 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-07-02 20:06:20 +0200 |
commit | d5b7eb33daec612626305c961b7ec6d5eccd79a7 (patch) | |
tree | 6d72301c5c6aca7135a86ad7bbc0125b9eff23b5 /tests | |
parent | 54470baa23bf98adde69dc1a074c852ea19127d1 (diff) |
tests: call umount instead of fusermount on OSX
Reported at https://github.com/rfjakob/gocryptfs/issues/15
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_helpers/helpers.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go index 02b9fe0..1c43d55 100644 --- a/tests/test_helpers/helpers.go +++ b/tests/test_helpers/helpers.go @@ -8,6 +8,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "syscall" "testing" "time" @@ -142,10 +143,15 @@ func MountOrFatal(t *testing.T, c string, p string, extraArgs ...string) { // Unmount PLAINDIR "p" func Unmount(p string) error { - fu := exec.Command("fusermount", "-u", "-z", p) - fu.Stdout = os.Stdout - fu.Stderr = os.Stderr - err := fu.Run() + var cmd *exec.Cmd + if runtime.GOOS == "darwin" { + cmd = exec.Command("umount", p) + } else { + cmd = exec.Command("fusermount", "-u", "-z", p) + } + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + err := cmd.Run() if err != nil { fmt.Println(err) panic(err) |