my $rv = &client_server_interaction($test_hr, \@packets,
$USE_PREDEF_PKTS, $NO_FW_RULE, $NO_FORCE_STOP);
+ sleep 2;
+
if (&is_fwknopd_running()) {
&stop_fwknopd();
$rv = 0;
my $rv = &client_server_interaction($test_hr, \@packets,
$USE_PREDEF_PKTS, $NO_FW_RULE, $NO_FORCE_STOP);
- unless (&file_find_regex([qr/Not\senough\sdata/],
- $server_test_file)) {
- $rv = 0;
- }
+ sleep 2;
if (&is_fwknopd_running()) {
&stop_fwknopd();
$rv = 0;
}
+ unless (&file_find_regex([qr/Not\senough\sdata/],
+ $server_test_file)) {
+ $rv = 0;
+ }
+
return $rv;
}
}
if ($fw_rules_flag == $REQUIRE_FW_RULE) {
+ my $ctr = 0;
### check to see if the SPA packet resulted in a new fw access rule
- if ($use_valgrind) {
- sleep 3;
- } else {
+ while (not &is_fw_rule_active()) {
+ &write_test_file("[-] new fw rule does not exist.\n");
+ $ctr++;
+ last if $ctr == 3;
sleep 1;
}
- unless (&is_fw_rule_active()) {
- &write_test_file("[-] new fw rules does not exist.\n");
+ if ($ctr == 3) {
$rv = 0;
}
}
sub time_for_valgrind() {
my $ctr = 0;
- while (&run_cmd("ps axuww | grep LD_LIBRARY_PATH | grep valgrind |grep -v perl | grep -v grep",
+ while (&run_cmd("ps axuww | grep LD_LIBRARY_PATH | " .
+ "grep valgrind |grep -v perl | grep -v grep",
$cmd_out_tmp, $current_test_file)) {
$ctr++;
last if $ctr == 5;