----- Original Message ----- > From: "Ben Pfaff" <b...@ovn.org> > To: "Lance Richardson" <lrich...@redhat.com> > Cc: "Joe Stringer" <j...@ovn.org>, dev@openvswitch.org, "Paul Boca" > <pb...@cloudbasesolutions.com> > Sent: Friday, June 3, 2016 3:14:55 PM > Subject: Re: [ovs-dev] [PATCH V2 4/4] tests: Fix fail of > OVS_APP_EXIT_AND_WAIT on Windows
> > > > Another thought I had while looking at this: since > > OVS_APP_EXIT_AND_WAIT_BY_TARGET > > is already in place, and since it differs from OVS_APP_EXIT_AND_WAIT only > > in > > (1) using a unixctl socket for the target and (2) using a specific rule for > > the name of the pidfile, we could rework OVS_APP_EXIT_AND_WAIT_BY_TARGET to > > take a unixctl socket and a pidfile for parameters and use the reworked > > version for both purposes. > > > > OVS_APP_EXIT_AND_WAIT_BY_TARGET is currently only used in 3 spots. > > > > I *think* this would be a fairly small set of changes, although from the > > above > > diff it seems some cleanup is needed in addition to fixing this specific > > problem. > > Makes sense. > Here's a first draft, hopefully a better description than the one above: diff --git a/tests/daemon.at b/tests/daemon.at index 41c5d07..768a44e 100644 --- a/tests/daemon.at +++ b/tests/daemon.at @@ -83,7 +83,7 @@ if test "$IS_WIN32" = "yes"; then # When a 'kill pid' is done on windows (through 'taskkill //F'), # pidfiles are not deleted (because it is force kill), so use # 'ovs-appctl exit' instead - OVS_APP_EXIT_AND_WAIT([`pwd`/unixctl]) + OVS_APP_EXIT_AND_WAIT_BY_TARGET([`pwd`/unixctl], [`pwd`/pid]) else kill `cat pid` fi diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at index 13b3f53..1cb28f8 100644 --- a/tests/ovn-controller.at +++ b/tests/ovn-controller.at @@ -127,7 +127,8 @@ check_patches \ on_exit 'kill `cat $ovs_base/ovn-sb/ovsdb-server-2.pid`' ovsdb-tool create $ovs_base/ovn-sb/ovn-sb1.db "$abs_top_srcdir"/ovn/ovn-sb.ovsschema -as ovn-sb ovsdb-server --detach --pidfile=$ovs_base/ovn-sb/ovsdb-server-2.pid --remote=punix:$ovs_base/ovn-sb/ovn-sb1.sock $ovs_base/ovn-sb/ovn-sb1.db +as ovn-sb ovsdb-server --detach --pidfile=$ovs_base/ovn-sb/ovsdb-server-2.pid --remote=punix:$ovs_base/ovn-sb/ovn-sb1.sock $ovs_base/ovn-sb/ovn-sb1.db \ + --unixctl=$ovs_base/ovn-sb/ovsdb-server-2.ctl AT_CHECK([ovs-vsctl -- set Open_vSwitch . external-ids:ovn-remote=unix:$ovs_base/ovn-sb/ovn-sb1.sock]) check_patches AT_CHECK([ovs-vsctl -- set Open_vSwitch . external-ids:ovn-remote=unix:$ovs_base/ovn-sb/ovn-sb.sock]) @@ -153,7 +154,7 @@ OVS_APP_EXIT_AND_WAIT([ovs-vswitchd]) OVS_APP_EXIT_AND_WAIT([ovsdb-server]) as ovn-sb -OVS_APP_EXIT_AND_WAIT_BY_TARGET([ovsdb-server-2]) +OVS_APP_EXIT_AND_WAIT_BY_TARGET([$ovs_base/ovn-sb/ovsdb-server-2.ctl], [$ovs_base/ovn-sb/ovsdb-server-2.pid]) OVS_APP_EXIT_AND_WAIT([ovsdb-server]) AT_CLEANUP diff --git a/tests/ovs-vswitchd.at b/tests/ovs-vswitchd.at index 816d0a2..67358fd 100644 --- a/tests/ovs-vswitchd.at +++ b/tests/ovs-vswitchd.at @@ -70,13 +70,14 @@ AT_SETUP([ovs-vswitchd -- start additional ovs-vswitchd process]) OVS_VSWITCHD_START # start another ovs-vswitchd process. -ovs-vswitchd --log-file=fakelog --unixctl="`pwd`"/unixctl & +ovs-vswitchd --log-file=fakelog --unixctl="`pwd`"/unixctl --pidfile=ovs-vswitchd-2.pid & +on_exit 'kill `cat ovs-vswitchd-2.pid`' # sleep for a while sleep 5 # stop the process. -OVS_APP_EXIT_AND_WAIT([`pwd`/unixctl]) +OVS_APP_EXIT_AND_WAIT_BY_TARGET([`pwd`/unixctl], [ovs-vswitchd-2.pid]) # check the fakelog, should only see one ERR for reporting # the existing ovs-vswitchd process. @@ -94,7 +95,8 @@ AT_SETUP([ovs-vswitchd -- switch over to another ovs-vswitchd process]) OVS_VSWITCHD_START # start a new ovs-vswitchd process. -ovs-vswitchd --log-file=fakelog --enable-dummy --unixctl="`pwd`"/unixctl & +ovs-vswitchd --log-file=fakelog --enable-dummy --unixctl="`pwd`"/unixctl --pidfile=ovs-vswitchd-2.pid & +on_exit 'kill `cat ovs-vswitchd-2.pid`' # sleep for a while. sleep 5 @@ -112,7 +114,7 @@ bridge br0: using datapath ID ]) # stop the process. -OVS_APP_EXIT_AND_WAIT([`pwd`/unixctl]) +OVS_APP_EXIT_AND_WAIT_BY_TARGET([`pwd`/unixctl], [ovs-vswitchd-2.pid]) # check the fakelog, should not see WARN/ERR/EMER log other than the one # for reporting the existing ovs-vswitchd process and the one for killing @@ -132,13 +134,14 @@ dnl ---------------------------------------------------------------------- AT_SETUP([ovs-vswitchd -- invalid database path]) # start an ovs-vswitchd process with invalid db path. -ovs-vswitchd unix:invalid.db.sock --log-file=fakelog --enable-dummy --unixctl="`pwd`"/unixctl & +ovs-vswitchd unix:invalid.db.sock --log-file=fakelog --enable-dummy --unixctl="`pwd`"/unixctl --pidfile=ovs-vswitchd-2.pid & +on_exit 'kill `cat ovs-vswitchd-2.pid`' # sleep for a while. sleep 10 # stop the process. -OVS_APP_EXIT_AND_WAIT([`pwd`/unixctl]) +OVS_APP_EXIT_AND_WAIT_BY_TARGET([`pwd`/unixctl], [ovs-vswitchd-2.pid]) # should not see this log (which indicates high cpu utilization). AT_CHECK([grep "wakeup due to" fakelog], [ignore]) diff --git a/tests/ovsdb-monitor.at b/tests/ovsdb-monitor.at index 37383fa..62b899e 100644 --- a/tests/ovsdb-monitor.at +++ b/tests/ovsdb-monitor.at @@ -39,7 +39,7 @@ m4_define([OVSDB_CHECK_MONITOR], [ignore], [ignore], [kill `cat server-pid client-pid`])]) AT_CHECK([ovsdb-client transact unix:socket '[["$4"]]'], [0], [ignore], [ignore], [kill `cat server-pid client-pid`]) - OVS_APP_EXIT_AND_WAIT(["`pwd`"/unixctl]) + OVS_APP_EXIT_AND_WAIT([`pwd`/unixctl], [`pwd`/pid]) OVS_WAIT_UNTIL([test ! -e client-pid]) AT_CHECK([${PERL} $srcdir/ovsdb-monitor-sort.pl < output | ${PERL} $srcdir/uuidfilt.pl], [0], [$7], [ignore]) AT_CLEANUP]) diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index 0ed7e87..9da511d 100644 --- a/tests/ovsdb-server.at +++ b/tests/ovsdb-server.at @@ -1,7 +1,7 @@ AT_BANNER([OVSDB -- ovsdb-server transactions (Unix sockets)]) m4_define([OVSDB_SERVER_SHUTDOWN], - [OVS_APP_EXIT_AND_WAIT(["`pwd`"/unixctl])]) + [OVS_APP_EXIT_AND_WAIT_BY_TARGET([`pwd`/unixctl], [`pwd`/pid])]) # OVSDB_CHECK_EXECUTION(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS]) # _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev