diff --git a/test/test-fwknop.pl b/test/test-fwknop.pl index 072b7a60..b8efc26f 100755 --- a/test/test-fwknop.pl +++ b/test/test-fwknop.pl @@ -910,6 +910,7 @@ my %test_keys = ( 'rc_positive_output_matches' => $OPTIONAL, 'rc_negative_output_matches' => $OPTIONAL, 'mv_and_restore_replay_cache' => $OPTIONAL, + 'relax_receive_cycle_num_check' => $OPTIONAL, 'client_positive_output_matches' => $OPTIONAL, 'client_negative_output_matches' => $OPTIONAL, 'server_positive_output_matches' => $OPTIONAL, @@ -2441,8 +2442,13 @@ sub _client_send_spa_packet() { $rv = 0 unless &run_cmd($test_hr->{'cmdline'}, $cmd_out_tmp, $curr_test_file); - $rv = 0 unless &file_find_num_matches(qr/Final\sSPA\sData/, - $NO_APPEND_RESULTS, $curr_test_file) == $cycle_ctr+1; + if ($test_hr->{'relax_receive_cycle_num_check'}) { + $rv = 0 unless &file_find_regex([qr/Final\sSPA\sData/], + $MATCH_ALL, $NO_APPEND_RESULTS, $curr_test_file); + } else { + $rv = 0 unless &file_find_num_matches(qr/Final\sSPA\sData/, + $NO_APPEND_RESULTS, $curr_test_file) == $cycle_ctr+1; + } last if $server_receive_check == $NO_SERVER_RECEIVE_CHECK; if ($test_hr->{'client_pkt_tries'} > 0) { diff --git a/test/tests/rijndael_hmac.pl b/test/tests/rijndael_hmac.pl index a2240a4c..16cbcf4d 100644 --- a/test/tests/rijndael_hmac.pl +++ b/test/tests/rijndael_hmac.pl @@ -662,6 +662,33 @@ 'fw_rule_removed' => $NEW_RULE_REMOVED, 'key_file' => $cf{'rc_hmac_b64_key'}, }, + { + 'category' => 'Rijndael+HMAC', + 'subcategory' => 'client+server', + 'detail' => 'multiple client invocations (1)', + 'function' => \&spa_cycle, + 'cmdline' => "LD_LIBRARY_PATH=$lib_dir " . + "$fwknopCmd -A tcp/22 -a $fake_ip -D $loopback_ip --rc-file " . + "$cf{'rc_hmac_b64_key'} $verbose_str " . + "&& LD_LIBRARY_PATH=$lib_dir " . + "$fwknopCmd -A tcp/23 -a $fake_ip -D $loopback_ip --rc-file " . + "$cf{'rc_hmac_b64_key'} $verbose_str " . + "&& LD_LIBRARY_PATH=$lib_dir " . + "$fwknopCmd -A tcp/24 -a $fake_ip -D $loopback_ip --rc-file " . + "$cf{'rc_hmac_b64_key'} $verbose_str", + 'fwknopd_cmdline' => "$fwknopdCmd -c $cf{'def'} -a $cf{'hmac_access'} " . + "-d $default_digest_file -p $default_pid_file $intf_str", + 'server_positive_output_matches' => [ + qr/Removed\srule\s1/, + qr/Removed\srule\s2/, + qr/Removed\srule\s3/, + ], + 'fw_rule_created' => $NEW_RULE_REQUIRED, + 'fw_rule_removed' => $NEW_RULE_REMOVED, + 'relax_receive_cycle_num_check' => $YES, ### multiple SPA packets involved + 'weak_server_receive_check' => $YES, + 'key_file' => $cf{'rc_hmac_b64_key'}, + }, { 'category' => 'Rijndael+HMAC', 'subcategory' => 'client+server',