[test suite] run interrupt signal test against foreground fwknopd process
This commit is contained in:
parent
1dccab0fc8
commit
824ebe94f8
@ -1871,6 +1871,24 @@ sub server_start_stop_cycle() {
|
|||||||
&run_cmd("$lib_view_str $valgrind_str $fwknopdCmd $default_server_conf_args -K",
|
&run_cmd("$lib_view_str $valgrind_str $fwknopdCmd $default_server_conf_args -K",
|
||||||
$cmd_out_tmp, $curr_test_file);
|
$cmd_out_tmp, $curr_test_file);
|
||||||
|
|
||||||
|
### now send the signals against a non-daemon fwknopd process
|
||||||
|
for my $sig ($sigs{'SIGINT'}, $sigs{'SIGUSR1'}, $sigs{'SIGUSR2'}) {
|
||||||
|
|
||||||
|
&do_fwknopd_cmd("$lib_view_str $valgrind_str " .
|
||||||
|
"$fwknopdCmd $default_server_conf_args -f");
|
||||||
|
|
||||||
|
open F, "< $default_pid_file" or
|
||||||
|
die "[*] Could not open $default_pid_file: $!";
|
||||||
|
my $pid = <F>;
|
||||||
|
close F;
|
||||||
|
chomp $pid;
|
||||||
|
kill $sig, $pid;
|
||||||
|
|
||||||
|
sleep 1;
|
||||||
|
&run_cmd("$lib_view_str $valgrind_str $fwknopdCmd $default_server_conf_args -K",
|
||||||
|
$cmd_out_tmp, $curr_test_file);
|
||||||
|
}
|
||||||
|
|
||||||
return $rv;
|
return $rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5977,10 +5995,8 @@ sub write_pid() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub start_fwknopd() {
|
sub do_fwknopd_cmd() {
|
||||||
my $test_hr = shift;
|
my $cmdline = shift;
|
||||||
|
|
||||||
&write_test_file("[+] TEST: $test_hr->{'msg'}\n", $server_test_file);
|
|
||||||
|
|
||||||
my $pid = fork();
|
my $pid = fork();
|
||||||
die "[*] Could not fork: $!" unless defined $pid;
|
die "[*] Could not fork: $!" unless defined $pid;
|
||||||
@ -5988,8 +6004,7 @@ sub start_fwknopd() {
|
|||||||
if ($pid == 0) {
|
if ($pid == 0) {
|
||||||
|
|
||||||
### we are the child, so start fwknopd
|
### we are the child, so start fwknopd
|
||||||
exit &run_cmd($test_hr->{'fwknopd_cmdline'},
|
exit &run_cmd($cmdline, $server_cmd_tmp, $server_test_file);
|
||||||
$server_cmd_tmp, $server_test_file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
### look for 'fwknopd main event loop' as the indicator that fwknopd
|
### look for 'fwknopd main event loop' as the indicator that fwknopd
|
||||||
@ -6023,6 +6038,14 @@ sub start_fwknopd() {
|
|||||||
return $pid;
|
return $pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub start_fwknopd() {
|
||||||
|
my $test_hr = shift;
|
||||||
|
|
||||||
|
&write_test_file("[+] TEST: $test_hr->{'msg'}\n", $server_test_file);
|
||||||
|
|
||||||
|
return &do_fwknopd_cmd($test_hr->{'fwknopd_cmdline'});
|
||||||
|
}
|
||||||
|
|
||||||
sub write_key() {
|
sub write_key() {
|
||||||
my ($key, $file) = @_;
|
my ($key, $file) = @_;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user