diff mbox

[ovs-dev] ovn: gracefully exit daemons in "3 HVs, 3 LS, 3 lports/LS, 1 LR" test

Message ID 1467483258-28603-1-git-send-email-lrichard@redhat.com
State Accepted
Headers show

Commit Message

Lance Richardson July 2, 2016, 6:14 p.m. UTC
Gracefully exit all daemons in this test case.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
---
 tests/ovn.at | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

Comments

Ben Pfaff July 2, 2016, 6:45 p.m. UTC | #1
On Sat, Jul 02, 2016 at 02:14:18PM -0400, Lance Richardson wrote:
> Gracefully exit all daemons in this test case.
> 
> Signed-off-by: Lance Richardson <lrichard@redhat.com>

It would probably be better to come up with a systematic way to do this
automatically.

I applied this anyway.

Thanks,

Ben.
Lance Richardson July 2, 2016, 7:01 p.m. UTC | #2
----- Original Message -----
> From: "Ben Pfaff" <blp@ovn.org>
> To: "Lance Richardson" <lrichard@redhat.com>
> Cc: dev@openvswitch.org
> Sent: Saturday, July 2, 2016 2:45:23 PM
> Subject: Re: [ovs-dev] [PATCH] ovn: gracefully exit daemons in "3 HVs, 3 LS, 3 lports/LS, 1 LR" test
> 
> On Sat, Jul 02, 2016 at 02:14:18PM -0400, Lance Richardson wrote:
> > Gracefully exit all daemons in this test case.
> > 
> > Signed-off-by: Lance Richardson <lrichard@redhat.com>
> 
> It would probably be better to come up with a systematic way to do this
> automatically.
> 
> I applied this anyway.
> 
> Thanks,
> 
> Ben.
> 

Agree, this isn't very "DRY".

How about simply creating functions/macros corresponding to sim_add, ovn_attach,
etc. to terminate the daemons they start? If so, I could take a stab.

Thanks,

   Lance
Ben Pfaff July 2, 2016, 7:20 p.m. UTC | #3
On Sat, Jul 02, 2016 at 03:01:03PM -0400, Lance Richardson wrote:
> ----- Original Message -----
> > From: "Ben Pfaff" <blp@ovn.org>
> > To: "Lance Richardson" <lrichard@redhat.com>
> > Cc: dev@openvswitch.org
> > Sent: Saturday, July 2, 2016 2:45:23 PM
> > Subject: Re: [ovs-dev] [PATCH] ovn: gracefully exit daemons in "3 HVs, 3 LS, 3 lports/LS, 1 LR" test
> > 
> > On Sat, Jul 02, 2016 at 02:14:18PM -0400, Lance Richardson wrote:
> > > Gracefully exit all daemons in this test case.
> > > 
> > > Signed-off-by: Lance Richardson <lrichard@redhat.com>
> > 
> > It would probably be better to come up with a systematic way to do this
> > automatically.
> > 
> > I applied this anyway.
> > 
> > Thanks,
> > 
> > Ben.
> > 
> 
> Agree, this isn't very "DRY".
> 
> How about simply creating functions/macros corresponding to sim_add, ovn_attach,
> etc. to terminate the daemons they start? If so, I could take a stab.

That would be helpful.

The biggest obstacle is probably that AT_CHECK can't be invoked directly
from a shell function that is not inside AT_SETUP...AT_CLEANUP.
diff mbox

Patch

diff --git a/tests/ovn.at b/tests/ovn.at
index 37888bf..b8a9bf5 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -1866,9 +1866,26 @@  AT_CHECK_UNQUOTED([sort < mac_bindings], [0], [`sort < mac_bindings.expected`
 ])
 
 # Gracefully terminate daemons
-for daemon in ovn-controller ovn-northd ovsdb-server; do
-    ovs-appctl -t $daemon exit
+for sim in hv1 hv2 hv3; do
+    as $sim
+    OVS_APP_EXIT_AND_WAIT([ovn-controller])
+    OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
+    OVS_APP_EXIT_AND_WAIT([ovsdb-server])
 done
+
+as ovn-sb
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+
+as ovn-nb
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+
+as northd
+OVS_APP_EXIT_AND_WAIT([ovn-northd])
+
+as main
+OVS_APP_EXIT_AND_WAIT([ovs-vswitchd])
+OVS_APP_EXIT_AND_WAIT([ovsdb-server])
+
 AT_CLEANUP
 
 # 3 hypervisors, one logical switch, 3 logical ports per hypervisor