pf tests: avoid cleanup failures on skipped tests
If we skip the nat:binat_* tests (e.g. because pf.ko isn't loaded) the
inetd_tester.pid file isn't created. We still run the cleanup function,
which tries to use this file to clean up the test environment. This
results in 'broken: Test case cleanup did not terminate successfully'.
Avoid this by checking if the pid file exists before using it.
Sponsored by: Rubicon Communications, LLC ("Netgate")
This commit is contained in:
@@ -804,8 +804,8 @@ binat_compat_body()
|
||||
|
||||
binat_compat_cleanup()
|
||||
{
|
||||
[ -f ${PWD}/inetd_tester.pid ] && kill $(cat ${PWD}/inetd_tester.pid)
|
||||
pft_cleanup
|
||||
kill $(cat ${PWD}/inetd_tester.pid)
|
||||
}
|
||||
|
||||
atf_test_case "binat_match" "cleanup"
|
||||
@@ -872,8 +872,8 @@ binat_match_body()
|
||||
|
||||
binat_match_cleanup()
|
||||
{
|
||||
[ -f ${PWD}/inetd_tester.pid ] && kill $(cat ${PWD}/inetd_tester.pid)
|
||||
pft_cleanup
|
||||
kill $(cat ${PWD}/inetd_tester.pid)
|
||||
}
|
||||
|
||||
atf_test_case "empty_pool" "cleanup"
|
||||
|
||||
Reference in New Issue
Block a user