Blame SOURCES/0011-fix-test-leave-cleanup-for-tests-cases.patch

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