tests: Unset ENCFS6_CONFIG before testing

This prevents unexpected failures when you have set that variable.

Also, give Test::More the number of tests that will be run for
more informative output.
This commit is contained in:
Jakob Unterwurzacher 2014-11-30 22:45:51 +01:00
parent 73b2f7c850
commit 8b8130782d
2 changed files with 6 additions and 4 deletions

View File

@ -2,7 +2,7 @@
# Test EncFS normal and paranoid mode
use Test::More qw( no_plan );
use Test::More tests => 101;
use File::Path;
use File::Copy;
use File::Temp;
@ -289,7 +289,7 @@ sub links
is( readlink("$crypt/data-rel"), "data", "read rel symlink");
SKIP: {
skip "No hardlink support" unless $hardlinkTests;
skip "No hardlink support", 2 unless $hardlinkTests;
ok( link("$crypt/data", "$crypt/data.2"), "hard link");
checkContents("$crypt/data.2", $contents, "hardlink read");
@ -306,6 +306,7 @@ sub mount
mkdir($raw) || BAIL_OUT("Could not create $raw: $!");
mkdir($crypt) || BAIL_OUT("Could not create $crypt: $!");
delete $ENV{"ENCFS6_CONFIG"};
qx(./encfs/encfs --extpass="echo test" $args $raw $crypt);
ok( -f "$raw/.encfs6.xml", "created control file");

View File

@ -3,7 +3,7 @@
# Test EncFS --reverse mode
use warnings;
use Test::More tests => 25;
use Test::More tests => 26;
use File::Path;
use File::Temp;
use IO::Handle;
@ -45,6 +45,7 @@ sub cleanup
# Directory structure: plain -[encrypt]-> ciphertext -[decrypt]-> decrypted
sub mount
{
delete $ENV{"ENCFS6_CONFIG"};
system("./encfs/encfs --extpass=\"echo test\" --standard $plain $ciphertext --reverse");
ok(waitForFile("$plain/.encfs6.xml"), "plain .encfs6.xml exists") or BAIL_OUT("'$plain/.encfs6.xml'");
my $e = encName(".encfs6.xml");
@ -148,7 +149,7 @@ sub writesDenied {
my $efn = $ciphertext . "/" . encName("writesDenied");
open(my $fh, ">", $efn);
if( ok( $! == EROFS, "open for write denied, EROFS")) {
ok( 1, "writing denied, filhandle not open");
ok( 1, "writing denied, filehandle not open");
}
else {
print($fh "foo");