[test suite] added tests for KEY synonym GPG_SIGNING_PW
authorMichael Rash <mbr@cipherdyne.org>
Thu, 20 Jun 2013 03:41:37 +0000 (23:41 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Thu, 20 Jun 2013 03:41:37 +0000 (23:41 -0400)
test/conf/fwknoprc_gpg_signing_pw [new file with mode: 0644]
test/conf/fwknoprc_named_gpg_signing_pw [new file with mode: 0644]
test/test-fwknop.pl
test/tests/basic_operations.pl
test/tests/gpg.pl
test/tests/gpg_no_pw.pl

diff --git a/test/conf/fwknoprc_gpg_signing_pw b/test/conf/fwknoprc_gpg_signing_pw
new file mode 100644 (file)
index 0000000..e1230fd
--- /dev/null
@@ -0,0 +1,2 @@
+[default]
+GPG_SIGNING_PW                 fwknoptest
diff --git a/test/conf/fwknoprc_named_gpg_signing_pw b/test/conf/fwknoprc_named_gpg_signing_pw
new file mode 100644 (file)
index 0000000..eaf7574
--- /dev/null
@@ -0,0 +1,7 @@
+[default]
+
+[testssh]
+GPG_SIGNING_PW                 fwknoptest
+
+[testssh2]
+GPG_SIGNING_PW_BASE64          Zndrbm9wdGVzdA==
index aac2af8..23cd5e2 100755 (executable)
@@ -116,6 +116,8 @@ our %cf = (
     'rc_invalid_b64_key'           => "$conf_dir/fwknoprc_invalid_base64_key",
     'rc_hmac_b64_key'              => "$conf_dir/fwknoprc_default_hmac_base64_key",
     'rc_hmac_b64_key2'             => "$conf_dir/fwknoprc_hmac_key2",
+    'rc_gpg_signing_pw'            => "$conf_dir/fwknoprc_gpg_signing_pw",
+    'rc_gpg_named_signing_pw'      => "$conf_dir/fwknoprc_named_gpg_signing_pw",
     'rc_gpg_hmac_b64_key'          => "$conf_dir/fwknoprc_gpg_hmac_key",
     'rc_gpg_args_hmac_b64_key'     => "$conf_dir/fwknoprc_gpg_args_hmac_key",
     'rc_gpg_args_no_pw_hmac_b64_key' => "$conf_dir/fwknoprc_gpg_args_no_pw_hmac_key",
index e7b9535..d00d7fc 100644 (file)
         'detail'   => 'encryption mode Asymmetric',
         'function' => \&generic_exec,
         'cmdline'  => $default_client_args . " --test --encryption-mode \"Asymmetric\"",
-        'positive_output_matches' => [qr/Encryption\sMode\:\s.*Asymmetric/],
+        'positive_output_matches' => [qr/Must\sspecify\sGPG\srecipient/],
         'fatal'    => $NO
-    },    
+    },
     {
         'category' => 'basic operations',
         'subcategory' => 'client',
index d976316..84afb77 100644 (file)
     {
         'category' => 'GPG',
         'subcategory' => 'client+server',
+        'detail'   => 'rc file default key ..._PW synonym',
+        'function' => \&spa_cycle,
+        'cmdline'  => "$default_client_gpg_args_no_get_key " .
+            "--rc-file $cf{'rc_gpg_signing_pw'}",
+        'fwknopd_cmdline'  => $default_server_gpg_args,
+        'fw_rule_created' => $NEW_RULE_REQUIRED,
+        'fw_rule_removed' => $NEW_RULE_REMOVED,
+        'key_file' => $cf{'rc_gpg_signing_pw'},
+        'fatal'    => $NO
+    },
+    {
+        'category' => 'GPG',
+        'subcategory' => 'client+server',
         'detail'   => 'rc file named key (tcp/22 ssh)',
         'function' => \&spa_cycle,
         'cmdline'  => "$default_client_gpg_args_no_get_key " .
     {
         'category' => 'GPG',
         'subcategory' => 'client+server',
+        'detail'   => 'rc file named key ..._PW synonym',
+        'function' => \&spa_cycle,
+        'cmdline'  => "$default_client_gpg_args_no_get_key " .
+            "--rc-file $cf{'rc_gpg_named_signing_pw'} -n testssh",
+        'fwknopd_cmdline'  => $default_server_gpg_args,
+        'fw_rule_created' => $NEW_RULE_REQUIRED,
+        'fw_rule_removed' => $NEW_RULE_REMOVED,
+        'key_file' => $cf{'rc_gpg_named_signing_pw'},
+        'fatal'    => $NO
+    },
+    {
+        'category' => 'GPG',
+        'subcategory' => 'client+server',
+        'detail'   => 'rc file b64 named key ..._PW synonym',
+        'function' => \&spa_cycle,
+        'cmdline'  => "$default_client_gpg_args_no_get_key " .
+            "--rc-file $cf{'rc_gpg_named_signing_pw'} -n testssh2",
+        'fwknopd_cmdline'  => $default_server_gpg_args,
+        'fw_rule_created' => $NEW_RULE_REQUIRED,
+        'fw_rule_removed' => $NEW_RULE_REMOVED,
+        'key_file' => $cf{'rc_gpg_named_signing_pw'},
+        'fatal'    => $NO
+    },
+
+    {
+        'category' => 'GPG',
+        'subcategory' => 'client+server',
         'detail'   => 'multi gpg-IDs (tcp/22 ssh)',
         'function' => \&spa_cycle,
         'cmdline'  => $default_client_gpg_args,
index 3b30f66..c25f07c 100644 (file)
         'function' => \&spa_cycle,
         'cmdline'  => "LD_LIBRARY_PATH=$lib_dir $valgrind_str " .
             "$fwknopCmd -A tcp/60001 -a $fake_ip -D $loopback_ip " .
-            "--gpg-no-singing-pw --verbose --verbose " .
+            "--gpg-no-signing-pw --verbose --verbose " .
             "--gpg-recipient-key $gpg_server_key " .
             "--gpg-signer-key $gpg_client_key " .
             "--gpg-home-dir $gpg_client_home_dir_no_pw",