1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

wintest: Fix invalid escape sequences

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Oct 13 04:55:06 UTC 2023 on atb-devel-224
This commit is contained in:
Joseph Sutton 2023-09-11 11:59:55 +12:00 committed by Andrew Bartlett
parent 3f70da665b
commit d895c98c50
2 changed files with 16 additions and 16 deletions

View File

@ -160,7 +160,7 @@ def run_dcpromo(t, vm):
t.info("Joining a windows VM ${WIN_VM} to the domain as a DC using dcpromo") t.info("Joining a windows VM ${WIN_VM} to the domain as a DC using dcpromo")
child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_ip=True, set_noexpire=True) child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_ip=True, set_noexpire=True)
child.sendline("copy /Y con answers.txt") child.sendline("copy /Y con answers.txt")
child.sendline(b''' child.sendline(br'''
[DCINSTALL] [DCINSTALL]
RebootOnSuccess=Yes RebootOnSuccess=Yes
RebootOnCompletion=Yes RebootOnCompletion=Yes
@ -171,7 +171,7 @@ InstallDNS=No
ConfirmGc=Yes ConfirmGc=Yes
CreateDNSDelegation=No CreateDNSDelegation=No
UserDomain=${LCREALM} UserDomain=${LCREALM}
UserName=${LCREALM}\\administrator UserName=${LCREALM}\administrator
Password=${PASSWORD1} Password=${PASSWORD1}
DatabasePath="C:\Windows\NTDS" DatabasePath="C:\Windows\NTDS"
LogPath="C:\Windows\NTDS" LogPath="C:\Windows\NTDS"
@ -187,7 +187,7 @@ SafeModeAdminPassword=${PASSWORD1}
if i == 1 or i == 2: if i == 1 or i == 2:
child.sendline("echo off") child.sendline("echo off")
child.sendline("echo START DCPROMO log") child.sendline("echo START DCPROMO log")
child.sendline("more c:\windows\debug\dcpromoui.log") child.sendline(r"more c:\windows\debug\dcpromoui.log")
child.sendline("echo END DCPROMO log") child.sendline("echo END DCPROMO log")
child.expect("END DCPROMO") child.expect("END DCPROMO")
raise Exception("dcpromo failed") raise Exception("dcpromo failed")
@ -315,7 +315,7 @@ def run_dcpromo_rodc(t, vm):
t.vm_restore("${WIN_VM}", "${WIN_SNAPSHOT}") t.vm_restore("${WIN_VM}", "${WIN_SNAPSHOT}")
child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_ip=True) child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_ip=True)
child.sendline("copy /Y con answers.txt") child.sendline("copy /Y con answers.txt")
child.sendline(b''' child.sendline(br'''
[DCInstall] [DCInstall]
ReplicaOrNewDomain=ReadOnlyReplica ReplicaOrNewDomain=ReadOnlyReplica
ReplicaDomainDNSName=${LCREALM} ReplicaDomainDNSName=${LCREALM}
@ -325,13 +325,13 @@ PasswordReplicationDenied="BUILTIN\Backup Operators"
PasswordReplicationDenied="BUILTIN\Account Operators" PasswordReplicationDenied="BUILTIN\Account Operators"
PasswordReplicationDenied="${DOMAIN}\Denied RODC Password Replication Group" PasswordReplicationDenied="${DOMAIN}\Denied RODC Password Replication Group"
PasswordReplicationAllowed="${DOMAIN}\Allowed RODC Password Replication Group" PasswordReplicationAllowed="${DOMAIN}\Allowed RODC Password Replication Group"
DelegatedAdmin="${DOMAIN}\\Administrator" DelegatedAdmin="${DOMAIN}\Administrator"
SiteName=Default-First-Site-Name SiteName=Default-First-Site-Name
InstallDNS=No InstallDNS=No
ConfirmGc=Yes ConfirmGc=Yes
CreateDNSDelegation=No CreateDNSDelegation=No
UserDomain=${LCREALM} UserDomain=${LCREALM}
UserName=${LCREALM}\\administrator UserName=${LCREALM}\administrator
Password=${PASSWORD1} Password=${PASSWORD1}
DatabasePath="C:\Windows\NTDS" DatabasePath="C:\Windows\NTDS"
LogPath="C:\Windows\NTDS" LogPath="C:\Windows\NTDS"
@ -346,7 +346,7 @@ RebootOnCompletion=No
if i != 0: if i != 0:
child.sendline("echo off") child.sendline("echo off")
child.sendline("echo START DCPROMO log") child.sendline("echo START DCPROMO log")
child.sendline("more c:\windows\debug\dcpromoui.log") child.sendline(r"more c:\windows\debug\dcpromoui.log")
child.sendline("echo END DCPROMO log") child.sendline("echo END DCPROMO log")
child.expect("END DCPROMO") child.expect("END DCPROMO")
raise Exception("dcpromo failed") raise Exception("dcpromo failed")

View File

@ -295,7 +295,7 @@ class wintest():
if i == 0: if i == 0:
child.expect('your original resolv.conf') child.expect('your original resolv.conf')
child.expect('nameserver') child.expect('nameserver')
child.expect('\d+.\d+.\d+.\d+') child.expect(r'\d+.\d+.\d+.\d+')
return child.after return child.after
def rndc_cmd(self, cmd, checkfail=True): def rndc_cmd(self, cmd, checkfail=True):
@ -554,16 +554,16 @@ options {
'''get the IP configuration of the child''' '''get the IP configuration of the child'''
child.sendline("ipconfig /all") child.sendline("ipconfig /all")
child.expect('Ethernet adapter ') child.expect('Ethernet adapter ')
child.expect("[\w\s]+") child.expect(r"[\w\s]+")
self.setvar("WIN_NIC", child.after) self.setvar("WIN_NIC", child.after)
child.expect(['IPv4 Address', 'IP Address']) child.expect(['IPv4 Address', 'IP Address'])
child.expect('\d+.\d+.\d+.\d+') child.expect(r'\d+.\d+.\d+.\d+')
self.setvar('WIN_IPV4_ADDRESS', child.after) self.setvar('WIN_IPV4_ADDRESS', child.after)
child.expect('Subnet Mask') child.expect('Subnet Mask')
child.expect('\d+.\d+.\d+.\d+') child.expect(r'\d+.\d+.\d+.\d+')
self.setvar('WIN_SUBNET_MASK', child.after) self.setvar('WIN_SUBNET_MASK', child.after)
child.expect('Default Gateway') child.expect('Default Gateway')
i = child.expect(['\d+.\d+.\d+.\d+', "C:"]) i = child.expect([r'\d+.\d+.\d+.\d+', "C:"])
if i == 0: if i == 0:
self.setvar('WIN_DEFAULT_GATEWAY', child.after) self.setvar('WIN_DEFAULT_GATEWAY', child.after)
child.expect("C:") child.expect("C:")
@ -581,7 +581,7 @@ options {
child.expect("C:") child.expect("C:")
child.sendline("net config Workstation") child.sendline("net config Workstation")
child.expect("Workstation domain") child.expect("Workstation domain")
child.expect('[\S]+') child.expect(r'[\S]+')
domain = child.after domain = child.after
i = child.expect(["Workstation Domain DNS Name", "Logon domain"]) i = child.expect(["Workstation Domain DNS Name", "Logon domain"])
'''If we get the Logon domain first, we are not in an AD domain''' '''If we get the Logon domain first, we are not in an AD domain'''
@ -590,7 +590,7 @@ options {
if domain.upper() == self.getvar("WIN_DOMAIN").upper(): if domain.upper() == self.getvar("WIN_DOMAIN").upper():
return True return True
child.expect('[\S]+') child.expect(r'[\S]+')
hostname = child.after hostname = child.after
if hostname.upper() == self.getvar("WIN_HOSTNAME").upper(): if hostname.upper() == self.getvar("WIN_HOSTNAME").upper():
return True return True
@ -659,7 +659,7 @@ options {
child = self.pexpect_spawn("bin/nmblookup %s" % hostname) child = self.pexpect_spawn("bin/nmblookup %s" % hostname)
i = 0 i = 0
while i == 0: while i == 0:
i = child.expect(["querying", '\d+.\d+.\d+.\d+', hostname, "Lookup failed"]) i = child.expect(["querying", r'\d+.\d+.\d+.\d+', hostname, "Lookup failed"])
if i == 0: if i == 0:
child.expect("\r") child.expect("\r")
if i == 1: if i == 1:
@ -833,7 +833,7 @@ options {
"""This server must therefore not yet be a directory server, so we must promote it""" """This server must therefore not yet be a directory server, so we must promote it"""
child.sendline("copy /Y con answers.txt") child.sendline("copy /Y con answers.txt")
child.sendline(b''' child.sendline(br'''
[DCInstall] [DCInstall]
; New forest promotion ; New forest promotion
ReplicaOrNewDomain=Domain ReplicaOrNewDomain=Domain