[test suite] multi-packet pcap test for pcap_dispatch() validation
authorMichael Rash <mbr@cipherdyne.org>
Wed, 11 Dec 2013 03:31:03 +0000 (21:31 -0600)
committerMichael Rash <mbr@cipherdyne.org>
Wed, 11 Dec 2013 03:56:20 +0000 (21:56 -0600)
This commit adds a new pcap file to the test suite with an SPA packet after
99 other garbage packets.  This can be used for pcap_dispatch() testing,
though this is not meant to be super instensive - it is just to ensure that
if a PCAP_DISPATCH_COUNT of, say, 10 is selected that the SPA is still seen
by fwknopd.  This commit is in support of #110.

Makefile.am
test/conf/multi_pkts.pcap [new file with mode: 0644]
test/test-fwknop.pl
test/tests/rijndael.pl
test/tests/rijndael_hmac.pl

index 89e4a4d..da2f0c8 100644 (file)
@@ -188,6 +188,7 @@ EXTRA_DIST = \
     test/conf/hmac_force_snat_access.conf \
     test/conf/hmac_force_masq_access.conf \
     test/conf/hmac_no_b64_cygwin_access.conf \
+    test/conf/multi_pkts.pcap \
     test/conf/fwknoprc_default_hmac_base64_key \
     test/conf/fwknoprc_hmac_key2 \
     test/conf/fwknoprc_gpg_hmac_key \
diff --git a/test/conf/multi_pkts.pcap b/test/conf/multi_pkts.pcap
new file mode 100644 (file)
index 0000000..69c4f67
Binary files /dev/null and b/test/conf/multi_pkts.pcap differ
index e36a040..b13352b 100755 (executable)
@@ -30,7 +30,8 @@ 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";
+our $replay_pcap_file     = "$conf_dir/spa_replay.pcap";
+our $multi_pkts_pcap_file = "$conf_dir/multi_pkts.pcap";
 
 our $lib_dir = '../lib/.libs';
 
index a4260f0..efd9e60 100644 (file)
     ### --pcap-file
     {
         'category' => 'Rijndael',
-        'subcategory' => 'client+server',
+        'subcategory' => 'server',
         'detail'   => '--pcap-file processing',
         'function' => \&process_pcap_file_directly,
         'cmdline'  => '',
index c3003d1..6571860 100644 (file)
 
     {
         'category' => 'Rijndael+HMAC',
+        'subcategory' => 'server',
+        'detail'   => '--pcap-file processing',
+        'function' => \&process_pcap_file_directly,
+        'cmdline'  => '',
+        'fwknopd_cmdline' => "$fwknopdCmd -c $cf{'def'} -a $cf{'hmac_access'} " .
+            "-d $default_digest_file -p $default_pid_file " .
+            "--pcap-file $multi_pkts_pcap_file --foreground $verbose_str " .
+            "--verbose --verbose --verbose",
+        'fw_rule_created' => $NEW_RULE_REQUIRED,
+        'fw_rule_removed' => $NEW_RULE_REMOVED,
+    },
+
+    {
+        'category' => 'Rijndael+HMAC',
         'subcategory' => 'client+server',
         'detail'   => 'iptables custom input chain',
         'function' => \&spa_cycle,