From 1fff192d3dcc8dfaf1e9f8ef4a5e427772ce23bc Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Mon, 16 Dec 2019 15:47:24 -0500
Subject: [PATCH 11/37] fix: test: leave "cleanup" for tests cases
Introduce "cleanup_late" for high level stuff not used by test cases.
(cherry picked from commit ebe4ee52658bb26d976bd2e7149c3ac1a5be65c7)
(cherry picked from commit 6068bb9ae8fca3f87edc194567909b34ee071276)
---
src/tests/functions.at | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/tests/functions.at b/src/tests/functions.at
index 1bed8a4f3a6c..46bcd369864f 100644
--- a/src/tests/functions.at
+++ b/src/tests/functions.at
@@ -89,12 +89,13 @@ m4_define([FWD_START_TEST], [
dnl run cleanup commands on test exit
echo "" > cleanup
- trap ". ./cleanup; kill_firewalld" EXIT
+ echo "" > cleanup_late
+ trap ". ./cleanup; kill_firewalld; . ./cleanup_late" EXIT
dnl create a namespace and dbus-daemon
m4_define([CURRENT_DBUS_ADDRESS], [unix:abstract=firewalld-testsuite-dbus-system-socket-${at_group_normalized}])
m4_define([CURRENT_TEST_NS], [fwd-test-${at_group_normalized}])
- echo "ip netns delete CURRENT_TEST_NS" >> ./cleanup
+ echo "ip netns delete CURRENT_TEST_NS" >> ./cleanup_late
AT_CHECK([ip netns add CURRENT_TEST_NS])
AT_DATA([./dbus.conf], [
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
@@ -135,7 +136,7 @@ m4_define([FWD_START_TEST], [
if test $? -ne 0; then
AT_FAIL_IF([:])
fi
- echo "kill $DBUS_PID" >> ./cleanup
+ echo "kill $DBUS_PID" >> ./cleanup_late
FWD_START_FIREWALLD
])
--
2.23.0