mirror of
https://github.com/vgough/encfs.git
synced 2024-11-21 23:43:26 +01:00
Correctly detect attr binary during tests
This commit is contained in:
parent
d216cc4208
commit
8d8506f2eb
@ -13,6 +13,20 @@ require("tests/common.pl");
|
||||
|
||||
my $tempDir = $ENV{'TMPDIR'} || "/tmp";
|
||||
|
||||
# Find attr binary
|
||||
# Linux
|
||||
my @binattr = ("attr", "-l");
|
||||
if(system("which xattr > /dev/null 2>&1") == 0)
|
||||
{
|
||||
# Mac OS X
|
||||
@binattr = ("xattr", "-l");
|
||||
}
|
||||
if(system("which lsextattr > /dev/null 2>&1") == 0)
|
||||
{
|
||||
# FreeBSD
|
||||
@binattr = ("lsextattr", "user");
|
||||
}
|
||||
|
||||
# Helper function
|
||||
# Create a new empty working directory
|
||||
sub newWorkingDir
|
||||
@ -84,7 +98,7 @@ sub symlink_test
|
||||
$dec = readlink("$decrypted/symlink");
|
||||
ok( $dec eq $target, "symlink to '$target'") or
|
||||
print("# (original) $target' != '$dec' (decrypted)\n");
|
||||
system("attr", "-l", "$decrypted/symlink");
|
||||
system(@binattr, "$decrypted/symlink");
|
||||
my $return_code = $?;
|
||||
is($return_code, 0, "symlink to '$target' extended attributes can be read (return code was $return_code)");
|
||||
unlink("$plain/symlink");
|
||||
|
Loading…
Reference in New Issue
Block a user