mirror of
https://github.com/vgough/encfs.git
synced 2024-12-23 07:09:21 +01:00
tests: Use portable_unmount in reverse tests
Fixes unmount failure on OSX
This commit is contained in:
parent
6239a3c58f
commit
b05872d85d
@ -1,3 +1,16 @@
|
||||
# Portable FUSE unmount
|
||||
# works on Linux AND OSX
|
||||
sub portable_unmount {
|
||||
my $crypt = shift;
|
||||
my $fusermount = qx(which fusermount);
|
||||
chomp($fusermount);
|
||||
if(-f $fusermount) {
|
||||
qx($fusermount -u "$crypt");
|
||||
} else {
|
||||
qx(umount "$crypt");
|
||||
}
|
||||
}
|
||||
|
||||
# Helper function
|
||||
# Get the MD5 sum of the file open at the filehandle
|
||||
use Digest::MD5 qw(md5_hex);
|
||||
|
@ -316,15 +316,7 @@ sub mount
|
||||
# Unmount and delete mountpoint
|
||||
sub cleanup
|
||||
{
|
||||
my $fusermount = qx(which fusermount);
|
||||
chomp($fusermount);
|
||||
if(-f $fusermount)
|
||||
{
|
||||
qx($fusermount -u "$crypt");
|
||||
} else
|
||||
{
|
||||
qx(umount "$crypt");
|
||||
}
|
||||
portable_unmount($crypt);
|
||||
|
||||
rmdir $crypt;
|
||||
ok( ! -d $crypt, "unmount ok, mount point removed");
|
||||
|
@ -32,8 +32,8 @@ sub newWorkingDir
|
||||
# Unmount and delete mountpoint
|
||||
sub cleanup
|
||||
{
|
||||
system("fusermount -u $decrypted");
|
||||
system("fusermount -u $ciphertext");
|
||||
portable_unmount($decrypted);
|
||||
portable_unmount($ciphertext);
|
||||
our $workingDir;
|
||||
rmtree($workingDir);
|
||||
ok( ! -d $workingDir, "working dir removed");
|
||||
|
Loading…
Reference in New Issue
Block a user