[test suite] restore gpg directories after test suite runs
authorMichael Rash <mbr@cipherdyne.org>
Sun, 28 Apr 2013 02:41:17 +0000 (22:41 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Sun, 28 Apr 2013 02:41:17 +0000 (22:41 -0400)
Makefile.am
test/conf/client-gpg-no-pw/trustdb.gpg
test/conf/client-gpg/trustdb.gpg
test/conf/gpg_dirs_orig.tar.gz [new file with mode: 0644]
test/conf/server-gpg-no-pw/trustdb.gpg
test/conf/server-gpg/trustdb.gpg
test/test-fwknop.pl

index 049ab4f..8af715c 100644 (file)
@@ -109,6 +109,7 @@ EXTRA_DIST = \
     python/setup.py \
     python/fkomodule.c \
     python/fko.py \
+    test/conf/gpg_dirs_orig.tar.gz \
     test/conf/client-gpg/pubring.gpg \
     test/conf/client-gpg/secring.gpg \
     test/conf/client-gpg/trustdb.gpg \
index be93308..58ec2d6 100644 (file)
Binary files a/test/conf/client-gpg-no-pw/trustdb.gpg and b/test/conf/client-gpg-no-pw/trustdb.gpg differ
index 2c1093e..58ec2d6 100644 (file)
Binary files a/test/conf/client-gpg/trustdb.gpg and b/test/conf/client-gpg/trustdb.gpg differ
diff --git a/test/conf/gpg_dirs_orig.tar.gz b/test/conf/gpg_dirs_orig.tar.gz
new file mode 100644 (file)
index 0000000..c853ff3
Binary files /dev/null and b/test/conf/gpg_dirs_orig.tar.gz differ
index 0c29e43..d5b5b60 100644 (file)
Binary files a/test/conf/server-gpg-no-pw/trustdb.gpg and b/test/conf/server-gpg-no-pw/trustdb.gpg differ
index 8090303..d5b5b60 100644 (file)
Binary files a/test/conf/server-gpg/trustdb.gpg and b/test/conf/server-gpg/trustdb.gpg differ
index 9d61e4a..22639ad 100755 (executable)
@@ -26,6 +26,7 @@ my $data_tmp        = 'data.tmp';
 my $key_tmp         = 'key.tmp';
 my $enc_save_tmp    = 'openssl_save.enc';
 my $test_suite_path = 'test-fwknop.pl';
+my $gpg_dir_orig_tar = 'gpg_dirs_orig.tar.gz';
 our $gpg_client_home_dir = "$conf_dir/client-gpg";
 our $gpg_client_home_dir_no_pw = "$conf_dir/client-gpg-no-pw";
 our $replay_pcap_file = "$conf_dir/spa_replay.pcap";
@@ -592,6 +593,7 @@ if ($enable_valgrind) {
 &logr("\n");
 
 &remove_permissions_warnings() unless $include_permissions_warnings;
+&restore_gpg_dirs();
 
 my $total_elapsed_seconds = time() - $start_time;
 my $total_elapsed_minutes = sprintf "%.2f", ($total_elapsed_seconds / 60);
@@ -5006,6 +5008,21 @@ sub init() {
     return;
 }
 
+sub restore_gpg_dirs() {
+
+    my $curr_pwd = cwd() or die $!;
+
+    chdir $conf_dir or die $!;
+
+    if (-e $gpg_dir_orig_tar) {
+        system "tar xfz $gpg_dir_orig_tar > /dev/null";
+    }
+
+    chdir $curr_pwd or die $!;
+
+    return;
+}
+
 sub openssl_hmac_style_check() {
     if (&run_cmd("$openssl_path dgst -hex -sha256 -mac HMAC " .
             "-macopt hexkey:61616161 $0", $cmd_out_tmp, $curr_test_file)) {