def get_results_summary(guest_autotest_path): """ Get the status of the tests that were executed on the host and close the session where autotest was being executed. """ session.cmd("cd %s" % guest_autotest_path) output = session.cmd_output("cat results/*/status") try: results = scan_results.parse_results(output) # Report test results logging.info("Results (test, status, duration, info):") for result in results: logging.info(str(result)) session.close() return results except Exception, e: logging.error("Error processing guest autotest results: %s", e) return None
base_dir = os.path.join(outputdir, "guest_autotest_results") status_paths = glob.glob(os.path.join(base_dir, "*/status")) # for control files that do not use job.run_test() status_no_job = os.path.join(base_dir, "status") if os.path.exists(status_no_job): status_paths.append(status_no_job) status_path = " ".join(status_paths) try: output = utils.system_output("cat %s" % status_path) except error.CmdError, e: logging.error("Error getting guest autotest status file: %s", e) return None try: results = scan_results.parse_results(output) # Report test results logging.info("Results (test, status, duration, info):") for result in results: logging.info("\t %s", str(result)) return results except Exception, e: logging.error("Error processing guest autotest results: %s", e) return None def config_control(control_path): """ Edit the control file to adapt the current environment. Replace CLIENTIP with guestip, and replace SERVERIP with hostip.
base_dir = os.path.join(outputdir, "guest_autotest_results") status_paths = glob.glob(os.path.join(base_dir, "*/status")) # for control files that do not use job.run_test() status_no_job = os.path.join(base_dir, "status") if os.path.exists(status_no_job): status_paths.append(status_no_job) status_path = " ".join(status_paths) try: output = utils.system_output("cat %s" % status_path) except error.CmdError, e: logging.error("Error getting guest autotest status file: %s", e) return None try: results = scan_results.parse_results(output) # Report test results logging.info("Results (test, status, duration, info):") for result in results: logging.info("\t %s", str(result)) return results except Exception, e: logging.error("Error processing guest autotest results: %s", e) return None if not os.path.isfile(control_path): raise error.TestError("Invalid path to autotest control file: %s" % control_path) migrate_background = params.get("migrate_background") == "yes" if migrate_background: