mirror of
https://github.com/vgough/encfs.git
synced 2025-02-16 17:50:53 +01:00
tests: fix paths for new build path, add "test.sh" wrapper for usability
All tests pass at the moment.
This commit is contained in:
parent
c3e63d7836
commit
a424a2155b
10
test.sh
Executable file
10
test.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
if [ ! -d build ]
|
||||||
|
then
|
||||||
|
./build.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
perl -MTest::Harness -e '$$Test::Harness::verbose=1; runtests @ARGV;' tests/*.t.pl
|
@ -12,7 +12,7 @@ sub mount_encfs_reverse {
|
|||||||
my $c = shift;
|
my $c = shift;
|
||||||
my $opts = shift;
|
my $opts = shift;
|
||||||
|
|
||||||
my $cmdline = "./encfs/encfs --extpass=\"echo test\" --standard $p $c --reverse $opts 2>&1 > /dev/null";
|
my $cmdline = "./build/encfs --extpass=\"echo test\" --standard $p $c --reverse $opts 2>&1 > /dev/null";
|
||||||
# print "mounting encfs: $cmdline\n";
|
# print "mounting encfs: $cmdline\n";
|
||||||
my $status = system($cmdline);
|
my $status = system($cmdline);
|
||||||
if ( $status != 0 ) { die("command returned error: $status"); }
|
if ( $status != 0 ) { die("command returned error: $status"); }
|
||||||
|
@ -35,7 +35,7 @@ sub mount_encfs {
|
|||||||
mkdir($p);
|
mkdir($p);
|
||||||
|
|
||||||
delete $ENV{"ENCFS6_CONFIG"};
|
delete $ENV{"ENCFS6_CONFIG"};
|
||||||
system("./encfs/encfs --extpass=\"echo test\" --standard $c $p > /dev/null");
|
system("./build/encfs --extpass=\"echo test\" --standard $c $p > /dev/null");
|
||||||
waitForFile("$c/.encfs6.xml") or die("Control file not created");
|
waitForFile("$c/.encfs6.xml") or die("Control file not created");
|
||||||
|
|
||||||
print "# encfs mounted on $p\n";
|
print "# encfs mounted on $p\n";
|
||||||
@ -156,7 +156,6 @@ sub main {
|
|||||||
|
|
||||||
if ( $> != 0 ) {
|
if ( $> != 0 ) {
|
||||||
print("This test must be run as root!\n");
|
print("This test must be run as root!\n");
|
||||||
exit(2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dl_linuxgz();
|
dl_linuxgz();
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Test EncFS normal and paranoid mode
|
# Test EncFS normal and paranoid mode
|
||||||
|
|
||||||
use Test::More tests => 103;
|
use Test::More tests => 102;
|
||||||
use File::Path;
|
use File::Path;
|
||||||
use File::Copy;
|
use File::Copy;
|
||||||
use File::Temp;
|
use File::Temp;
|
||||||
@ -261,7 +261,7 @@ sub checkContents
|
|||||||
sub encName
|
sub encName
|
||||||
{
|
{
|
||||||
my $plain = shift;
|
my $plain = shift;
|
||||||
my $enc = qx(./encfs/encfsctl encode --extpass="echo test" $raw $plain);
|
my $enc = qx(./build/encfsctl encode --extpass="echo test" $raw $plain);
|
||||||
chomp($enc);
|
chomp($enc);
|
||||||
return $enc;
|
return $enc;
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ sub mount
|
|||||||
mkdir($crypt) || BAIL_OUT("Could not create $crypt: $!");
|
mkdir($crypt) || BAIL_OUT("Could not create $crypt: $!");
|
||||||
|
|
||||||
delete $ENV{"ENCFS6_CONFIG"};
|
delete $ENV{"ENCFS6_CONFIG"};
|
||||||
my $cmdline = "./encfs/encfs --extpass=\"echo test\" $args $raw $crypt 2>&1";
|
my $cmdline = "./build/encfs --extpass=\"echo test\" $args $raw $crypt 2>&1";
|
||||||
# This makes sure we get to see stderr ^
|
# This makes sure we get to see stderr ^
|
||||||
my $status = system($cmdline);
|
my $status = system($cmdline);
|
||||||
ok( $status == 0, "encfs command returns 0") || BAIL_OUT("");
|
ok( $status == 0, "encfs command returns 0") || BAIL_OUT("");
|
||||||
|
@ -46,11 +46,11 @@ sub cleanup
|
|||||||
sub mount
|
sub mount
|
||||||
{
|
{
|
||||||
delete $ENV{"ENCFS6_CONFIG"};
|
delete $ENV{"ENCFS6_CONFIG"};
|
||||||
system("./encfs/encfs --extpass=\"echo test\" --standard $plain $ciphertext --reverse --nocache");
|
system("./build/encfs --extpass=\"echo test\" --standard $plain $ciphertext --reverse --nocache");
|
||||||
ok(waitForFile("$plain/.encfs6.xml"), "plain .encfs6.xml exists") or BAIL_OUT("'$plain/.encfs6.xml'");
|
ok(waitForFile("$plain/.encfs6.xml"), "plain .encfs6.xml exists") or BAIL_OUT("'$plain/.encfs6.xml'");
|
||||||
my $e = encName(".encfs6.xml");
|
my $e = encName(".encfs6.xml");
|
||||||
ok(waitForFile("$ciphertext/$e"), "encrypted .encfs6.xml exists") or BAIL_OUT("'$ciphertext/$e'");
|
ok(waitForFile("$ciphertext/$e"), "encrypted .encfs6.xml exists") or BAIL_OUT("'$ciphertext/$e'");
|
||||||
system("ENCFS6_CONFIG=$plain/.encfs6.xml ./encfs/encfs --nocache --extpass=\"echo test\" $ciphertext $decrypted");
|
system("ENCFS6_CONFIG=$plain/.encfs6.xml ./build/encfs --nocache --extpass=\"echo test\" $ciphertext $decrypted");
|
||||||
ok(waitForFile("$decrypted/.encfs6.xml"), "decrypted .encfs6.xml exists") or BAIL_OUT("'$decrypted/.encfs6.xml'");
|
ok(waitForFile("$decrypted/.encfs6.xml"), "decrypted .encfs6.xml exists") or BAIL_OUT("'$decrypted/.encfs6.xml'");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ sub mount
|
|||||||
sub encName
|
sub encName
|
||||||
{
|
{
|
||||||
my $name = shift;
|
my $name = shift;
|
||||||
my $enc = qx(ENCFS6_CONFIG=$plain/.encfs6.xml ./encfs/encfsctl encode --extpass="echo test" $ciphertext $name);
|
my $enc = qx(ENCFS6_CONFIG=$plain/.encfs6.xml ./build/encfsctl encode --extpass="echo test" $ciphertext $name);
|
||||||
chomp($enc);
|
chomp($enc);
|
||||||
return $enc;
|
return $enc;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user