From 8b8130782d788b32ad1515324d91796faa6f968e Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 30 Nov 2014 22:45:51 +0100 Subject: [PATCH] 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. --- tests/normal.pl | 5 +++-- tests/reverse.pl | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/normal.pl b/tests/normal.pl index 45930c6..572ef03 100644 --- a/tests/normal.pl +++ b/tests/normal.pl @@ -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"); diff --git a/tests/reverse.pl b/tests/reverse.pl index dc7cd5b..2c073e8 100755 --- a/tests/reverse.pl +++ b/tests/reverse.pl @@ -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");