OLD | NEW |
1 """ | 1 """ |
2 KVM test utility functions. | 2 KVM test utility functions. |
3 | 3 |
4 @copyright: 2008-2009 Red Hat Inc. | 4 @copyright: 2008-2009 Red Hat Inc. |
5 """ | 5 """ |
6 | 6 |
7 import time, string, random, socket, os, signal, re, logging, commands, cPickle | 7 import time, string, random, socket, os, signal, re, logging, commands, cPickle |
8 import fcntl, shelve, ConfigParser, rss_file_transfer, threading, sys, UserDict | 8 import fcntl, shelve, ConfigParser, rss_file_transfer, threading, sys, UserDict |
9 from autotest_lib.client.bin import utils, os_dep | 9 from autotest_lib.client.bin import utils, os_dep |
10 from autotest_lib.client.common_lib import error, logging_config | 10 from autotest_lib.client.common_lib import error, logging_config |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 | 1077 |
1078 @param hash_path: Local path to a hash file. | 1078 @param hash_path: Local path to a hash file. |
1079 @param cd_image: Basename of a CD image | 1079 @param cd_image: Basename of a CD image |
1080 """ | 1080 """ |
1081 hash_file = open(hash_path, 'r') | 1081 hash_file = open(hash_path, 'r') |
1082 for line in hash_file.readlines(): | 1082 for line in hash_file.readlines(): |
1083 if dvd_basename in line: | 1083 if dvd_basename in line: |
1084 return line.split()[0] | 1084 return line.split()[0] |
1085 | 1085 |
1086 | 1086 |
1087 def run_tests(test_list, job): | 1087 def run_tests(parser, job): |
1088 """ | 1088 """ |
1089 Runs the sequence of KVM tests based on the list of dictionaries | 1089 Runs the sequence of KVM tests based on the list of dictionaries |
1090 generated by the configuration system, handling dependencies. | 1090 generated by the configuration system, handling dependencies. |
1091 | 1091 |
1092 @param test_list: List with all dictionary test parameters. | 1092 @param parser: Config parser object. |
1093 @param job: Autotest job object. | 1093 @param job: Autotest job object. |
1094 | 1094 |
1095 @return: True, if all tests ran passed, False if any of them failed. | 1095 @return: True, if all tests ran passed, False if any of them failed. |
1096 """ | 1096 """ |
| 1097 for i, d in enumerate(parser.get_dicts()): |
| 1098 logging.info("Test %4d: %s" % (i + 1, d["shortname"])) |
| 1099 |
1097 status_dict = {} | 1100 status_dict = {} |
1098 failed = False | 1101 failed = False |
1099 | 1102 |
1100 for dict in test_list: | 1103 for dict in parser.get_dicts(): |
1101 if dict.get("skip") == "yes": | 1104 if dict.get("skip") == "yes": |
1102 continue | 1105 continue |
1103 dependencies_satisfied = True | 1106 dependencies_satisfied = True |
1104 for dep in dict.get("dep"): | 1107 for dep in dict.get("dep"): |
1105 for test_name in status_dict.keys(): | 1108 for test_name in status_dict.keys(): |
1106 if not dep in test_name: | 1109 if not dep in test_name: |
1107 continue | 1110 continue |
1108 if not status_dict[test_name]: | 1111 if not status_dict[test_name]: |
1109 dependencies_satisfied = False | 1112 dependencies_satisfied = False |
1110 break | 1113 break |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1716 return False | 1719 return False |
1717 | 1720 |
1718 logging.debug("Verify the mount through /etc/mtab") | 1721 logging.debug("Verify the mount through /etc/mtab") |
1719 if mount_string in file("/etc/mtab").read(): | 1722 if mount_string in file("/etc/mtab").read(): |
1720 logging.debug("%s is successfully mounted", src) | 1723 logging.debug("%s is successfully mounted", src) |
1721 return True | 1724 return True |
1722 else: | 1725 else: |
1723 logging.error("Can't find mounted NFS share - /etc/mtab contents \n%s", | 1726 logging.error("Can't find mounted NFS share - /etc/mtab contents \n%s", |
1724 file("/etc/mtab").read()) | 1727 file("/etc/mtab").read()) |
1725 return False | 1728 return False |
OLD | NEW |