summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-02-17 11:27:02 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-02-17 17:36:37 +1100
commita7569b68f96ca6f70e9e580e7067a31a411a3de3 (patch)
treeb9552bb9fc60ff118d31db61b419d65734730be9
parent111f8f4a7c86951c49dbc0f4c030d3a83d82b060 (diff)
downloadsamba-a7569b68f96ca6f70e9e580e7067a31a411a3de3.tar.gz
samba-a7569b68f96ca6f70e9e580e7067a31a411a3de3.tar.bz2
samba-a7569b68f96ca6f70e9e580e7067a31a411a3de3.zip
wintest: use net rpc to put authenticated users into TelentClients if we need to
-rw-r--r--wintest/wintest.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/wintest/wintest.py b/wintest/wintest.py
index 2738044e10..11fdd91a20 100644
--- a/wintest/wintest.py
+++ b/wintest/wintest.py
@@ -658,6 +658,7 @@ options {
'''open a telnet connection to a windows server, return the pexpect child'''
set_route = False
set_dns = False
+ set_telnetclients = True
if self.getvar('WIN_IP'):
ip = self.getvar('WIN_IP')
else:
@@ -681,12 +682,24 @@ options {
child.expect("password:")
child.sendline(password)
i = child.expect(["C:",
+ "TelnetClients",
"Denying new connections due to the limit on number of connections",
"No more connections are allowed to telnet server",
"Unable to connect to remote host",
"No route to host",
"Connection refused",
pexpect.EOF])
+ if i == 1:
+ if set_telnetclients:
+ self.run_cmd('bin/net rpc group addmem TelnetClients "authenticated users" -S $WIN_IP -U$WIN_USER%$WIN_PASS')
+ child.close()
+ retries -= 1
+ set_telnetclients = False
+ self.info("retrying (retries=%u delay=%u)" % (retries, delay))
+ continue
+ else:
+ raise RuntimeError("Failed to connect with telnet due to missing TelnetClients membership")
+
if i != 0:
child.close()
time.sleep(delay)