daemon.at: Fix a race condition with windows service test.
authorGurucharan Shetty <gshetty@nicira.com>
Wed, 11 Feb 2015 18:34:11 +0000 (10:34 -0800)
committerGurucharan Shetty <gshetty@nicira.com>
Thu, 12 Feb 2015 00:23:58 +0000 (16:23 -0800)
OVS daemon service for Windows creates the pidfile and then
registers with the Windows services manager that the service
is running. There is a small time gap between the two steps.
So retry a few times in the test.

Also, provide a keyword for the test.

Reported-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Tested-by: Nithin Raju <nithin@vmware.com>
tests/daemon.at

index 4a6f341..dd7a3f4 100644 (file)
@@ -161,6 +161,7 @@ AT_CHECK([test ! -s pid])
 AT_CLEANUP
 
 AT_SETUP([daemon --service])
+AT_KEYWORDS([windows-service])
 AT_SKIP_IF([test "$IS_WIN32" != "yes"])
 OVSDB_INIT([db])
 AT_CAPTURE_FILE([pid])
@@ -173,7 +174,7 @@ AT_CHECK([sc create ovsdb-server binpath="$abs_path/ovsdb-server `pwd`/db --log-
 
 AT_CHECK([sc start ovsdb-server], [0], [ignore])
 OVS_WAIT_UNTIL([test -s pid])
-AT_CHECK([sc query ovsdb-server | grep STATE | grep RUNNING], [0], [ignore])
+OVS_WAIT_UNTIL([sc query ovsdb-server | grep STATE | grep RUNNING > /dev/null 2>&1])
 AT_CHECK([kill -0 `cat pid`], [0], [ignore])
 AT_CHECK([ovs-appctl -t `pwd`/unixctl ovsdb-server/list-dbs], [0],
 [Open_vSwitch