OLD | NEW |
1 AUTHOR = """ | 1 AUTHOR = """ |
2 uril@redhat.com (Uri Lublin) | 2 uril@redhat.com (Uri Lublin) |
3 drusso@redhat.com (Dror Russo) | 3 drusso@redhat.com (Dror Russo) |
4 mgoldish@redhat.com (Michael Goldish) | 4 mgoldish@redhat.com (Michael Goldish) |
5 dhuff@redhat.com (David Huff) | 5 dhuff@redhat.com (David Huff) |
6 aeromenk@redhat.com (Alexey Eromenko) | 6 aeromenk@redhat.com (Alexey Eromenko) |
7 mburns@redhat.com (Mike Burns) | 7 mburns@redhat.com (Mike Burns) |
8 """ | 8 """ |
9 TIME = 'MEDIUM' | 9 TIME = 'MEDIUM' |
10 NAME = 'KVM test' | 10 NAME = 'KVM test' |
11 TEST_TYPE = 'client' | 11 TEST_TYPE = 'client' |
12 TEST_CLASS = 'Virtualization' | 12 TEST_CLASS = 'Virtualization' |
13 TEST_CATEGORY = 'Functional' | 13 TEST_CATEGORY = 'Functional' |
14 | 14 |
15 DOC = """ | 15 DOC = """ |
16 Executes the KVM test framework on a given host. This module is separated in | 16 Executes the KVM test framework on a given host. This module is separated in |
17 minor functions, that execute different tests for doing Quality Assurance on | 17 minor functions, that execute different tests for doing Quality Assurance on |
18 KVM (both kernelspace and userspace) code. | 18 KVM (both kernelspace and userspace) code. |
19 | 19 |
20 For online docs, please refer to http://www.linux-kvm.org/page/KVM-Autotest | 20 For online docs, please refer to http://www.linux-kvm.org/page/KVM-Autotest |
21 """ | 21 """ |
22 | 22 |
23 import sys, os, logging | 23 import sys, os, logging |
24 # Add the KVM tests dir to the python path | 24 from autotest_lib.client.common_lib import cartesian_config |
25 kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm') | 25 from autotest_lib.client.virt import virt_utils |
26 sys.path.append(kvm_test_dir) | |
27 # Now we can import modules inside the KVM tests dir | |
28 import kvm_utils, kvm_config | |
29 | 26 |
30 # set English environment (command output might be localized, need to be safe) | 27 # set English environment (command output might be localized, need to be safe) |
31 os.environ['LANG'] = 'en_US.UTF-8' | 28 os.environ['LANG'] = 'en_US.UTF-8' |
32 | 29 |
33 str = """ | 30 str = """ |
34 # This string will be parsed after build.cfg. Make any desired changes to the | 31 # This string will be parsed after build.cfg. Make any desired changes to the |
35 # build configuration here. For example: | 32 # build configuration here. For example: |
36 #release_tag = 84 | 33 #release_tag = 84 |
37 """ | 34 """ |
38 | 35 |
39 parser = kvm_config.Parser() | 36 parser = cartesian_config.Parser() |
| 37 kvm_test_dir = os.path.join(os.environ['AUTODIR'],'tests/kvm') |
40 parser.parse_file(os.path.join(kvm_test_dir, "build.cfg")) | 38 parser.parse_file(os.path.join(kvm_test_dir, "build.cfg")) |
41 parser.parse_string(str) | 39 parser.parse_string(str) |
42 if not kvm_utils.run_tests(parser, job): | 40 if not virt_utils.run_tests(parser, job): |
43 logging.error("KVM build step failed, exiting.") | 41 logging.error("KVM build step failed, exiting.") |
44 sys.exit(1) | 42 sys.exit(1) |
45 | 43 |
46 str = """ | 44 str = """ |
47 # This string will be parsed after tests.cfg. Make any desired changes to the | 45 # This string will be parsed after tests.cfg. Make any desired changes to the |
48 # test configuration here. For example: | 46 # test configuration here. For example: |
49 #display = sdl | 47 #display = sdl |
50 #install, setup: timeout_multiplier = 3 | 48 #install, setup: timeout_multiplier = 3 |
51 """ | 49 """ |
52 | 50 |
53 parser = kvm_config.Parser() | 51 parser = cartesian_config.Parser() |
54 parser.parse_file(os.path.join(kvm_test_dir, "tests.cfg")) | 52 parser.parse_file(os.path.join(kvm_test_dir, "tests.cfg")) |
55 | 53 |
56 if args: | 54 if args: |
57 # We get test parameters from command line | 55 # We get test parameters from command line |
58 for arg in args: | 56 for arg in args: |
59 try: | 57 try: |
60 (key, value) = re.findall("(.*)=(.*)", arg)[0] | 58 (key, value) = re.findall("(.*)=(.*)", arg)[0] |
61 if key == "only": | 59 if key == "only": |
62 str += "only %s\n" % value | 60 str += "only %s\n" % value |
63 elif key == "no": | 61 elif key == "no": |
64 str += "no %s\n" % value | 62 str += "no %s\n" % value |
65 else: | 63 else: |
66 str += "%s = %s\n" % (key, value) | 64 str += "%s = %s\n" % (key, value) |
67 except IndexError: | 65 except IndexError: |
68 pass | 66 pass |
69 parser.parse_string(str) | 67 parser.parse_string(str) |
70 | 68 |
71 kvm_utils.run_tests(parser, job) | 69 virt_utils.run_tests(parser, job) |
72 | 70 |
73 # Generate a nice HTML report inside the job's results dir | 71 # Generate a nice HTML report inside the job's results dir |
74 kvm_utils.create_report(kvm_test_dir, job.resultdir) | 72 virt_utils.create_report(kvm_test_dir, job.resultdir) |
OLD | NEW |