self.vars = {}
self.list_mode = False
self.vms = None
- os.putenv('PYTHONUNBUFFERED', '1')
+ os.environ['PYTHONUNBUFFERED'] = '1'
self.parser = optparse.OptionParser("wintest")
def check_prerequesites(self):
def set_vms(self, vms):
'''set a list of VMs to test'''
if vms is not None:
- self.vms = vms.split(',')
+ self.vms = []
+ for vm in vms.split(','):
+ vm = vm.upper()
+ self.vms.append(vm)
def skip(self, step):
'''return True if we should skip a step'''
def putenv(self, key, value):
'''putenv with substitution'''
- os.putenv(key, self.substitute(value))
+ os.environ[key] = self.substitute(value)
def chdir(self, dir):
'''chdir with substitution'''
self.rndc_cmd("flush")
def restart_bind(self, kerberos_support=False, include=None):
- self.configure_bind(keberos_support=kerberos_support, include=include)
+ self.configure_bind(kerberos_support=kerberos_support, include=include)
self.stop_bind()
self.start_bind()
return True
def set_noexpire(self, child, username):
- '''Ensure this user's password does not expire'''
+ """Ensure this user's password does not expire"""
child.sendline('wmic useraccount where name="%s" set PasswordExpires=FALSE' % username)
child.expect("update successful")
child.expect("C:")
def run_tlntadmn(self, child):
'''remove the annoying telnet restrictions'''
child.sendline('tlntadmn config maxconn=1024')
- child.expect("The settings were successfully updated")
+ child.expect(["The settings were successfully updated", "Access is denied"])
child.expect("C:")
def disable_firewall(self, child):
'''remove the annoying firewall'''
child.sendline('netsh advfirewall set allprofiles state off')
- i = child.expect(["Ok", "The following command was not found: advfirewall set allprofiles state off"])
+ i = child.expect(["Ok", "The following command was not found: advfirewall set allprofiles state off", "The requested operation requires elevation"])
child.expect("C:")
if i == 1:
child.sendline('netsh firewall set opmode mode = DISABLE profile = ALL')
if i != 0:
self.info("Firewall disable failed - ignoring")
child.expect("C:")
-
+
def set_dns(self, child):
child.sendline('netsh interface ip set dns "${WIN_NIC}" static ${INTERFACE_IP} primary')
i = child.expect(['C:', pexpect.EOF, pexpect.TIMEOUT], timeout=5)
self.cmd_contains("bin/smbclient --version", ["${SAMBA_VERSION}"])
self.retry_cmd('bin/smbclient -L ${WIN_HOSTNAME} -U%s%%%s %s' % (username, password, args), ["IPC"])
+ def test_net_use(self, vm, domain, username, password):
+ self.setwinvars(vm)
+ self.info('Testing net use against Samba3 member')
+ child = self.open_telnet("${WIN_HOSTNAME}", "%s\\%s" % (domain, username), password)
+ child.sendline("net use t: \\\\${HOSTNAME}.${LCREALM}\\test")
+ child.expect("The command completed successfully")
+
def setup(self, testname, subdir):
'''setup for main tests, parsing command line'''