Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: client/virt/tests/whql_client_install.py

Issue 6883246: Merge autotest upstream from @5318 ~ @5336 (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/virt/tests/vlan.py ('k') | client/virt/tests/whql_submission.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import logging, time, os 1 import logging, time, os
2 from autotest_lib.client.common_lib import error 2 from autotest_lib.client.common_lib import error
3 import kvm_test_utils, kvm_utils, rss_file_transfer 3 from autotest_lib.client.virt import virt_utils, virt_test_utils, rss_client
4 4
5 5
6 def run_whql_client_install(test, params, env): 6 def run_whql_client_install(test, params, env):
7 """ 7 """
8 WHQL DTM client installation: 8 WHQL DTM client installation:
9 1) Log into the guest (the client machine) and into a DTM server machine 9 1) Log into the guest (the client machine) and into a DTM server machine
10 2) Stop the DTM client service (wttsvc) on the client machine 10 2) Stop the DTM client service (wttsvc) on the client machine
11 3) Delete the client machine from the server's data store 11 3) Delete the client machine from the server's data store
12 4) Rename the client machine (give it a randomly generated name) 12 4) Rename the client machine (give it a randomly generated name)
13 5) Move the client machine into the server's workgroup 13 5) Move the client machine into the server's workgroup
(...skipping 16 matching lines...) Expand all
30 server_shell_port = int(params.get("server_shell_port")) 30 server_shell_port = int(params.get("server_shell_port"))
31 server_file_transfer_port = int(params.get("server_file_transfer_port")) 31 server_file_transfer_port = int(params.get("server_file_transfer_port"))
32 server_studio_path = params.get("server_studio_path", "%programfiles%\\ " 32 server_studio_path = params.get("server_studio_path", "%programfiles%\\ "
33 "Microsoft Driver Test Manager\\Studio") 33 "Microsoft Driver Test Manager\\Studio")
34 server_username = params.get("server_username") 34 server_username = params.get("server_username")
35 server_password = params.get("server_password") 35 server_password = params.get("server_password")
36 client_username = params.get("client_username") 36 client_username = params.get("client_username")
37 client_password = params.get("client_password") 37 client_password = params.get("client_password")
38 dsso_delete_machine_binary = params.get("dsso_delete_machine_binary", 38 dsso_delete_machine_binary = params.get("dsso_delete_machine_binary",
39 "deps/whql_delete_machine_15.exe") 39 "deps/whql_delete_machine_15.exe")
40 dsso_delete_machine_binary = kvm_utils.get_path(test.bindir, 40 dsso_delete_machine_binary = virt_utils.get_path(test.bindir,
41 dsso_delete_machine_binary) 41 dsso_delete_machine_binary)
42 install_timeout = float(params.get("install_timeout", 600)) 42 install_timeout = float(params.get("install_timeout", 600))
43 install_cmd = params.get("install_cmd") 43 install_cmd = params.get("install_cmd")
44 wtt_services = params.get("wtt_services") 44 wtt_services = params.get("wtt_services")
45 45
46 # Stop WTT service(s) on client 46 # Stop WTT service(s) on client
47 for svc in wtt_services.split(): 47 for svc in wtt_services.split():
48 kvm_test_utils.stop_windows_service(session, svc) 48 virt_test_utils.stop_windows_service(session, svc)
49 49
50 # Copy dsso_delete_machine_binary to server 50 # Copy dsso_delete_machine_binary to server
51 rss_file_transfer.upload(server_address, server_file_transfer_port, 51 rss_client.upload(server_address, server_file_transfer_port,
52 dsso_delete_machine_binary, server_studio_path, 52 dsso_delete_machine_binary, server_studio_path,
53 timeout=60) 53 timeout=60)
54 54
55 # Open a shell session with server 55 # Open a shell session with server
56 server_session = kvm_utils.remote_login("nc", server_address, 56 server_session = virt_utils.remote_login("nc", server_address,
57 server_shell_port, "", "", 57 server_shell_port, "", "",
58 session.prompt, session.linesep) 58 session.prompt, session.linesep)
59 server_session.set_status_test_command(session.status_test_command) 59 server_session.set_status_test_command(session.status_test_command)
60 60
61 # Get server and client information 61 # Get server and client information
62 cmd = "echo %computername%" 62 cmd = "echo %computername%"
63 server_name = server_session.cmd_output(cmd).strip() 63 server_name = server_session.cmd_output(cmd).strip()
64 client_name = session.cmd_output(cmd).strip() 64 client_name = session.cmd_output(cmd).strip()
65 cmd = "wmic computersystem get domain" 65 cmd = "wmic computersystem get domain"
66 server_workgroup = server_session.cmd_output(cmd).strip() 66 server_workgroup = server_session.cmd_output(cmd).strip()
67 server_workgroup = server_workgroup.splitlines()[-1] 67 server_workgroup = server_workgroup.splitlines()[-1]
68 regkey = r"HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" 68 regkey = r"HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
69 cmd = "reg query %s /v Domain" % regkey 69 cmd = "reg query %s /v Domain" % regkey
70 o = server_session.cmd_output(cmd).strip().splitlines()[-1] 70 o = server_session.cmd_output(cmd).strip().splitlines()[-1]
71 try: 71 try:
72 server_dns_suffix = o.split(None, 2)[2] 72 server_dns_suffix = o.split(None, 2)[2]
73 except IndexError: 73 except IndexError:
74 server_dns_suffix = "" 74 server_dns_suffix = ""
75 75
76 # Delete the client machine from the server's data store (if it's there) 76 # Delete the client machine from the server's data store (if it's there)
77 server_session.cmd("cd %s" % server_studio_path) 77 server_session.cmd("cd %s" % server_studio_path)
78 cmd = "%s %s %s" % (os.path.basename(dsso_delete_machine_binary), 78 cmd = "%s %s %s" % (os.path.basename(dsso_delete_machine_binary),
79 server_name, client_name) 79 server_name, client_name)
80 server_session.cmd(cmd, print_func=logging.info) 80 server_session.cmd(cmd, print_func=logging.info)
81 server_session.close() 81 server_session.close()
82 82
83 # Rename the client machine 83 # Rename the client machine
84 client_name = "autotest_%s" % kvm_utils.generate_random_string(4) 84 client_name = "autotest_%s" % virt_utils.generate_random_string(4)
85 logging.info("Renaming client machine to '%s'", client_name) 85 logging.info("Renaming client machine to '%s'", client_name)
86 cmd = ('wmic computersystem where name="%%computername%%" rename name="%s"' 86 cmd = ('wmic computersystem where name="%%computername%%" rename name="%s"'
87 % client_name) 87 % client_name)
88 session.cmd(cmd, timeout=600) 88 session.cmd(cmd, timeout=600)
89 89
90 # Join the server's workgroup 90 # Join the server's workgroup
91 logging.info("Joining workgroup '%s'", server_workgroup) 91 logging.info("Joining workgroup '%s'", server_workgroup)
92 cmd = ('wmic computersystem where name="%%computername%%" call ' 92 cmd = ('wmic computersystem where name="%%computername%%" call '
93 'joindomainorworkgroup name="%s"' % server_workgroup) 93 'joindomainorworkgroup name="%s"' % server_workgroup)
94 session.cmd(cmd, timeout=600) 94 session.cmd(cmd, timeout=600)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 cmd = ('reg add ' 127 cmd = ('reg add '
128 '"HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\winlogon" ' 128 '"HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\winlogon" '
129 '/v "%s" /d "%s" /t REG_SZ /f') 129 '/v "%s" /d "%s" /t REG_SZ /f')
130 session.cmd(cmd % ("AutoAdminLogon", "1")) 130 session.cmd(cmd % ("AutoAdminLogon", "1"))
131 session.cmd(cmd % ("DefaultUserName", client_username)) 131 session.cmd(cmd % ("DefaultUserName", client_username))
132 session.cmd(cmd % ("DefaultPassword", client_password)) 132 session.cmd(cmd % ("DefaultPassword", client_password))
133 133
134 # Reboot one more time 134 # Reboot one more time
135 session = vm.reboot(session) 135 session = vm.reboot(session)
136 session.close() 136 session.close()
OLDNEW
« no previous file with comments | « client/virt/tests/vlan.py ('k') | client/virt/tests/whql_submission.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698