[test suite] differentiate TIMEOUT vs. CLIENT_TIMEOUT values in command open close cycles
This commit is contained in:
@@ -197,6 +197,8 @@ EXTRA_DIST = \
|
||||
test/conf/hmac_cmd_open_close_cycle_access4.conf \
|
||||
test/conf/hmac_cmd_open_close_cycle_access5.conf \
|
||||
test/conf/hmac_cmd_open_close_cycle_access6.conf \
|
||||
test/conf/hmac_cmd_open_close_cycle_access7.conf \
|
||||
test/conf/hmac_cmd_open_close_cycle_access8.conf \
|
||||
test/conf/hmac_cmd_open_close_multi_cycle_access.conf \
|
||||
test/conf/hmac_get_key_access.conf \
|
||||
test/conf/hmac_no_b64_access.conf \
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
SOURCE ANY
|
||||
KEY_BASE64 wzNP62oPPgEc+kXDPQLHPOayQBuNbYUTPP+QrErNDmg=
|
||||
HMAC_KEY_BASE64 Yh+xizBnl6FotC5ec7FanVGClRMlsOAPh2u6eovnerfBVKwaVKzjGoblFMHMc593TNyi0dWn4opLoTIV9q/ttg==
|
||||
CMD_CYCLE_OPEN /bin/echo 1$TIMEOUT
|
||||
CMD_CYCLE_CLOSE /bin/echo 2$TIMEOUT
|
||||
CMD_CYCLE_TIMER 30
|
||||
@@ -0,0 +1,6 @@
|
||||
SOURCE ANY
|
||||
KEY_BASE64 wzNP62oPPgEc+kXDPQLHPOayQBuNbYUTPP+QrErNDmg=
|
||||
HMAC_KEY_BASE64 Yh+xizBnl6FotC5ec7FanVGClRMlsOAPh2u6eovnerfBVKwaVKzjGoblFMHMc593TNyi0dWn4opLoTIV9q/ttg==
|
||||
CMD_CYCLE_OPEN /bin/echo 1$CLIENT_TIMEOUT1
|
||||
CMD_CYCLE_CLOSE /bin/echo 2$CLIENT_TIMEOUT2
|
||||
CMD_CYCLE_TIMER 30
|
||||
+23
-12
@@ -444,6 +444,8 @@ our %cf = (
|
||||
'hmac_cmd_open_close_cycle_access4' => "$conf_dir/hmac_cmd_open_close_cycle_access4.conf",
|
||||
'hmac_cmd_open_close_cycle_access5' => "$conf_dir/hmac_cmd_open_close_cycle_access5.conf",
|
||||
'hmac_cmd_open_close_cycle_access6' => "$conf_dir/hmac_cmd_open_close_cycle_access6.conf",
|
||||
'hmac_cmd_open_close_cycle_access7' => "$conf_dir/hmac_cmd_open_close_cycle_access7.conf",
|
||||
'hmac_cmd_open_close_cycle_access8' => "$conf_dir/hmac_cmd_open_close_cycle_access8.conf",
|
||||
'hmac_cmd_open_close_multi_cycle_access' => "$conf_dir/hmac_cmd_open_close_multi_cycle_access.conf",
|
||||
'spa_destination' => "$conf_dir/destination_rule_fwknopd.conf",
|
||||
"${fw_conf_prefix}_spa_dst_snat" => "$conf_dir/${fw_conf_prefix}_spa_dst_snat_fwknopd.conf",
|
||||
@@ -4859,25 +4861,34 @@ sub write_sudo_access_conf() {
|
||||
|
||||
sub spa_cmd_open_close_exec_cycle() {
|
||||
my $test_hr = shift;
|
||||
for my $file (@{$test_hr->{'cmd_cycle_open_file'}}) {
|
||||
unlink $file if -e $file;
|
||||
|
||||
if ($test_hr->{'cmd_cycle_open_file'}) {
|
||||
for my $file (@{$test_hr->{'cmd_cycle_open_file'}}) {
|
||||
unlink $file if -e $file;
|
||||
}
|
||||
}
|
||||
for my $file (@{$test_hr->{'cmd_cycle_close_file'}}) {
|
||||
next if $file eq 'NONE';
|
||||
unlink $file if -e $file;
|
||||
if ($test_hr->{'cmd_cycle_close_file'}) {
|
||||
for my $file (@{$test_hr->{'cmd_cycle_close_file'}}) {
|
||||
next if $file eq 'NONE';
|
||||
unlink $file if -e $file;
|
||||
}
|
||||
}
|
||||
|
||||
my $rv = &spa_cycle($test_hr);
|
||||
|
||||
unless (&file_check_and_remove('cycle open file',
|
||||
$test_hr->{'cmd_cycle_open_file'})) {
|
||||
$rv = 0;
|
||||
if ($test_hr->{'cmd_cycle_open_file'}) {
|
||||
unless (&file_check_and_remove('cycle open file',
|
||||
$test_hr->{'cmd_cycle_open_file'})) {
|
||||
$rv = 0;
|
||||
}
|
||||
}
|
||||
|
||||
unless ($test_hr->{'cmd_cycle_close_file'} eq 'NONE') {
|
||||
unless (&file_check_and_remove('cycle close file',
|
||||
$test_hr->{'cmd_cycle_close_file'})) {
|
||||
$rv = 0;
|
||||
if ($test_hr->{'cmd_cycle_close_file'}) {
|
||||
unless ($test_hr->{'cmd_cycle_close_file'} eq 'NONE') {
|
||||
unless (&file_check_and_remove('cycle close file',
|
||||
$test_hr->{'cmd_cycle_close_file'})) {
|
||||
$rv = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,15 +76,31 @@
|
||||
'detail' => 'cmd open/close cycle client timeout',
|
||||
'function' => \&spa_cmd_open_close_exec_cycle,
|
||||
'cmdline' => "$default_client_hmac_args --fw-timeout 2",
|
||||
'fwknopd_cmdline' => "$fwknopdCmd -c $cf{'def'} -a $cf{'hmac_cmd_open_close_cycle_access'} " .
|
||||
'fwknopd_cmdline' => "$fwknopdCmd -c $cf{'def'} -a $cf{'hmac_cmd_open_close_cycle_access7'} " .
|
||||
"-d $default_digest_file -p $default_pid_file $intf_str",
|
||||
'fw_rule_created' => $REQUIRE_NO_NEW_RULE,
|
||||
'cmd_cycle_open_file' => ['/tmp/127.0.0.2'],
|
||||
'cmd_cycle_close_file' => ['/tmp/2127.0.0.2'],
|
||||
'key_file' => $cf{'rc_hmac_b64_key'},
|
||||
'server_positive_output_matches' => [
|
||||
qr/Timer expired/,
|
||||
qr/Running.*CLOSE.*in 2 seconds/,
|
||||
qr/CLOSE.*\s2\d{5}/,
|
||||
],
|
||||
},
|
||||
{
|
||||
'category' => 'Rijndael+HMAC',
|
||||
'subcategory' => 'client+server',
|
||||
'detail' => 'cmd open/close cycle timeout (2)',
|
||||
'function' => \&spa_cmd_open_close_exec_cycle,
|
||||
'cmdline' => "$default_client_hmac_args --fw-timeout 2",
|
||||
'fwknopd_cmdline' => "$fwknopdCmd -c $cf{'def'} -a $cf{'hmac_cmd_open_close_cycle_access8'} " .
|
||||
"-d $default_digest_file -p $default_pid_file $intf_str",
|
||||
'fw_rule_created' => $REQUIRE_NO_NEW_RULE,
|
||||
'key_file' => $cf{'rc_hmac_b64_key'},
|
||||
'server_positive_output_matches' => [
|
||||
qr/Timer expired/,
|
||||
qr/Running.*CLOSE.*in 2 seconds/,
|
||||
qr/OPEN.*\s121/,
|
||||
qr/CLOSE.*\s222/,
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user