summaryrefslogtreecommitdiff
path: root/tests/test_helpers
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_helpers')
-rw-r--r--tests/test_helpers/helpers.go14
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)