tests: Gracefully terminate daemons in OVN tests
authorLance Richardson <lrichard@redhat.com>
Thu, 25 Feb 2016 15:57:28 +0000 (10:57 -0500)
committerBen Pfaff <blp@ovn.org>
Thu, 25 Feb 2016 16:24:36 +0000 (08:24 -0800)
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@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
tests/ovn-controller.at
tests/ovn.at

index 4218fbe..2ff56af 100644 (file)
@@ -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
index 0917e8d..0bc5e58 100644 (file)
@@ -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