diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-11-22 21:23:38 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-11-23 07:46:07 +0100 |
commit | 5767ee96636470b32c7c819bbef75d06fe1004e6 (patch) | |
tree | a4d2efb6ea2fb6f7bb28d1d3e9314224df7d9a40 /wintest/test-s4-howto.py | |
parent | c251c45e7f97128e1066d788ad7fe254f2b64474 (diff) | |
download | samba-5767ee96636470b32c7c819bbef75d06fe1004e6.tar.gz samba-5767ee96636470b32c7c819bbef75d06fe1004e6.tar.xz samba-5767ee96636470b32c7c819bbef75d06fe1004e6.zip |
wintest Set the virtual machine IP to match it's dynamic IP, but don't use DHCP
The idea here is that the virtual machine stays on the address
allocated by DHCP, but is configured statically. This avoids the need
to manually set the address on the host, but avoids the host being
instructed by DHCP not to do Dynamic DNS.
Andrew Bartlett
Diffstat (limited to 'wintest/test-s4-howto.py')
-rwxr-xr-x | wintest/test-s4-howto.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/wintest/test-s4-howto.py b/wintest/test-s4-howto.py index 4c47b461339..65fb5ae9c18 100755 --- a/wintest/test-s4-howto.py +++ b/wintest/test-s4-howto.py @@ -119,20 +119,25 @@ def run_winjoin(t, vm): t.vm_poweroff("${WIN_VM}", checkfail=False) t.vm_restore("${WIN_VM}", "${WIN_SNAPSHOT}") t.ping_wait("${WIN_HOSTNAME}") - child = t.open_telnet("${WIN_HOSTNAME}", "${WIN_USER}", "${WIN_PASS}", set_time=True) + child = t.open_telnet("${WIN_HOSTNAME}", "${WIN_USER}", "${WIN_PASS}", set_time=True, set_ip=True) child.sendline("netdom join ${WIN_HOSTNAME} /Domain:${LCREALM} /PasswordD:${PASSWORD1} /UserD:administrator") child.expect("The command completed successfully") + child.expect("C:") child.sendline("shutdown /r -t 0") t.port_wait("${WIN_HOSTNAME}", 139, wait_for_fail=True) t.port_wait("${WIN_HOSTNAME}", 139) - + child = t.open_telnet("${WIN_HOSTNAME}", "${WIN_USER}", "${WIN_PASS}", set_time=True, set_ip=True) + child.expect("C:") + child.sendline("ipconfig /registerdns") + child.expect("Registration of the DNS resource records for all adapters of this computer has been initiated. Any errors will be reported in the Event Viewer") + child.expect("C:") def test_winjoin(t, vm): t.setwinvars(vm) t.info("Checking the windows join is OK") t.chdir('${PREFIX}') t.port_wait("${WIN_HOSTNAME}", 139) - t.retry_cmd('bin/smbclient -L ${WIN_HOSTNAME}.${LCREALM} -Uadministrator@${LCREALM}%${PASSWORD1}', ["C$", "IPC$", "Sharename"]) + t.retry_cmd('bin/smbclient -L ${WIN_HOSTNAME}.${LCREALM} -Uadministrator@${LCREALM}%${PASSWORD1}', ["C$", "IPC$", "Sharename"], retries=100) t.cmd_contains("host -t A ${WIN_HOSTNAME}.${LCREALM}.", ['has address']) t.cmd_contains('bin/smbclient -L ${WIN_HOSTNAME}.${LCREALM} -Utestallowed@${LCREALM}%${PASSWORD1}', ["C$", "IPC$", "Sharename"]) t.cmd_contains('bin/smbclient -L ${WIN_HOSTNAME}.${LCREALM} -k no -Utestallowed@${LCREALM}%${PASSWORD1}', ["C$", "IPC$", "Sharename"]) @@ -151,7 +156,7 @@ def run_dcpromo(t, vm): t.vm_poweroff("${WIN_VM}", checkfail=False) t.vm_restore("${WIN_VM}", "${WIN_SNAPSHOT}") t.ping_wait("${WIN_HOSTNAME}") - child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}") + child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_ip=True) child.sendline("copy /Y con answers.txt") child.sendline(''' [DCINSTALL] @@ -286,7 +291,7 @@ def run_dcpromo_rodc(t, vm): t.vm_poweroff("${WIN_VM}", checkfail=False) t.vm_restore("${WIN_VM}", "${WIN_SNAPSHOT}") t.ping_wait("${WIN_HOSTNAME}") - child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}") + child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_ip=True) child.sendline("copy /Y con answers.txt") child.sendline(''' [DCInstall] @@ -363,7 +368,7 @@ def join_as_dc(t, vm): t.vm_restore("${WIN_VM}", "${WIN_SNAPSHOT}") t.run_cmd('${RNDC} flush') t.run_cmd("rm -rf etc private") - t.open_telnet("${WIN_HOSTNAME}", "${WIN_DOMAIN}\\administrator", "${WIN_PASS}", set_time=True) + t.open_telnet("${WIN_HOSTNAME}", "${WIN_DOMAIN}\\administrator", "${WIN_PASS}", set_time=True, set_ip=True) t.retry_cmd("bin/samba-tool drs showrepl ${WIN_HOSTNAME} -Uadministrator%${WIN_PASS}", ['INBOUND NEIGHBORS'] ) t.run_cmd('bin/samba-tool join ${WIN_REALM} DC -Uadministrator%${WIN_PASS} -d${DEBUGLEVEL}') t.run_cmd('bin/samba-tool drs kcc ${WIN_HOSTNAME} -Uadministrator@${WIN_REALM}%${WIN_PASS}') @@ -430,7 +435,7 @@ def join_as_rodc(t, vm): t.vm_restore("${WIN_VM}", "${WIN_SNAPSHOT}") t.run_cmd('${RNDC} flush') t.run_cmd("rm -rf etc private") - t.open_telnet("${WIN_HOSTNAME}", "${WIN_DOMAIN}\\administrator", "${WIN_PASS}", set_time=True) + t.open_telnet("${WIN_HOSTNAME}", "${WIN_DOMAIN}\\administrator", "${WIN_PASS}", set_time=True, set_ip=True) t.retry_cmd("bin/samba-tool drs showrepl ${WIN_HOSTNAME} -Uadministrator%${WIN_PASS}", ['INBOUND NEIGHBORS'] ) t.run_cmd('bin/samba-tool join ${WIN_REALM} RODC -Uadministrator%${WIN_PASS} -d${DEBUGLEVEL}') t.run_cmd('bin/samba-tool drs kcc ${WIN_HOSTNAME} -Uadministrator@${WIN_REALM}%${WIN_PASS}') |