From 8bab3cfbe338701eacbfc85e712099e573fbd992 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Tue, 15 Dec 2015 11:26:29 -0800 Subject: [PATCH] [test suite] exercise free_cycle_list_node() --- test/test-fwknop.pl | 15 +++++++++++---- test/tests/rijndael_hmac_cmd_open_close.pl | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/test/test-fwknop.pl b/test/test-fwknop.pl index bfc1a054..db3c827f 100755 --- a/test/test-fwknop.pl +++ b/test/test-fwknop.pl @@ -966,6 +966,8 @@ my %test_keys = ( 'insert_rule_while_running' => $OPTIONAL, 'insert_duplicate_rule_while_running' => $OPTIONAL, 'fw_dupe_rule_args' => $OPTIONAL, + 'expect_server_stopped' => $OPTIONAL, + 'ignore_client_error' => $OPTIONAL, 'weak_server_receive_check' => $OPTIONAL, 'search_for_rule_after_exit' => $OPTIONAL, 'rc_positive_output_matches' => $OPTIONAL, @@ -5867,7 +5869,7 @@ sub client_server_interaction() { &write_test_file("[-] fwknop client execution error.\n", $curr_test_file); } - $rv = 0; + $rv = 0 unless $test_hr->{'ignore_client_error'}; } } elsif ($spa_client_flag == $USE_PREDEF_PKTS) { &send_packets($pkts_hr, $max_pkt_tries); @@ -5891,9 +5893,14 @@ sub client_server_interaction() { } unless ($server_was_stopped) { - &write_test_file("[-] server_was_stopped=0, so setting rv=0.\n", - $curr_test_file); - $rv = 0; + if ($test_hr->{'expect_server_stopped'}) { + &write_test_file("[+] Expecting server to not be running.\n", + $curr_test_file); + } else { + &write_test_file("[-] server_was_stopped=0, so setting rv=0.\n", + $curr_test_file); + $rv = 0; + } } &write_test_file("[.] client_server_interaction() summary: rv: $rv, " . diff --git a/test/tests/rijndael_hmac_cmd_open_close.pl b/test/tests/rijndael_hmac_cmd_open_close.pl index bef2353c..62f419bd 100644 --- a/test/tests/rijndael_hmac_cmd_open_close.pl +++ b/test/tests/rijndael_hmac_cmd_open_close.pl @@ -70,6 +70,26 @@ 'key_file' => $cf{'rc_hmac_b64_key'}, 'server_positive_output_matches' => [qr/Timer expired/], }, + { + 'category' => 'Rijndael+HMAC', + 'subcategory' => 'client+server', + 'detail' => 'cmd open/close cycle server -C', + 'function' => \&spa_cmd_open_close_exec_cycle, + 'cmdline' => "$default_client_hmac_args --fw-timeout 30 " . + " && $default_client_hmac_args --fw-timeout 30 " . + " && $default_client_hmac_args --fw-timeout 30 " . + " && $default_client_hmac_args --fw-timeout 30 ", + 'fwknopd_cmdline' => "$fwknopdCmd -C 3 -c $cf{'def'} " . + "-a $cf{'hmac_cmd_open_close_cycle_access5'} " . + "-d $default_digest_file -p $default_pid_file $intf_str", + 'fw_rule_created' => $REQUIRE_NO_NEW_RULE, + 'expect_server_stopped' => $YES, + 'weak_server_receive_check' => $YES, + 'ignore_client_error' => $YES, + 'key_file' => $cf{'rc_hmac_b64_key'}, + 'server_positive_output_matches' => [qr/Incoming packet count limit/], + }, + { 'category' => 'Rijndael+HMAC', 'subcategory' => 'client+server',