[PATCH] selftest: wait for smbd and winbindd in 1-second loop

Michael Adam obnox at samba.org
Tue Jul 12 13:41:03 UTC 2016


Instead of sleeping for 2 seconds, sleep 1 second,
thereby potentially reducing the overall time spent
waiting in selftest setups.

Review appreciated.

Thanks - Michael
-------------- next part --------------
From ab912510cae5a8e8da7bdb3bcd68ae11c6866562 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Thu, 16 Jun 2016 01:00:13 +0200
Subject: [PATCH 1/2] selftest: check for winbind on 1-second basis

There is a chance to reduce the overall time spent checking.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 selftest/target/Samba3.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 79a9d0d..cfb6bb7 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -2086,11 +2086,11 @@ sub wait_for_start($$$$$)
 	    do {
 		$ret = system("SELFTEST_WINBINDD_SOCKET_DIR=" . $envvars->{SELFTEST_WINBINDD_SOCKET_DIR} . " " . Samba::bindir_path($self, "wbinfo") . " --ping-dc");
 		if ($ret != 0) {
-		    sleep(2);
+		    sleep(1);
 		}
 		$count++;
-	    } while ($ret != 0 && $count < 10);
-	    if ($count == 10) {
+	    } while ($ret != 0 && $count < 20);
+	    if ($count == 20) {
 		print "WINBINDD not reachable after 20 seconds\n";
 		teardown_env($self, $envvars);
 		return 0;
-- 
2.5.5


From bb9bbe877a86149302be5d64615c5e459938ec21 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 12 Jul 2016 13:16:27 +0200
Subject: [PATCH 2/2] selftest: check for smbd on a 1-second basis.

Chance to reduce the overall time spent in checking for smbd

Signed-off-by: Michael Adam <obnox at samba.org>
---
 selftest/target/Samba3.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index cfb6bb7..708a992 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -2105,11 +2105,11 @@ sub wait_for_start($$$$$)
 	    do {
 		$ret = system(Samba::bindir_path($self, "smbclient") ." $envvars->{CONFIGURATION} -L $envvars->{SERVER} -U% -p 139");
 		if ($ret != 0) {
-		    sleep(2);
+		    sleep(1);
 		}
 		$count++
-	    } while ($ret != 0 && $count < 10);
-	    if ($count == 10) {
+	    } while ($ret != 0 && $count < 20);
+	    if ($count == 20) {
 		print "SMBD failed to start up in a reasonable time (20sec)\n";
 		teardown_env($self, $envvars);
 		return 0;
-- 
2.5.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160712/76dae6c5/signature.sig>


More information about the samba-technical mailing list