Currently REG_SZ is incorrectly used if no dns suffix is set.
Signed-off-by: Michael Goldish <[email protected]>
---
client/tests/kvm/tests/whql_client_install.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/client/tests/kvm/tests/whql_client_install.py
b/client/tests/kvm/tests/whql_client_install.py
index d866df7..84b91bc 100644
--- a/client/tests/kvm/tests/whql_client_install.py
+++ b/client/tests/kvm/tests/whql_client_install.py
@@ -60,7 +60,11 @@ def run_whql_client_install(test, params, env):
server_workgroup = server_workgroup.splitlines()[-1]
regkey = r"HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
cmd = "reg query %s /v Domain" % regkey
- server_dns_suffix = server_session.get_command_output(cmd).split()[-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.get_command_output("cd %s" % server_studio_path)
@@ -86,7 +90,7 @@ def run_whql_client_install(test, params, env):
# 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)
+ cmd = 'reg add %s /v Domain /d "%s" /f' % (regkey, server_dns_suffix)
if session.get_command_status(cmd, timeout=300) != 0:
raise error.TestError("Could not set the client's DNS suffix")
--
1.5.5.6
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest