| Index: client/tests/kvm/tests/whql_client_install.py
|
| diff --git a/client/tests/kvm/tests/whql_client_install.py b/client/tests/kvm/tests/whql_client_install.py
|
| index c2616c6ae493e8324cf69400003a10d1aab6d9a3..84b91bc282431188590d8a08df0dfb09bd682e19 100644
|
| --- a/client/tests/kvm/tests/whql_client_install.py
|
| +++ b/client/tests/kvm/tests/whql_client_install.py
|
| @@ -13,9 +13,6 @@ def run_whql_client_install(test, params, env):
|
| 5) Move the client machine into the server's workgroup
|
| 6) Reboot the client machine
|
| 7) Install the DTM client software
|
| - 8) Setup auto logon for the user created by the installation
|
| - (normally DTMLLUAdminUser)
|
| - 9) Reboot again
|
|
|
| @param test: kvm test object
|
| @param params: Dictionary with the test parameters
|
| @@ -32,8 +29,6 @@ def run_whql_client_install(test, params, env):
|
| "Microsoft Driver Test Manager\\Studio")
|
| server_username = params.get("server_username")
|
| server_password = params.get("server_password")
|
| - client_username = params.get("client_username")
|
| - client_password = params.get("client_password")
|
| dsso_delete_machine_binary = params.get("dsso_delete_machine_binary",
|
| "deps/whql_delete_machine_15.exe")
|
| dsso_delete_machine_binary = kvm_utils.get_path(test.bindir,
|
| @@ -55,28 +50,27 @@ def run_whql_client_install(test, params, env):
|
| server_session = kvm_utils.remote_login("nc", server_address,
|
| server_shell_port, "", "",
|
| session.prompt, session.linesep)
|
| - server_session.set_status_test_command(session.status_test_command)
|
|
|
| # Get server and client information
|
| cmd = "echo %computername%"
|
| - server_name = server_session.cmd_output(cmd).strip()
|
| - client_name = session.cmd_output(cmd).strip()
|
| + server_name = server_session.get_command_output(cmd).strip()
|
| + client_name = session.get_command_output(cmd).strip()
|
| cmd = "wmic computersystem get domain"
|
| - server_workgroup = server_session.cmd_output(cmd).strip()
|
| + server_workgroup = server_session.get_command_output(cmd).strip()
|
| server_workgroup = server_workgroup.splitlines()[-1]
|
| regkey = r"HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
|
| cmd = "reg query %s /v Domain" % regkey
|
| - o = server_session.cmd_output(cmd).strip().splitlines()[-1]
|
| + o = server_session.get_command_output(cmd).strip().splitlines()[-1]
|
| try:
|
| server_dns_suffix = o.split(None, 2)[2]
|
| except IndexError:
|
| server_dns_suffix = ""
|
|
|
| # Delete the client machine from the server's data store (if it's there)
|
| - server_session.cmd("cd %s" % server_studio_path)
|
| + server_session.get_command_output("cd %s" % server_studio_path)
|
| cmd = "%s %s %s" % (os.path.basename(dsso_delete_machine_binary),
|
| server_name, client_name)
|
| - server_session.cmd(cmd, print_func=logging.info)
|
| + server_session.get_command_output(cmd, print_func=logging.info)
|
| server_session.close()
|
|
|
| # Rename the client machine
|
| @@ -84,18 +78,21 @@ def run_whql_client_install(test, params, env):
|
| logging.info("Renaming client machine to '%s'" % client_name)
|
| cmd = ('wmic computersystem where name="%%computername%%" rename name="%s"'
|
| % client_name)
|
| - session.cmd(cmd, timeout=600)
|
| + if session.get_command_status(cmd, timeout=600) != 0:
|
| + raise error.TestError("Could not rename the client machine")
|
|
|
| # Join the server's workgroup
|
| logging.info("Joining workgroup '%s'" % server_workgroup)
|
| cmd = ('wmic computersystem where name="%%computername%%" call '
|
| 'joindomainorworkgroup name="%s"' % server_workgroup)
|
| - session.cmd(cmd, timeout=600)
|
| + if session.get_command_status(cmd, timeout=600) != 0:
|
| + raise error.TestError("Could not change the client's workgroup")
|
|
|
| # Set the client machine's DNS suffix
|
| logging.info("Setting DNS suffix to '%s'" % server_dns_suffix)
|
| cmd = 'reg add %s /v Domain /d "%s" /f' % (regkey, server_dns_suffix)
|
| - session.cmd(cmd, timeout=300)
|
| + if session.get_command_status(cmd, timeout=300) != 0:
|
| + raise error.TestError("Could not set the client's DNS suffix")
|
|
|
| # Reboot
|
| session = kvm_test_utils.reboot(vm, session)
|
| @@ -106,11 +103,9 @@ def run_whql_client_install(test, params, env):
|
| server_password)
|
| end_time = time.time() + 120
|
| while time.time() < end_time:
|
| - try:
|
| - session.cmd(cmd)
|
| + s = session.get_command_status(cmd)
|
| + if s == 0:
|
| break
|
| - except:
|
| - pass
|
| time.sleep(5)
|
| else:
|
| raise error.TestError("Could not access server share from client "
|
| @@ -119,17 +114,7 @@ def run_whql_client_install(test, params, env):
|
| # Install
|
| logging.info("Installing DTM client (timeout=%ds)", install_timeout)
|
| install_cmd = r"cmd /c \\%s\%s" % (server_name, install_cmd.lstrip("\\"))
|
| - session.cmd(install_cmd, timeout=install_timeout)
|
| -
|
| - # Setup auto logon
|
| - logging.info("Setting up auto logon for user '%s'", client_username)
|
| - cmd = ('reg add '
|
| - '"HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\winlogon" '
|
| - '/v "%s" /d "%s" /t REG_SZ /f')
|
| - session.cmd(cmd % ("AutoAdminLogon", "1"))
|
| - session.cmd(cmd % ("DefaultUserName", client_username))
|
| - session.cmd(cmd % ("DefaultPassword", client_password))
|
| -
|
| - # Reboot one more time
|
| - session = kvm_test_utils.reboot(vm, session)
|
| + if session.get_command_status(install_cmd, timeout=install_timeout) != 0:
|
| + raise error.TestError("Client installation failed")
|
| +
|
| session.close()
|
|
|