KVM test: DTM automation program for WHQL tests
RFC PATCH v2 1/5 KVM test: DTM automation program for WHQL tests
This C# program should run on a DTM/WHQL server. It's used by the whql_submission test to schedule and monitor device submission jobs.
Note: the binary is copied to the server at run time, so it doesn't need to be packaged in winutils.iso.
Changes from v1:
- Take a job filter regex from the user, and run only the jobs whose names match the regex. This is useful for running individual tests instead of whole submissions which can take many hours to run.
- When test execution completes set the client machine's state to Unsafe and then Reset.
- Instead of looking for the requested test device and failing immediately if it isn't found, allow up to 2 minutes for it to show up.
- Add the job ID of each job to the result list printed to stdout.
--- client/tests/kvm/deps/whql_submission_15.cs | 289 ++++++++++++++++++++++++++ client/tests/kvm/deps/whql_submission_15.exe | Bin 0 -> 10240 bytes 2 files changed, 289 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/deps/whql_submission_15.cs create mode 100644 client/tests/kvm/deps/whql_submission_15.exe
client/tests/kvm/deps/whql_submission_15.cs new file +289 -0
@@ -0,0 +1,289 @@ +// DTM submission automation program +// Author: Michael Goldish <[email protected]> +// Based on sample code by Microsoft. + +// Note: this program has only been tested with DTM version 1.5. +// It might fail to work with other versions, specifically because it uses +// a few undocumented methods/attributes. + +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using Microsoft.DistributedAutomation.DeviceSelection; +using Microsoft.DistributedAutomation.SqlDataStore; + +namespace automate0 +{ + class AutoJob + { + static int Main(string[] args) + { + if (args.Length != 5) + { + Console.WriteLine("Error: incorrect number of command line arguments"); + Console.WriteLine("Usage: {0} serverName clientName machinePoolName submissionName timeout", + System.Environment.GetCommandLineArgs()[0]); + return 1; + } + string serverName = args[0]; + string clientName = args[1]; + string machinePoolName = args[2]; + string submissionName = args[3]; + double timeout = Convert.ToDouble(args[4]); + + try + { + // Initialize DeviceScript and connect to data store + Console.WriteLine("Initializing DeviceScript object"); + DeviceScript script = new DeviceScript(); + Console.WriteLine("Connecting to data store"); + + script.ConnectToNamedDataStore(serverName); + + // Find client machine + IResourcePool rootPool = script.GetResourcePoolByName("$"); + Console.WriteLine("Looking for client machine '{0}'", clientName); + IResource machine = null; + while (true) + { + try + { + machine = rootPool.GetResourceByName(clientName); + } + catch (Exception e) + { + Console.WriteLine("Warning: " + e.Message); + } + // Make sure the machine is valid + if (machine != null && + machine.OperatingSystem != null && + machine.OperatingSystem.Length > 0 && + machine.ProcessorArchitecture != null && + machine.ProcessorArchitecture.Length > 0 && + machine.GetDevices().Length > 0) + break; + System.Threading.Thread.Sleep(1000); + } + Console.WriteLine("Client machine '{0}' found ({1}, {2})", + clientName, machine.OperatingSystem, machine.ProcessorArchitecture); + + // Create machine pool and add client machine to it + // (this must be done because jobs cannot be scheduled for machines in the + // default pool) + try + { + script.CreateResourcePool(machinePoolName, rootPool.ResourcePoolId); + } + catch (Exception e) + { + Console.WriteLine("Warning: " + e.Message); + } + IResourcePool newPool = script.GetResourcePoolByName(machinePoolName); + Console.WriteLine("Moving the client machine to pool '{0}'", machinePoolName); + machine.ChangeResourcePool(newPool); + + // Reset client machine + if (machine.Status != "Ready") + { + Console.WriteLine("Changing the client machine's status to 'Reset'"); + while (true) + { + try + { + machine = rootPool.GetResourceByName(clientName); + machine.ChangeResourceStatus("Unsafe"); + System.Threading.Thread.Sleep(5000); + machine.ChangeResourceStatus("Reset"); + break; + } + catch (Exception e) + { + Console.WriteLine("Warning: " + e.Message); + } + System.Threading.Thread.Sleep(5000); + } + Console.WriteLine("Waiting for client machine to be ready"); + while (machine.Status != "Ready") + { + try + { + machine = rootPool.GetResourceByName(clientName); + } + catch (Exception e) + { + Console.WriteLine("Warning: " + e.Message); + } + System.Threading.Thread.Sleep(1000); + } + } + Console.WriteLine("Client machine is ready"); + + // Get requested device regex and look for a matching device + Console.WriteLine("Device to test: "); + Regex deviceRegex = new Regex(Console.ReadLine(), RegexOptions.IgnoreCase); + Console.WriteLine("Looking for device '{0}'", deviceRegex); + IDevice device; + DateTime endTime = DateTime.Now.AddSeconds(120); + while (DateTime.Now < endTime) + { + machine = rootPool.GetResourceByName(clientName); + Console.WriteLine("(Client machine has {0} devices)", machine.GetDevices().Length); + foreach (IDevice d in machine.GetDevices()) + { + if (deviceRegex.IsMatch(d.FriendlyName)) + { + device = d; + goto deviceFound; + } + } + System.Threading.Thread.Sleep(5000); + } + Console.WriteLine("Error: device '{0}' not found", deviceRegex); + return 1; + + deviceFound: + Console.WriteLine("Found device '{0}'", device.FriendlyName); + + // Get requested jobs regex + Console.WriteLine("Jobs to run: "); + Regex jobRegex = new Regex(Console.ReadLine(), RegexOptions.IgnoreCase); + + // Create submission + Object[] existingSubmissions = script.GetSubmissionByName(submissionName); + if (existingSubmissions.Length > 0) + { + Console.WriteLine("Submission '{0}' already exists -- removing it", + submissionName); + script.DeleteSubmission(((ISubmission)existingSubmissions[0]).Id); + } + Console.WriteLine("Creating submission '{0}'", submissionName); + ISubmission submission = script.CreateHardwareSubmission(submissionName, + newPool.ResourcePoolId, device.InstanceId); + + // Get DeviceData objects from the user + List<Object> deviceDataList = new List<Object>(); + while (true) + { + ISubmissionDeviceData dd = script.CreateNewSubmissionDeviceData(); + Console.WriteLine("DeviceData name: "); + dd.Name = Console.ReadLine(); + if (dd.Name.Length == 0) + break; + Console.WriteLine("DeviceData data: "); + dd.Data = Console.ReadLine(); + deviceDataList.Add(dd); + } + + // Set the submission's DeviceData + submission.SetDeviceData(deviceDataList.ToArray()); + + // Get descriptors from the user + List<Object> descriptorList = new List<Object>(); + while (true) + { + Console.WriteLine("Descriptor path: "); + string descriptorPath = Console.ReadLine(); + if (descriptorPath.Length == 0) + break; + descriptorList.Add(script.GetDescriptorByPath(descriptorPath)); + } + + // Set the submission's descriptors + submission.SetLogoDescriptors(descriptorList.ToArray()); + + // Create a schedule + ISchedule schedule = script.CreateNewSchedule(); + Console.WriteLine("Scheduling jobs:"); + int jobCount = 0; + foreach (IJob j in submission.GetJobs()) + { + if (jobRegex.IsMatch(j.Name)) + { + Console.WriteLine(" " + j.Name); + schedule.AddDeviceJob(device, j); + jobCount++; + } + } + if (jobCount == 0) + { + Console.WriteLine("Error: no submission jobs match pattern '{0}'", jobRegex); + return 1; + } + schedule.AddSubmission(submission); + schedule.SetResourcePool(newPool); + script.RunSchedule(schedule); + + // Wait for jobs to complete + Console.WriteLine("Waiting for all jobs to complete (timeout={0})", timeout); + endTime = DateTime.Now.AddSeconds(timeout); + int numCompleted = 0, numFailed = 0; + while (numCompleted < submission.GetResults().Length && DateTime.Now < endTime) + { + // Sleep for 30 seconds + System.Threading.Thread.Sleep(30000); + // Count completed submission jobs + numCompleted = 0; + foreach (IResult r in submission.GetResults()) + if (r.ResultStatus != "InProgress") + numCompleted++; + // Report results in a Python readable format and count failed schedule jobs + // (submission jobs are a subset of schedule jobs) + Console.WriteLine(); + Console.WriteLine("---- ["); + numFailed = 0; + foreach (IResult r in schedule.GetResults()) + { + Console.WriteLine(" {"); + Console.WriteLine(" 'id': {0}, 'job': r'''{1}''',", r.Job.Id, r.Job.Name); + Console.WriteLine(" 'logs': r'''{0}''',", r.LogLocation); + if (r.ResultStatus != "InProgress") + Console.WriteLine(" 'report': r'''{0}''',", + submission.GetSubmissionResultReport(r)); + Console.WriteLine(" 'status': '{0}',", r.ResultStatus); + Console.WriteLine(" 'pass': {0}, 'fail': {1}, 'notrun': {2}, 'notapplicable': {3}", + r.Pass, r.Fail, r.NotRun, r.NotApplicable); + Console.WriteLine(" },"); + numFailed += r.Fail; + } + Console.WriteLine("] ----"); + } + Console.WriteLine(); + + // Cancel incomplete jobs + foreach (IResult r in schedule.GetResults()) + if (r.ResultStatus == "InProgress") + r.Cancel(); + + // Set the machine's status to Unsafe and then Reset + try + { + machine = rootPool.GetResourceByName(clientName); + machine.ChangeResourceStatus("Unsafe"); + System.Threading.Thread.Sleep(5000); + machine.ChangeResourceStatus("Reset"); + } + catch (Exception e) + { + Console.WriteLine("Warning: " + e.Message); + } + + // Report failures + if (numCompleted < submission.GetResults().Length) + Console.WriteLine("Some jobs did not complete on time."); + if (numFailed > 0) + Console.WriteLine("Some jobs failed."); + + if (numFailed > 0 || numCompleted < submission.GetResults().Length) + return 1; + + Console.WriteLine("All jobs completed."); + return 0; + } + catch (Exception e) + { + Console.WriteLine("Error: " + e.Message); + return 1; + } + } + } +}
client/tests/kvm/deps/whql_submission_15.exe new file binary +0 -0
Signature · 1 line
1.5.5.6
RFC PATCH v2 2/5 KVM test: DTM machine deletion tool for WHQL tests
This C# program should run on a DTM server. It's used by the whql_client_install test to delete the client machine from the server's data store (if listed there) prior to client installation. This seems to be necessary to prevent trouble during testing (like failure to contact the client machine).
Note: the binary is copied to the server at run time, so it doesn't need to be packaged in winutils.iso.
--- client/tests/kvm/deps/whql_delete_machine_15.cs | 82 ++++++++++++++++++++++ client/tests/kvm/deps/whql_delete_machine_15.exe | Bin 0 -> 5632 bytes 2 files changed, 82 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/deps/whql_delete_machine_15.cs create mode 100644 client/tests/kvm/deps/whql_delete_machine_15.exe
client/tests/kvm/deps/whql_delete_machine_15.cs new file +82 -0
@@ -0,0 +1,82 @@ +// DTM machine deletion tool +// Author: Michael Goldish <[email protected]> +// Based on sample code by Microsoft. + +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using Microsoft.DistributedAutomation.DeviceSelection; +using Microsoft.DistributedAutomation.SqlDataStore; + +namespace automate0 +{ + class AutoJob + { + static int Main(string[] args) + { + if (args.Length != 2) + { + Console.WriteLine("Error: incorrect number of command line arguments"); + Console.WriteLine("Usage: {0} serverName clientName", + System.Environment.GetCommandLineArgs()[0]); + return 1; + } + string serverName = args[0]; + string clientName = args[1]; + + try + { + // Initialize DeviceScript and connect to data store + Console.WriteLine("Initializing DeviceScript object"); + DeviceScript script = new DeviceScript(); + Console.WriteLine("Connecting to data store"); + script.ConnectToNamedDataStore(serverName); + + // Find the client machine + IResourcePool rootPool = script.GetResourcePoolByName("$"); + Console.WriteLine("Looking for client machine '{0}'", clientName); + IResource machine = rootPool.GetResourceByName(clientName); + if (machine == null) + { + Console.WriteLine("Client machine not found"); + return 0; + } + Console.WriteLine("Client machine '{0}' found ({1}, {2})", + clientName, machine.OperatingSystem, machine.ProcessorArchitecture); + + // Change the client machine's status to 'unsafe' + Console.WriteLine("Changing the client machine's status to 'Unsafe'"); + try + { + machine.ChangeResourceStatus("Unsafe"); + } + catch (Exception e) + { + Console.WriteLine("Warning: " + e.Message); + } + while (machine.Status != "Unsafe") + { + try + { + machine = rootPool.GetResourceByName(clientName); + } + catch (Exception e) + { + Console.WriteLine("Warning: " + e.Message); + } + System.Threading.Thread.Sleep(1000); + } + + // Delete the client machine from datastore + Console.WriteLine("Deleting client machine from data store"); + script.DeleteResource(machine.Id); + return 0; + } + catch (Exception e) + { + Console.WriteLine("Error: " + e.Message); + return 1; + } + } + } +}
client/tests/kvm/deps/whql_delete_machine_15.exe new file binary +0 -0
Signature · 1 line
1.5.5.6
RFC PATCH v2 3/5 KVM test: add whql_submission test
whql_submission runs a submission on a given device. It requires a functioning external DTM server which runs rss.exe like regular Windows VMs, preferably with administrator permissions.
The submission is defined by descriptors and device_data objects, which are specified in the config file(s). All jobs of the submission are executed. When all jobs complete, or when the timeout expires, HTML reports are generated and copied to test.debugdir (client/results/default/kvm...whql_submission/debug) and the raw test logs (wtl or xml files) are copied to test.debugdir as well.
Changes from v1:
- Send job_filter to the automation program to let it know which tests to allow. job_filter defaults to .*, which means all tests of the submission are run.
- Instead of determining test status by the 'pass', 'fail' and 'notrun' values, determine it by the 'status' string (e.g. 'Investigate', 'InProgress').
- Kill the client VM if the tests don't complete on time.
- In the final results summary display the job ID of each job.
--- client/tests/kvm/tests/whql_submission.py | 188 +++++++++++++++++++++++++++++ 1 files changed, 188 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/tests/whql_submission.py
client/tests/kvm/tests/whql_submission.py new file +188 -0
@@ -0,0 +1,188 @@ +import logging, time, os, re +from autotest_lib.client.common_lib import error +import kvm_subprocess, kvm_test_utils, kvm_utils, rss_file_transfer + + +def run_whql_submission(test, params, env): + """ + WHQL submission test: + 1) Log into the guest (the client machine) and into a DTM server machine + 2) Copy the automation program binary (dsso_test_binary) to the server machine + 3) Run the automation program + 4) Pass the program all relevant parameters (e.g. device_data) + 5) Wait for the program to terminate + 6) Parse and report job results + (logs and HTML reports are placed in test.bindir) + + @param test: kvm test object + @param params: Dictionary with the test parameters + @param env: Dictionary with test environment. + """ + vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + session = kvm_test_utils.wait_for_login(vm, 0, 240) + + # Collect parameters + server_address = params.get("server_address") + server_shell_port = int(params.get("server_shell_port")) + server_file_transfer_port = int(params.get("server_file_transfer_port")) + server_studio_path = params.get("server_studio_path", "%programfiles%\\ " + "Microsoft Driver Test Manager\\Studio") + dsso_test_binary = params.get("dsso_test_binary", + "deps/whql_submission_15.exe") + dsso_test_binary = kvm_utils.get_path(test.bindir, dsso_test_binary) + test_device = params.get("test_device") + job_filter = params.get("job_filter", ".*") + test_timeout = float(params.get("test_timeout", 600)) + wtt_services = params.get("wtt_services") + + # Restart WTT service(s) on the client + logging.info("Restarting WTT services on client") + for svc in wtt_services.split(): + kvm_test_utils.stop_windows_service(session, svc) + for svc in wtt_services.split(): + kvm_test_utils.start_windows_service(session, svc) + + # Copy dsso_test_binary to the server + rss_file_transfer.upload(server_address, server_file_transfer_port, + dsso_test_binary, server_studio_path, timeout=60) + + # Open a shell session with the server + server_session = kvm_utils.remote_login("nc", server_address, + server_shell_port, "", "", + session.prompt, session.linesep) + + # Get the computer names of the server and client + cmd = "echo %computername%" + server_name = server_session.get_command_output(cmd).strip() + client_name = session.get_command_output(cmd).strip() + session.close() + + # Run the automation program on the server + server_session.get_command_output("cd %s" % server_studio_path) + cmd = "%s %s %s %s %s %s" % (os.path.basename(dsso_test_binary), + server_name, + client_name, + "%s_pool" % client_name, + "%s_submission" % client_name, + test_timeout) + server_session.sendline(cmd) + + # Helper function: wait for a given prompt and raise an exception if an + # error occurs + def find_prompt(prompt): + m, o = server_session.read_until_last_line_matches( + [prompt, server_session.prompt], print_func=logging.info, + timeout=600) + if m != 0: + errors = re.findall("^Error:.*$", o, re.I | re.M) + if errors: + raise error.TestError(errors[0]) + else: + raise error.TestError("Error running automation program: could " + "not find '%s' prompt" % prompt) + + # Tell the automation program which device to test + find_prompt("Device to test:") + server_session.sendline(test_device) + + # Tell the automation program which jobs to run + find_prompt("Jobs to run:") + server_session.sendline(job_filter) + + # Give the automation program all the device data supplied by the user + find_prompt("DeviceData name:") + for dd in kvm_utils.get_sub_dict_names(params, "device_data"): + dd_params = kvm_utils.get_sub_dict(params, dd) + if dd_params.get("dd_name") and dd_params.get("dd_data"): + server_session.sendline(dd_params.get("dd_name")) + server_session.sendline(dd_params.get("dd_data")) + server_session.sendline() + + # Give the automation program all the descriptor information supplied by + # the user + find_prompt("Descriptor path:") + for desc in kvm_utils.get_sub_dict_names(params, "descriptors"): + desc_params = kvm_utils.get_sub_dict(params, desc) + if desc_params.get("desc_path"): + server_session.sendline(desc_params.get("desc_path")) + server_session.sendline() + + # Wait for the automation program to terminate + m, o = server_session.read_up_to_prompt(print_func=logging.info, + timeout=test_timeout + 300) + # (test_timeout + 300 is used here because the automation program is + # supposed to terminate cleanly on its own when test_timeout expires) + server_session.close() + + # Look for test results in the automation program's output + result_summaries = re.findall(r"---- \[.*?\] ----", o, re.DOTALL) + if not result_summaries: + raise error.TestError("The automation program did not return any " + "results") + results = result_summaries[-1].strip("-") + results = eval("".join(results.splitlines())) + + # Download logs and HTML reports from the server + for i, r in enumerate(results): + if "report" in r: + try: + rss_file_transfer.download(server_address, + server_file_transfer_port, + r["report"], test.debugdir) + except rss_file_transfer.FileTransferNotFoundError: + pass + if "logs" in r: + try: + rss_file_transfer.download(server_address, + server_file_transfer_port, + r["logs"], test.debugdir) + except rss_file_transfer.FileTransferNotFoundError: + pass + else: + try: + # Create symlinks to test log dirs to make it easier + # to access them (their original names are not human + # readable) + link_name = "logs_%s" % r["report"].split("\\")[-1] + link_name = link_name.replace(" ", "_") + link_name = link_name.replace("/", "_") + os.symlink(r["logs"].split("\\")[-1], + os.path.join(test.debugdir, link_name)) + except (KeyError, OSError): + pass + + # Print result summary + logging.info("") + logging.info("Result summary:") + name_length = max(len(r.get("job", "")) for r in results) + fmt = "%%-6s %%-%ds %%-15s %%-8s %%-8s %%-8s %%-15s" % name_length + logging.info(fmt % ("ID", "Job", "Status", "Pass", "Fail", "NotRun", + "NotApplicable")) + logging.info(fmt % ("--", "---", "------", "----", "----", "------", + "-------------")) + for r in results: + logging.info(fmt % (r.get("id"), r.get("job"), r.get("status"), + r.get("pass"), r.get("fail"), r.get("notrun"), + r.get("notapplicable"))) + logging.info("(see logs and HTML reports in %s)" % test.debugdir) + + # Kill the VM and fail if the automation program did not terminate on time + if not m: + vm.destroy() + raise error.TestFail("The automation program did not terminate " + "on time") + + # Fail if there are failed or incomplete jobs (kill the VM if there are + # incomplete jobs) + failed_jobs = [r.get("job") for r in results + if r.get("status", "").lower() == "investigate"] + running_jobs = [r.get("job") for r in results + if r.get("status", "").lower() == "inprogress"] + errors = [] + if failed_jobs: + errors += ["Jobs failed: %s." % failed_jobs] + if running_jobs: + vm.destroy() + errors += ["Jobs did not complete on time: %s." % running_jobs] + if errors: + raise error.TestFail(" ".join(errors))
Signature · 1 line
1.5.5.6
RFC PATCH v2 4/5 KVM test: add whql_client_install test
whql_client_install installs the DTM client on a guest. It requires a functioning external DTM server which runs rss.exe like regular Windows VMs.
--- client/tests/kvm/tests/whql_client_install.py | 110 +++++++++++++++++++++++++ 1 files changed, 110 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/tests/whql_client_install.py
client/tests/kvm/tests/whql_client_install.py new file +110 -0
@@ -0,0 +1,110 @@ +import logging, time, os, re +from autotest_lib.client.common_lib import error +import kvm_subprocess, kvm_test_utils, kvm_utils, rss_file_transfer + + +def run_whql_client_install(test, params, env): + """ + WHQL DTM client installation: + 1) Log into the guest (the client machine) and into a DTM server machine + 2) Stop the DTM client service (wttsvc) on the client machine + 3) Delete the client machine from the server's data store + 4) Rename the client machine (give it a randomly generated name) + 5) Move the client machine into the server's workgroup + 6) Reboot the client machine + 7) Install the DTM client software + + @param test: kvm test object + @param params: Dictionary with the test parameters + @param env: Dictionary with test environment. + """ + vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + session = kvm_test_utils.wait_for_login(vm, 0, 240) + + # Collect test params + server_address = params.get("server_address") + server_shell_port = int(params.get("server_shell_port")) + server_file_transfer_port = int(params.get("server_file_transfer_port")) + server_studio_path = params.get("server_studio_path", "%programfiles%\\ " + "Microsoft Driver Test Manager\\Studio") + server_username = params.get("server_username") + server_password = params.get("server_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, + dsso_delete_machine_binary) + install_timeout = float(params.get("install_timeout", 600)) + install_cmd = params.get("install_cmd") + wtt_services = params.get("wtt_services") + + # Stop WTT service(s) on client + for svc in wtt_services.split(): + kvm_test_utils.stop_windows_service(session, svc) + + # Copy dsso_delete_machine_binary to server + rss_file_transfer.upload(server_address, server_file_transfer_port, + dsso_delete_machine_binary, server_studio_path, + timeout=60) + + # Open a shell session with server + server_session = kvm_utils.remote_login("nc", server_address, + server_shell_port, "", "", + session.prompt, session.linesep) + + # Get server and client information + cmd = "echo %computername%" + server_name = server_session.get_command_output(cmd).strip() + client_name = session.get_command_output(cmd).strip() + cmd = "wmic computersystem get workgroup" + server_workgroup = server_session.get_command_output(cmd).strip() + + # Delete the client machine from the server's data store (if it's there) + 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.get_command_output(cmd, print_func=logging.info) + server_session.close() + + # Rename the client machine + client_name = "autotest_%s" % kvm_utils.generate_random_string(4) + logging.info("Renaming client machine to '%s'" % client_name) + cmd = ('wmic computersystem where name="%%computername%%" rename name="%s"' + % client_name) + s = session.get_command_status(cmd, timeout=600) + if s != 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) + s = session.get_command_status(cmd, timeout=600) + if s != 0: + raise error.TestError("Could not change the client's workgroup") + + # Reboot + session = kvm_test_utils.reboot(vm, session) + + # Access shared resources on the server machine + logging.info("Attempting to access remote share on server") + cmd = r"net use \\%s /user:%s %s" % (server_name, server_username, + server_password) + end_time = time.time() + 120 + while time.time() < end_time: + s = session.get_command_status(cmd) + if s == 0: + break + time.sleep(5) + else: + raise error.TestError("Could not access server share from client " + "machine") + + # Install + logging.info("Installing DTM client (timeout=%ds)", install_timeout) + install_cmd = r"cmd /c \\%s\%s" % (server_name, install_cmd.lstrip("\\")) + s, o = session.get_command_status_output(install_cmd, + timeout=install_timeout) + if s != 0: + raise error.TestError("Client installation failed") + + session.close()
Signature · 1 line
1.5.5.6
RFC PATCH v2 5/5 KVM test: add WHQL test definitions to tests_base.cfg.sample
The parameters that define submissions (dd_name_*, dd_data_*, desc_path_*) were collected from manually created submissions.
I haven't yet collected the parameters for Windows 2003 and 2008, so for now WHQL tests are disabled for these versions.
This patch also adds a comment in tests.cfg.sample, encouraging the user to specify the DTM server's address and ports there.
Note that this patch renames WinVista.32sp1 to WinVista.32.sp1,
WinVista.32sp2 to WinVista.32.sp2,
WinVista.64sp1 to WinVista.64.sp1 and
WinVista.64sp2 to WinVista.64.sp2.Changes from v1:
- Run all whql_submission tests with -snapshot
- Split whql_submission.hdd into 2 variants: a full one and one that only runs a single test (by setting job_filter). Running all tests in a HDD submission takes over 72 hours, so it probably can't be done routinely as part of our regression testing.
- Change test_device regex to "qemu harddisk" in whql_submission.hdd.
- Update timeouts
- Enable WHQL tests for Win2003
--- client/tests/kvm/tests.cfg.sample | 8 + client/tests/kvm/tests_base.cfg.sample | 251 +++++++++++++++++++++++++------- 2 files changed, 205 insertions(+), 54 deletions(-)
client/tests/kvm/tests.cfg.sample +8 -0
@@ -73,6 +73,14 @@ variants: only Fedora.13.64 only unattended_install.cdrom boot shutdown +# You may provide information about the DTM server for WHQL tests here: +#whql: +# server_address = 10.20.30.40 +# server_shell_port = 10022 +# server_file_transfer_port = 10023 +# Note that the DTM server must run rss.exe (available under deps/), +# preferably with administrator privileges. + # Uncomment the following lines to enable abort-on-error mode: #abort_on_error = yes #kill_vm.* ?= no
client/tests/kvm/tests_base.cfg.sample +197 -54
320 lines not on this page · raw message
Signature · 1 line
1.5.5.6
Re: [Autotest] [KVM-AUTOTEST PATCH v2 3/5] [RFC] KVM test: add whql_submission test
In reply to Michael GoldishQuoted 42 lines · Michael Goldish
whql_submissionruns a submission on a given device. It requires a functioning external DTM server which runs rss.exe like regular Windows VMs, preferably with administrator permissions.
The submission is defined by descriptors anddevice_dataobjects, which are specified in the config file(s). All jobs of the submission are executed. When all jobs complete, or when the timeout expires, HTML reports are generated and copied to test.debugdir (client/results/default/kvm...whql_submission/debug) and the raw test logs (wtl or xml files) are copied to test.debugdir as well.Changes from v1:
- Sendjob_filterto the automation program to let it know which tests to allow.job_filterdefaults to .*, which means all tests of the submission are run.
- Instead of determining test status by the 'pass', 'fail' and 'notrun' values, determine it by the 'status' string (e.g. 'Investigate', 'InProgress').
- Kill the client VM if the tests don't complete on time.
- In the final results summary display the job ID of each job.Signed-off-by Michael Goldish <[email protected]>--- client/tests/kvm/tests/whql_submission.py | 188 +++++++++++++++++++++++++++++ 1 files changed, 188 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/tests/whql_submission.pyclient/tests/kvm/tests/whql_submission.py new file +12
-0@@ -0,0 +1,188 @@ +import logging, time, os, re +from autotest_lib.client.common_lib import error +import kvm_subprocess, kvm_test_utils, kvm_utils, rss_file_transfer + + +def run_whql_submission(test, params, env): + """ + WHQL submission test: + 1) Log into the guest (the client machine) and into a DTM server machine + 2) Copy the automation program binary (dsso_test_binary) to the server machine + 3) Run the automation program + 4) Pass the program all relevant parameters (e.g. device_data)
client/tests/kvm/tests/whql_submission.py line 22
Quoted 10 lines
client/tests/kvm/tests/whql_submission.py new file +10
-0+ 5) Wait for the program to terminate + 6) Parse and report job results + (logs and HTML reports are placed in test.bindir) + + @param test: kvm test object + @param params: Dictionary with the test parameters + @param env: Dictionary with test environment. + """ + vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + session = kvm_test_utils.wait_for_login(vm, 0, 240)
Make the login timeout can be configured.
timeout = float(params.get("login_timeout", 240)) session = kvm_test_utils.wait_for_login(vm, 0, timeout, ..)
Quoted 20 lines
client/tests/kvm/tests/whql_submission.py new file +20
-0+ + # Collect parameters + server_address = params.get("server_address") + server_shell_port = int(params.get("server_shell_port")) + server_file_transfer_port = int(params.get("server_file_transfer_port")) + server_studio_path = params.get("server_studio_path", "%programfiles%\\ " + "Microsoft Driver Test Manager\\Studio") + dsso_test_binary = params.get("dsso_test_binary", + "deps/whql_submission_15.exe") + dsso_test_binary = kvm_utils.get_path(test.bindir, dsso_test_binary) + test_device = params.get("test_device") + job_filter = params.get("job_filter", ".*") + test_timeout = float(params.get("test_timeout", 600)) + wtt_services = params.get("wtt_services") + + # Restart WTT service(s) on the client + logging.info("Restarting WTT services on client") + for svc in wtt_services.split(): + kvm_test_utils.stop_windows_service(session, svc) + for svc in wtt_services.split():
client/tests/kvm/tests/whql_submission.py line 52
Quoted 10 lines
client/tests/kvm/tests/whql_submission.py new file +10
-0+ kvm_test_utils.start_windows_service(session, svc) + + # Copy dsso_test_binary to the server + rss_file_transfer.upload(server_address, server_file_transfer_port, + dsso_test_binary, server_studio_path, timeout=60) + + # Open a shell session with the server + server_session = kvm_utils.remote_login("nc", server_address, + server_shell_port, "", "", + session.prompt, session.linesep)
login_timeout issue
Quoted 36 lines
client/tests/kvm/tests/whql_submission.py new file +36
-0+ # Get the computer names of the server and client + cmd = "echo %computername%" + server_name = server_session.get_command_output(cmd).strip() + client_name = session.get_command_output(cmd).strip() + session.close() + + # Run the automation program on the server + server_session.get_command_output("cd %s" % server_studio_path) + cmd = "%s %s %s %s %s %s" % (os.path.basename(dsso_test_binary), + server_name, + client_name, + "%s_pool" % client_name, + "%s_submission" % client_name, + test_timeout) + server_session.sendline(cmd) + + # Helper function: wait for a given prompt and raise an exception if an + # error occurs + def find_prompt(prompt): + m, o = server_session.read_until_last_line_matches( + [prompt, server_session.prompt], print_func=logging.info, + timeout=600) + if m != 0: + errors = re.findall("^Error:.*$", o, re.I | re.M) + if errors: + raise error.TestError(errors[0]) + else: + raise error.TestError("Error running automation program: could " + "not find '%s' prompt" % prompt) + + # Tell the automation program which device to test + find_prompt("Device to test:") + server_session.sendline(test_device) + + # Tell the automation program which jobs to run + find_prompt("Jobs to run:")
client/tests/kvm/tests/whql_submission.py line 99
Quoted 10 lines
client/tests/kvm/tests/whql_submission.py new file +10
-0+ server_session.sendline(job_filter) + + # Give the automation program all the device data supplied by the user + find_prompt("DeviceData name:") + for dd in kvm_utils.get_sub_dict_names(params, "device_data"): + dd_params = kvm_utils.get_sub_dict(params, dd) + if dd_params.get("dd_name") and dd_params.get("dd_data"): + server_session.sendline(dd_params.get("dd_name")) + server_session.sendline(dd_params.get("dd_data")) + server_session.sendline()
What's the purpose of this sentence ?
Quoted 96 lines
client/tests/kvm/tests/whql_submission.py new file +89
-0+ + # Give the automation program all the descriptor information supplied by + # the user + find_prompt("Descriptor path:") + for desc in kvm_utils.get_sub_dict_names(params, "descriptors"): + desc_params = kvm_utils.get_sub_dict(params, desc) + if desc_params.get("desc_path"): + server_session.sendline(desc_params.get("desc_path")) + server_session.sendline() + + # Wait for the automation program to terminate + m, o = server_session.read_up_to_prompt(print_func=logging.info, + timeout=test_timeout + 300) + # (test_timeout + 300 is used here because the automation program is + # supposed to terminate cleanly on its own when test_timeout expires) + server_session.close() + + # Look for test results in the automation program's output + result_summaries = re.findall(r"---- \[.*?\] ----", o, re.DOTALL) + if not result_summaries: + raise error.TestError("The automation program did not return any " + "results") + results = result_summaries[-1].strip("-") + results = eval("".join(results.splitlines())) + + # Download logs and HTML reports from the server + for i, r in enumerate(results): + if "report" in r: + try: + rss_file_transfer.download(server_address, + server_file_transfer_port, + r["report"], test.debugdir) + except rss_file_transfer.FileTransferNotFoundError: + pass + if "logs" in r: + try: + rss_file_transfer.download(server_address, + server_file_transfer_port, + r["logs"], test.debugdir) + except rss_file_transfer.FileTransferNotFoundError: + pass + else: + try: + # Create symlinks to test log dirs to make it easier + # to access them (their original names are not human + # readable) + link_name = "logs_%s" % r["report"].split("\\")[-1] + link_name = link_name.replace(" ", "_") + link_name = link_name.replace("/", "_") + os.symlink(r["logs"].split("\\")[-1], + os.path.join(test.debugdir, link_name)) + except (KeyError, OSError): + pass + + # Print result summary + logging.info("") + logging.info("Result summary:") + name_length = max(len(r.get("job", "")) for r in results) + fmt = "%%-6s %%-%ds %%-15s %%-8s %%-8s %%-8s %%-15s" % name_length + logging.info(fmt % ("ID", "Job", "Status", "Pass", "Fail", "NotRun", + "NotApplicable")) + logging.info(fmt % ("--", "---", "------", "----", "----", "------", + "-------------")) + for r in results: + logging.info(fmt % (r.get("id"), r.get("job"), r.get("status"), + r.get("pass"), r.get("fail"), r.get("notrun"), + r.get("notapplicable"))) + logging.info("(see logs and HTML reports in %s)" % test.debugdir) + + # Kill the VM and fail if the automation program did not terminate on time + if not m: + vm.destroy() + raise error.TestFail("The automation program did not terminate " + "on time") + + # Fail if there are failed or incomplete jobs (kill the VM if there are + # incomplete jobs) + failed_jobs = [r.get("job") for r in results + if r.get("status", "").lower() == "investigate"] + running_jobs = [r.get("job") for r in results + if r.get("status", "").lower() == "inprogress"] + errors = [] + if failed_jobs: + errors += ["Jobs failed: %s." % failed_jobs] + if running_jobs: + vm.destroy() + errors += ["Jobs did not complete on time: %s." % running_jobs] + if errors: + raise error.TestFail(" ".join(errors))Signature · 6 lines
1.5.5.6 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
Re: [Autotest] [KVM-AUTOTEST PATCH v2 3/5] [RFC] KVM test: add whql_submission test
Quoted 56 lines · Amos Kong
Quoted 42 lines · Michael Goldish
whql_submissionruns a submission on a given device. It requires a functioning external DTM server which runs rss.exe like regular Windows VMs, preferably with administrator permissions.
The submission is defined by descriptors anddevice_dataobjects, which are specified in the config file(s). All jobs of the submission are executed. When all jobs complete, or when the timeout expires, HTML reports are generated and copied to test.debugdir (client/results/default/kvm...whql_submission/debug) and the raw test logs (wtl or xml files) are copied to test.debugdir as well.Changes from v1:
- Sendjob_filterto the automation program to let it know which tests to allow.job_filterdefaults to .*, which means all tests of the submission are run.
- Instead of determining test status by the 'pass', 'fail' and 'notrun' values, determine it by the 'status' string (e.g. 'Investigate', 'InProgress').
- Kill the client VM if the tests don't complete on time.
- In the final results summary display the job ID of each job.Signed-off-by Michael Goldish <[email protected]>--- client/tests/kvm/tests/whql_submission.py | 188 +++++++++++++++++++++++++++++ 1 files changed, 188 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/tests/whql_submission.pyclient/tests/kvm/tests/whql_submission.py new file +12
-0@@ -0,0 +1,188 @@ +import logging, time, os, re +from autotest_lib.client.common_lib import error +import kvm_subprocess, kvm_test_utils, kvm_utils, rss_file_transfer + + +def run_whql_submission(test, params, env): + """ + WHQL submission test: + 1) Log into the guest (the client machine) and into a DTM server machine + 2) Copy the automation program binary (dsso_test_binary) to the server machine + 3) Run the automation program + 4) Pass the program all relevant parameters (e.g. device_data)client/tests/kvm/tests/whql_submission.py line 22
Quoted 10 lines
client/tests/kvm/tests/whql_submission.py new file +10
-0+ 5) Wait for the program to terminate + 6) Parse and report job results + (logs and HTML reports are placed in test.bindir) + + @param test: kvm test object + @param params: Dictionary with the test parameters + @param env: Dictionary with test environment. + """ + vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + session = kvm_test_utils.wait_for_login(vm, 0, 240)Make the login timeout can be configured.
Quoted 2 lines
timeout =
float(params.get("login_timeout", 240))session =kvm_test_utils.wait_for_login(vm, 0, timeout, ..)
I agree, will fix that.
Quoted 24 lines
Quoted 24 lines
client/tests/kvm/tests/whql_submission.py new file +24
-0+ + # Collect parameters + server_address = params.get("server_address") + server_shell_port = int(params.get("server_shell_port")) + server_file_transfer_port = int(params.get("server_file_transfer_port")) + server_studio_path = params.get("server_studio_path", "%programfiles%\\ " + "Microsoft Driver Test Manager\\Studio") + dsso_test_binary = params.get("dsso_test_binary", + "deps/whql_submission_15.exe") + dsso_test_binary = kvm_utils.get_path(test.bindir, dsso_test_binary) + test_device = params.get("test_device") + job_filter = params.get("job_filter", ".*") + test_timeout = float(params.get("test_timeout", 600)) + wtt_services = params.get("wtt_services") + + # Restart WTT service(s) on the client + logging.info("Restarting WTT services on client") + for svc in wtt_services.split(): + kvm_test_utils.stop_windows_service(session, svc) + for svc in wtt_services.split(): + kvm_test_utils.start_windows_service(session, svc) + + # Copy dsso_test_binary to the server + rss_file_transfer.upload(server_address, server_file_transfer_port,
Quoted 8 lines
client/tests/kvm/tests/whql_submission.py line 52
Quoted 6 lines
client/tests/kvm/tests/whql_submission.py new file +6
-0+ dsso_test_binary, server_studio_path, timeout=60) + + # Open a shell session with the server + server_session = kvm_utils.remote_login("nc", server_address, + server_shell_port, "", "", + session.prompt, session.linesep)
login_timeoutissue
It's a session with an external server, not an autotest VM, and I think it's fair to expect the server to be up and running during testing. 10 seconds (the default) should be more than enough for the server to reply, but still, if you think it's necessary, I can make this timeout configurable.
Quoted 40 lines
Quoted 40 lines
client/tests/kvm/tests/whql_submission.py new file +40
-0+ # Get the computer names of the server and client + cmd = "echo %computername%" + server_name = server_session.get_command_output(cmd).strip() + client_name = session.get_command_output(cmd).strip() + session.close() + + # Run the automation program on the server + server_session.get_command_output("cd %s" % server_studio_path) + cmd = "%s %s %s %s %s %s" % (os.path.basename(dsso_test_binary), + server_name, + client_name, + "%s_pool" % client_name, + "%s_submission" % client_name, + test_timeout) + server_session.sendline(cmd) + + # Helper function: wait for a given prompt and raise an exception if an + # error occurs + def find_prompt(prompt): + m, o = server_session.read_until_last_line_matches( + [prompt, server_session.prompt], print_func=logging.info, + timeout=600) + if m != 0: + errors = re.findall("^Error:.*$", o, re.I | re.M) + if errors: + raise error.TestError(errors[0]) + else: + raise error.TestError("Error running automation program: could " + "not find '%s' prompt" % prompt) + + # Tell the automation program which device to test + find_prompt("Device to test:") + server_session.sendline(test_device) + + # Tell the automation program which jobs to run + find_prompt("Jobs to run:") + server_session.sendline(job_filter) + + # Give the automation program all the device data supplied by the user + find_prompt("DeviceData name:")
Quoted 8 lines
client/tests/kvm/tests/whql_submission.py line 99
Quoted 6 lines
client/tests/kvm/tests/whql_submission.py new file +6
-0+ for dd in kvm_utils.get_sub_dict_names(params, "device_data"): + dd_params = kvm_utils.get_sub_dict(params, dd) + if dd_params.get("dd_name") and dd_params.get("dd_data"): + server_session.sendline(dd_params.get("dd_name")) + server_session.sendline(dd_params.get("dd_data")) + server_session.sendline()What's the purpose of this sentence ?
If you mean the empty sendline(), it tells the automation program that we're done specifying DeviceData objects.
Quoted 9 lines
client/tests/kvm/tests/whql_submission.py line 108
Quoted 9 lines
client/tests/kvm/tests/whql_submission.py new file +9
-0+ + # Give the automation program all the descriptor information supplied by + # the user + find_prompt("Descriptor path:") + for desc in kvm_utils.get_sub_dict_names(params, "descriptors"): + desc_params = kvm_utils.get_sub_dict(params, desc) + if desc_params.get("desc_path"): + server_session.sendline(desc_params.get("desc_path")) + server_session.sendline()
Same here: this tells the program we're done with descriptors.
Quoted 90 lines
Quoted 86 lines
client/tests/kvm/tests/whql_submission.py new file +79
-0+ # Wait for the automation program to terminate + m, o = server_session.read_up_to_prompt(print_func=logging.info, + timeout=test_timeout + 300) + # (test_timeout + 300 is used here because the automation program is + # supposed to terminate cleanly on its own when test_timeout expires) + server_session.close() + + # Look for test results in the automation program's output + result_summaries = re.findall(r"---- \[.*?\] ----", o, re.DOTALL) + if not result_summaries: + raise error.TestError("The automation program did not return any " + "results") + results = result_summaries[-1].strip("-") + results = eval("".join(results.splitlines())) + + # Download logs and HTML reports from the server + for i, r in enumerate(results): + if "report" in r: + try: + rss_file_transfer.download(server_address, + server_file_transfer_port, + r["report"], test.debugdir) + except rss_file_transfer.FileTransferNotFoundError: + pass + if "logs" in r: + try: + rss_file_transfer.download(server_address, + server_file_transfer_port, + r["logs"], test.debugdir) + except rss_file_transfer.FileTransferNotFoundError: + pass + else: + try: + # Create symlinks to test log dirs to make it easier + # to access them (their original names are not human + # readable) + link_name = "logs_%s" % r["report"].split("\\")[-1] + link_name = link_name.replace(" ", "_") + link_name = link_name.replace("/", "_") + os.symlink(r["logs"].split("\\")[-1], + os.path.join(test.debugdir, link_name)) + except (KeyError, OSError): + pass + + # Print result summary + logging.info("") + logging.info("Result summary:") + name_length = max(len(r.get("job", "")) for r in results) + fmt = "%%-6s %%-%ds %%-15s %%-8s %%-8s %%-8s %%-15s" % name_length + logging.info(fmt % ("ID", "Job", "Status", "Pass", "Fail", "NotRun", + "NotApplicable")) + logging.info(fmt % ("--", "---", "------", "----", "----", "------", + "-------------")) + for r in results: + logging.info(fmt % (r.get("id"), r.get("job"), r.get("status"), + r.get("pass"), r.get("fail"), r.get("notrun"), + r.get("notapplicable"))) + logging.info("(see logs and HTML reports in %s)" % test.debugdir) + + # Kill the VM and fail if the automation program did not terminate on time + if not m: + vm.destroy() + raise error.TestFail("The automation program did not terminate " + "on time") + + # Fail if there are failed or incomplete jobs (kill the VM if there are + # incomplete jobs) + failed_jobs = [r.get("job") for r in results + if r.get("status", "").lower() == "investigate"] + running_jobs = [r.get("job") for r in results + if r.get("status", "").lower() == "inprogress"] + errors = [] + if failed_jobs: + errors += ["Jobs failed: %s." % failed_jobs] + if running_jobs: + vm.destroy() + errors += ["Jobs did not complete on time: %s." % running_jobs] + if errors: + raise error.TestFail(" ".join(errors))Signature · 6 lines
1.5.5.6 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [Autotest] [KVM-AUTOTEST PATCH v2 5/5] [RFC] KVM test: add WHQL test definitions to tests_base.cfg.sample
In reply to Michael GoldishQuoted 105 lines · Michael Goldish
The parameters that define submissions (dd_name_*, dd_data_*, desc_path_*) were collected from manually created submissions.
I haven't yet collected the parameters for Windows 2003 and 2008, so for now WHQL tests are disabled for these versions.This patch also adds a comment in tests.cfg.sample, encouraging the user to specify the DTM server's address and ports there.
Note that this patch renames WinVista.32sp1 to WinVista.32.sp1,
WinVista.32sp2 to WinVista.32.sp2, WinVista.64sp1 to WinVista.64.sp1 and WinVista.64sp2 to WinVista.64.sp2.Changes from v1:
- Run allwhql_submissiontests with -snapshot
- Split whql_submission.hdd into 2 variants: a full one and one that only runs a single test (by settingjob_filter). Running all tests in a HDD submission takes over 72 hours, so it probably can't be done routinely as part of our regression testing.
- Changetest_deviceregex to "qemu harddisk" in whql_submission.hdd.
- Update timeouts
- Enable WHQL tests for Win2003Signed-off-by Michael Goldish <[email protected]>--- client/tests/kvm/tests.cfg.sample | 8 + client/tests/kvm/tests_base.cfg.sample | 251 +++++++++++++++++++++++++------- 2 files changed, 205 insertions(+), 54 deletions(-)client/tests/kvm/tests.cfg.sample +8
-0@@ -73,6 +73,14 @@ variants: only Fedora.13.64 only unattended_install.cdrom boot shutdown +# You may provide information about the DTM server for WHQL tests here: +#whql: +# server_address = 10.20.30.40 +# server_shell_port = 10022 +# server_file_transfer_port = 10023 +# Note that the DTM server must run rss.exe (available under deps/), +# preferably with administrator privileges. + # Uncomment the following lines to enable abort-on-error mode: #abort_on_error = yes #kill_vm.* ?= noclient/tests/kvm/tests_base.cfg.sample +49
-0@@ -285,6 +285,90 @@ variants: iozone_cmd = "D:\IOzone\iozone.exe -a" iozone_timeout = 3600 + - @whql: install setup unattended_install.cdrom + nic_mode = tap + # Replace this with the address of an installed DTM server + server_address = 10.20.30.40 + # The server should run rss.exe like a regular Windows VM, preferably + # with administrator privileges (or at least with permission to write + # to the DTM studio directory) + server_shell_port = 10022 + server_file_transfer_port = 10023 + server_studio_path = %programfiles%\Microsoft Driver Test Manager\Studio + wtt_services = wttsvc + variants: + - whql_client_install: + type = whql_client_install + dsso_delete_machine_binary = deps/whql_delete_machine_15.exe + # The username and password are required for accessing the DTM client + # installer binary shared by the server + server_username = administrator + server_password = 1q2w3eP + # This path refers to a shared directory on the server + # (the final cmd will be something like \\servername\DTMInstall\...) + install_cmd = \DTMInstall\Client\Setup.exe /passive + install_timeout = 3600 + - whql_submission: whql_client_install + type = whql_submission + extra_params += " -snapshot" + dsso_test_binary = deps/whql_submission_15.exe + test_timeout = 3600 + device_data = cat0 cat1 cat2 cat3 logoarch logoos whqlos whqlqual prog desc filter virt + descriptors = desc1 desc2 desc3 + # DeviceData names + dd_name_cat0 = Category + dd_name_cat1 = Category + dd_name_cat2 = Category + dd_name_cat3 = Category + dd_name_logoarch = LogoProcessorArchitecture + dd_name_logoos = LogoOperatingSystem + dd_name_whqlos = WhqlOs + dd_name_whqlqual = WhqlQualification + dd_name_prog = LogoProgramId + dd_name_desc = LogoProgramDescription + dd_name_filter = WDKFilterAttribute + dd_name_virt = ParaVirtualizationDriver + # Common DeviceData data + dd_data_filter = FilterIfNoInf + dd_data_virt = True + variants: + - keyboard: + # test_device is a regular expression that should match a device's
client/tests/kvm/tests_base.cfg.sample variants: · line 346
Quoted 10 lines
client/tests/kvm/tests_base.cfg.sample +10
-0+ # name as it appears in device manager. The first device that matches + # is used. + test_device = keyboard + # Set timeout to 10 hours + test_timeout = 36000 + dd_data_cat0 = Input\Keyboard + dd_data_cat1 = Device Fundamentals + dd_data_cat2 = System Fundamentals\Dynamic Partitioning + dd_data_prog = InputKbd + dd_data_desc = Input > Keyboard
Hello Lucas and Michael,
We have tested whql related patches in our localhost, it seems the env preparation, tasks allocation and result collection are all good.
As you know, whql tests always take too much time, so we need to classify all the tests, and add some variants in configuration. Do you have some plan about add other tests ? or reserve this work to user :) ?
Which tests could not be executed ( manual tests / not related with kvm, virtualization, ...) ? Which tests are basic function test ?
Which tests take more than $n hours ?
....
How about split the whql configuration to a singel file, whql_test.cfg.sample ?
Regards,
Amos
Quoted 25 lines
client/tests/kvm/tests_base.cfg.sample +25
-0+ - hdd: + test_device = qemu harddisk + device_data += " ex0 ex1 ex2 ex3" + dd_data_cat0 = Storage\Device Class\Disk\Disk + dd_data_cat1 = Storage\Device Class\Disk\Fixed + dd_data_cat2 = Storage\Device Class\Disk\Bus\ATA + dd_data_cat3 = Device Fundamentals + dd_data_prog = StorHDD + dd_data_desc = Storage > Hard Disk Drive (HDD) + dd_name_ex0 = Storage_bus_type + dd_data_ex0 = ATA/ATAPI + dd_name_ex1 = Hybrid_HDD_Support + dd_data_ex1 = 0 + dd_name_ex2 = Non_Rotating_Media + dd_data_ex2 = 0 + dd_name_ex3 = Secure_Storage + dd_data_ex3 = 0 + variants: + - full: + # Yes, 100 hours, this is not a mistake + test_timeout = 360000 + - syscache_test: + job_filter = syscache test + test_timeout = 7200 +