[ovs-dev] [PATCH] tests: Gracefully terminate daemons in OVN tests

Lance Richardson lrichard at redhat.com
Thu Feb 25 15:57:28 UTC 2016


Daemons started in OVN tests are currently killed (via "on_exit kill"
in start_daemon()). This is problematic for tools (such as gcov) that
rely on exit() being called.

Fix by using "ovs-appctl ... exit" to gracefully terminate the daemons.

Signed-off-by: Lance Richardson <lrichard at redhat.com>
Tested-by: Aaron Conole <aconole at redhat.com>
---
 tests/ovn-controller.at |  2 ++
 tests/ovn.at            | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at
index 4218fbe..2ff56af 100644
--- a/tests/ovn-controller.at
+++ b/tests/ovn-controller.at
@@ -114,4 +114,6 @@ AT_CHECK([ovn-sbctl \
     -- set Port_Binding baz type='""' options='{}'])
 check_patches
 
+# Gracefully terminate ovn-controller
+ovs-appctl -t ovn-controller exit
 AT_CLEANUP
diff --git a/tests/ovn.at b/tests/ovn.at
index 0917e8d..0bc5e58 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -746,6 +746,11 @@ for i in 1 2 3; do
         echo
     done
 done
+
+# Gracefully terminate daemons
+for daemon in ovn-controller ovn-northd ovsdb-server; do
+    ovs-appctl -t $daemon exit
+done
 AT_CLEANUP
 
 # 2 hypervisors, 4 logical ports per HV
@@ -894,6 +899,10 @@ for i in 1 2; do
     done
 done
 
+# Gracefully terminate daemons
+for daemon in ovn-controller ovn-northd ovsdb-server; do
+    ovs-appctl -t $daemon exit
+done
 AT_CLEANUP
 
 AT_SETUP([ovn -- 3 HVs, 1 VIFs/HV, 1 GW, 1 LS])
@@ -1050,6 +1059,11 @@ for i in 1 2 3; do
     AT_CHECK([sort $i.packets], [0], [expout])
     echo
 done
+
+# Gracefully terminate daemons
+for daemon in ovs-vtep ovn-controller-vtep ovn-controller ovn-northd ovsdb-server; do
+    ovs-appctl -t $daemon exit
+done
 AT_CLEANUP
 
 # 3 hypervisors, 3 logical switches with 3 logical ports each, 1 logical router
@@ -1322,4 +1336,9 @@ for i in 1 2 3; do
         done
     done
 done
+
+# Gracefully terminate daemons
+for daemon in ovn-controller ovn-northd ovsdb-server; do
+    ovs-appctl -t $daemon exit
+done
 AT_CLEANUP
-- 
2.5.0




More information about the dev mailing list