tests: call umount instead of fusermount on OSX
Reported at https://github.com/rfjakob/gocryptfs/issues/15
This commit is contained in:
parent
54470baa23
commit
d5b7eb33da
|
@ -8,6 +8,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"syscall"
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -142,10 +143,15 @@ func MountOrFatal(t *testing.T, c string, p string, extraArgs ...string) {
|
||||||
|
|
||||||
// Unmount PLAINDIR "p"
|
// Unmount PLAINDIR "p"
|
||||||
func Unmount(p string) error {
|
func Unmount(p string) error {
|
||||||
fu := exec.Command("fusermount", "-u", "-z", p)
|
var cmd *exec.Cmd
|
||||||
fu.Stdout = os.Stdout
|
if runtime.GOOS == "darwin" {
|
||||||
fu.Stderr = os.Stderr
|
cmd = exec.Command("umount", p)
|
||||||
err := fu.Run()
|
} else {
|
||||||
|
cmd = exec.Command("fusermount", "-u", "-z", p)
|
||||||
|
}
|
||||||
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
err := cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in New Issue