diff options
author | Jakob Unterwurzacher | 2017-02-15 23:13:33 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-02-15 23:13:33 +0100 |
commit | 6ac9dcaae0ab57f738c25a7fa5c505b6d1b8aeda (patch) | |
tree | 7c17cbbccfd005102cafe770feb8afc848e3020a /tests/test_helpers/helpers.go | |
parent | ce2e610428c940c2bd5ca1790e7375117b1f6015 (diff) |
tests: use fuse-unmount.bash
...instead of having separate compatability logic.
Diffstat (limited to 'tests/test_helpers/helpers.go')
-rw-r--r-- | tests/test_helpers/helpers.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go index 01ef319..ff4a7be 100644 --- a/tests/test_helpers/helpers.go +++ b/tests/test_helpers/helpers.go @@ -10,7 +10,6 @@ import ( "os" "os/exec" "path/filepath" - "runtime" "syscall" "testing" "time" @@ -25,6 +24,9 @@ const testParentDir = "/tmp/gocryptfs-test-parent" // GocryptfsBinary is the assumed path to the gocryptfs build. const GocryptfsBinary = "../../gocryptfs" +// UnmountScript is the fusermount/umount compatability wrapper script +const UnmountScript = "../fuse-unmount.bash" + // TmpDir is a unique temporary directory. "go test" runs package tests in parallel. We create a // unique TmpDir in init() so the tests do not interfere. var TmpDir string @@ -175,12 +177,7 @@ func UnmountPanic(dir string) { // UnmountErr tries to unmount "dir" and returns the resulting error. func UnmountErr(dir string) error { - var cmd *exec.Cmd - if runtime.GOOS == "darwin" { - cmd = exec.Command("umount", dir) - } else { - cmd = exec.Command("fusermount", "-u", "-z", dir) - } + cmd := exec.Command(UnmountScript, "-u", "-z", dir) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr return cmd.Run() |