wintest: Try harder to make wintest force the telnet server to start
authorAndrew Bartlett <abartlet@samba.org>
Tue, 29 Oct 2013 21:21:00 +0000 (10:21 +1300)
committerStefan Metzmacher <metze@samba.org>
Fri, 14 Mar 2014 13:51:20 +0000 (14:51 +0100)
We try and force the server to start, and we try to force the
TelnetClients group to exist

Change-Id: I192f0aaaf283b77065ecc671ca2b59a69781d744
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/36
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Mar 14 14:51:20 CET 2014 on sn-devel-104

wintest/wintest.py

index 61664ae87d8021eb4dff2ac2df5460560f81796a..3493df4e45751a00f1507296f20decbd606c8922 100644 (file)
@@ -679,6 +679,7 @@ options {
         set_route = False
         set_dns = False
         set_telnetclients = True
+        start_telnet = True
         if self.getvar('WIN_IP'):
             ip = self.getvar('WIN_IP')
         else:
@@ -711,6 +712,7 @@ options {
                               pexpect.EOF])
             if i == 1:
                 if set_telnetclients:
+                    self.run_cmd('bin/net rpc group add TelnetClients -S $WIN_IP -U$WIN_USER%$WIN_PASS')
                     self.run_cmd('bin/net rpc group addmem TelnetClients "authenticated users" -S $WIN_IP -U$WIN_USER%$WIN_PASS')
                     child.close()
                     retries -= 1
@@ -720,6 +722,15 @@ options {
                 else:
                     raise RuntimeError("Failed to connect with telnet due to missing TelnetClients membership")
 
+            if i == 6:
+                # This only works if it is installed and enabled, but not started.  Not entirely likely, but possible
+                self.run_cmd('bin/net rpc service start TlntSvr -S $WIN_IP -U$WIN_USER%$WIN_PASS')
+                child.close()
+                start_telnet = False
+                retries -= 1
+                self.info("retrying (retries=%u delay=%u)" % (retries, delay))
+                continue
+
             if i != 0:
                 child.close()
                 time.sleep(delay)