selftest: Use new ntlmv2-only and mschapv2-and-ntlmv2-only options
[sfrench/samba-autobuild/.git] / selftest / in_screen
index 5468a216e310fb7c2c2cc27804f97252fac37486..5aba08d4750c440db2c573996b45c7e0d8f8bccb 100755 (executable)
@@ -69,8 +69,18 @@ cleanup() {
 rm -f $basedir/$SERVERNAME.status $basedir/$SERVERNAME.log
 echo $$ > $basedir/$SERVERNAME.parent.pid
 trap cleanup SIGINT SIGTERM SIGPIPE
+
 if [[ "$TMUX" ]]; then
-    tmux new-window -n test:$SERVERNAME "bash $basedir/$SERVERNAME.launch"
+    TMUX_CMD=tmux
+    if [[ $TMUX = *tmate* ]]; then
+        TMUX_CMD=tmate
+    fi
+
+    $TMUX_CMD new-window -n test:$SERVERNAME "bash $basedir/$SERVERNAME.launch"
+
+    # tmux seems to lag a bit for new sessions. Don't create them too
+    # quickly one after another
+    sleep .1
 else
     screen -r -X screen -t test:$SERVERNAME bash $basedir/$SERVERNAME.launch
 fi