mirror of
https://github.com/vgough/encfs.git
synced 2025-07-01 21:21:14 +02:00
Correctly detect attr binary during tests
This commit is contained in:
committed by
Jakob Unterwurzacher
parent
d216cc4208
commit
8d8506f2eb
@ -13,6 +13,20 @@ require("tests/common.pl");
|
|||||||
|
|
||||||
my $tempDir = $ENV{'TMPDIR'} || "/tmp";
|
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
|
# Helper function
|
||||||
# Create a new empty working directory
|
# Create a new empty working directory
|
||||||
sub newWorkingDir
|
sub newWorkingDir
|
||||||
@ -84,7 +98,7 @@ sub symlink_test
|
|||||||
$dec = readlink("$decrypted/symlink");
|
$dec = readlink("$decrypted/symlink");
|
||||||
ok( $dec eq $target, "symlink to '$target'") or
|
ok( $dec eq $target, "symlink to '$target'") or
|
||||||
print("# (original) $target' != '$dec' (decrypted)\n");
|
print("# (original) $target' != '$dec' (decrypted)\n");
|
||||||
system("attr", "-l", "$decrypted/symlink");
|
system(@binattr, "$decrypted/symlink");
|
||||||
my $return_code = $?;
|
my $return_code = $?;
|
||||||
is($return_code, 0, "symlink to '$target' extended attributes can be read (return code was $return_code)");
|
is($return_code, 0, "symlink to '$target' extended attributes can be read (return code was $return_code)");
|
||||||
unlink("$plain/symlink");
|
unlink("$plain/symlink");
|
||||||
|
Reference in New Issue
Block a user