tests: Use portable_unmount in reverse tests

Fixes unmount failure on OSX
This commit is contained in:
Jakob Unterwurzacher 2014-12-30 23:05:23 +01:00
parent 6239a3c58f
commit b05872d85d
3 changed files with 16 additions and 11 deletions

View File

@ -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);

View File

@ -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");

View File

@ -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");