mirror of
https://github.com/vgough/encfs.git
synced 2024-12-23 15:18:58 +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
|
# Helper function
|
||||||
# Get the MD5 sum of the file open at the filehandle
|
# Get the MD5 sum of the file open at the filehandle
|
||||||
use Digest::MD5 qw(md5_hex);
|
use Digest::MD5 qw(md5_hex);
|
||||||
|
@ -316,15 +316,7 @@ sub mount
|
|||||||
# Unmount and delete mountpoint
|
# Unmount and delete mountpoint
|
||||||
sub cleanup
|
sub cleanup
|
||||||
{
|
{
|
||||||
my $fusermount = qx(which fusermount);
|
portable_unmount($crypt);
|
||||||
chomp($fusermount);
|
|
||||||
if(-f $fusermount)
|
|
||||||
{
|
|
||||||
qx($fusermount -u "$crypt");
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
qx(umount "$crypt");
|
|
||||||
}
|
|
||||||
|
|
||||||
rmdir $crypt;
|
rmdir $crypt;
|
||||||
ok( ! -d $crypt, "unmount ok, mount point removed");
|
ok( ! -d $crypt, "unmount ok, mount point removed");
|
||||||
|
@ -32,8 +32,8 @@ sub newWorkingDir
|
|||||||
# Unmount and delete mountpoint
|
# Unmount and delete mountpoint
|
||||||
sub cleanup
|
sub cleanup
|
||||||
{
|
{
|
||||||
system("fusermount -u $decrypted");
|
portable_unmount($decrypted);
|
||||||
system("fusermount -u $ciphertext");
|
portable_unmount($ciphertext);
|
||||||
our $workingDir;
|
our $workingDir;
|
||||||
rmtree($workingDir);
|
rmtree($workingDir);
|
||||||
ok( ! -d $workingDir, "working dir removed");
|
ok( ! -d $workingDir, "working dir removed");
|
||||||
|
Loading…
Reference in New Issue
Block a user