ctdb-tests: Wait for fake_ctdbd to start, fail if it doesn't
authorMartin Schwenke <martin@meltin.net>
Wed, 25 Oct 2017 06:52:04 +0000 (17:52 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 26 Oct 2017 07:35:25 +0000 (09:35 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13097

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/tool/scripts/local.sh

index 2c9be2d324c6aec9a0ecdf4bbfaec8cc77bf770c..7cee84a2d4bae327028349d3b7224da6f2fde6c0 100644 (file)
@@ -48,10 +48,14 @@ cleanup_ctdbd ()
 
 setup_ctdbd ()
 {
-       debug "Setting up fake ctdbd"
+       echo "Setting up fake ctdbd"
 
        $VALGRIND fake_ctdbd -d "$FAKE_CTDBD_DEBUGLEVEL" \
                  -s "$ctdbd_socket" -p "$ctdbd_pidfile"
+       # Wait till fake_ctdbd is running
+       wait_until 10 test -S "$ctdbd_socket" || \
+               die "fake_ctdbd failed to start"
+
        test_cleanup cleanup_ctdbd
 }