Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve symlink tests #490

Merged
merged 2 commits into from
Mar 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions integration/reverse.t.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Test EncFS --reverse mode

use warnings;
use Test::More tests => 36;
use Test::More tests => 46;
use File::Path;
use File::Temp;
use IO::Handle;
Expand Down Expand Up @@ -111,7 +111,7 @@ sub copy_test
sub encfsctl_cat_test
{
my $contents = "hello world\n";
ok( open(OUT, "> $plain/hello.txt"), "create file for encfsctl cat test" );
ok(open(OUT, "> $plain/hello.txt"), "create file for encfsctl cat test");
print OUT $contents;
close OUT;
qx(ENCFS6_CONFIG=$plain/.encfs6.xml ./build/encfsctl cat --extpass="echo test" $ciphertext hello.txt > $plain/hellodec.txt);
Expand All @@ -126,12 +126,12 @@ sub encfsctl_cat_test
sub symlink_test
{
my $target = shift;
symlink($target, "$plain/symlink");
$dec = readlink("$decrypted/symlink");
ok( $dec eq $target, "symlink to '$target'") or
print("# (original) $target' != '$dec' (decrypted)\n");
ok(symlink($target, "$plain/symlink"), "Symlink create, $plain/symlink -> $target");
ok(my $dec = readlink("$decrypted/symlink"), "Symlink read, $decrypted/symlink");
$dec.="";
ok($dec eq $target, "Symlink compare, '$target' != '$dec'");
my $return_code = ($have_xattr) ? system(@binattr, "$decrypted/symlink") : 0;
is($return_code, 0, "symlink to '$target' extended attributes can be read (return code was $return_code)");
is($return_code, 0, "Symlink xattr, $plain/symlink -> $target, extended attributes can be read (return code was $return_code)");
unlink("$plain/symlink");
}

Expand Down