From 75b059af760f883a181f4e15ab1751c4676b5277 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Thu, 10 Dec 2015 14:33:51 -0800 Subject: [PATCH] [test suite] use killall to ensure fwknopd is stopped between tests --- test/test-fwknop.pl | 7 +++++++ test/tests/rijndael_hmac_cmd_exec.pl | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/test/test-fwknop.pl b/test/test-fwknop.pl index 7d1b9a99..f761a148 100755 --- a/test/test-fwknop.pl +++ b/test/test-fwknop.pl @@ -7920,6 +7920,8 @@ sub stop_fwknopd() { } else { &write_test_file("[-] stop_fwknopd() fwknopd is not running.\n", $curr_test_file); + ### make certain there is no running fwknopd process + system "$killall_path fwknopd 2> /dev/null" if $killall_path; return; } @@ -7976,6 +7978,11 @@ sub stop_fwknopd() { } } + ### make certain fwknopd is stopped. Test suite interactions with fwknop + ### are complex, and having a running fwknopd process that may be been + ### "lost" can interfere with test results + system "$killall_path fwknopd 2> /dev/null" if $killall_path; + return; } diff --git a/test/tests/rijndael_hmac_cmd_exec.pl b/test/tests/rijndael_hmac_cmd_exec.pl index 1febb9ed..66754f38 100644 --- a/test/tests/rijndael_hmac_cmd_exec.pl +++ b/test/tests/rijndael_hmac_cmd_exec.pl @@ -119,6 +119,10 @@ 'fwknopd_cmdline' => "$fwknopdCmd -c $cf{'def'} -a $sudo_access_conf " . "-d $default_digest_file -p $default_pid_file $intf_str", 'sudo_test' => $YES, + ### write_sudo_access_conf() swaps out 'TOUCH' with the path to + ### the touch binary, which might change from system to system. Also + ### 'USER' is swapped out with the owner of the test suite files + ### (not necessarily root). 'sudo_conf' => 'USER localhost = NOPASSWD: /usr/bin/cat, TOUCH', 'cmd_exec_file_owner' => 'root', 'fw_rule_created' => $REQUIRE_NO_NEW_RULE,