OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 """ | 2 """ |
3 Program to help setup kvm test environment | 3 Program to help setup kvm test environment |
4 | 4 |
5 @copyright: Red Hat 2010 | 5 @copyright: Red Hat 2010 |
6 """ | 6 """ |
7 | 7 |
8 import os, sys, optparse, logging, shutil | 8 import os, sys, optparse, logging, shutil |
9 import common, kvm_utils | 9 import common, kvm_utils |
10 from autotest_lib.client.common_lib import logging_manager | 10 from autotest_lib.client.common_lib import logging_manager |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 setup_nfs = raw_input() | 61 setup_nfs = raw_input() |
62 if setup_nfs == 'y': | 62 if setup_nfs == 'y': |
63 logging.info("Exiting the script so you can setup the NFS mounts. " | 63 logging.info("Exiting the script so you can setup the NFS mounts. " |
64 "When you are done, re-run this script.") | 64 "When you are done, re-run this script.") |
65 sys.exit(0) | 65 sys.exit(0) |
66 | 66 |
67 logging.info("2 - Creating config files from samples (copy the default " | 67 logging.info("2 - Creating config files from samples (copy the default " |
68 "config samples to actual config files)") | 68 "config samples to actual config files)") |
69 kvm_test_dir = os.path.dirname(sys.modules[__name__].__file__) | 69 kvm_test_dir = os.path.dirname(sys.modules[__name__].__file__) |
70 kvm_test_dir = os.path.abspath(kvm_test_dir) | 70 kvm_test_dir = os.path.abspath(kvm_test_dir) |
71 config_file_list = ["address_pools.cfg", "build.cfg", "cdkeys.cfg", | 71 config_file_list = ["build.cfg", "cdkeys.cfg", "tests_base.cfg", |
72 "tests_base.cfg", "tests.cfg", "unittests.cfg"] | 72 "tests.cfg", "unittests.cfg"] |
73 for config_file in config_file_list: | 73 for config_file in config_file_list: |
74 src_file = os.path.join(kvm_test_dir, "%s.sample" % config_file) | 74 src_file = os.path.join(kvm_test_dir, "%s.sample" % config_file) |
75 dst_file = os.path.join(kvm_test_dir, config_file) | 75 dst_file = os.path.join(kvm_test_dir, config_file) |
76 if not os.path.isfile(dst_file): | 76 if not os.path.isfile(dst_file): |
77 logging.debug("Creating config file %s from sample", dst_file) | 77 logging.debug("Creating config file %s from sample", dst_file) |
78 shutil.copyfile(src_file, dst_file) | 78 shutil.copyfile(src_file, dst_file) |
79 else: | 79 else: |
80 logging.debug("Config file %s exists, not touching" % dst_file) | 80 logging.debug("Config file %s exists, not touching" % dst_file) |
81 | 81 |
82 logging.info("3 - Verifying iso (make sure we have the OS ISO needed for " | 82 logging.info("3 - Verifying iso (make sure we have the OS ISO needed for " |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 "(session 'Install Prerequisite packages')") | 124 "(session 'Install Prerequisite packages')") |
125 | 125 |
126 client_dir = os.path.abspath(os.path.join(kvm_test_dir, "..", "..")) | 126 client_dir = os.path.abspath(os.path.join(kvm_test_dir, "..", "..")) |
127 autotest_bin = os.path.join(client_dir, 'bin', 'autotest') | 127 autotest_bin = os.path.join(client_dir, 'bin', 'autotest') |
128 control_file = os.path.join(kvm_test_dir, 'control') | 128 control_file = os.path.join(kvm_test_dir, 'control') |
129 logging.info("When you are done fixing eventual warnings found, " | 129 logging.info("When you are done fixing eventual warnings found, " |
130 "you can run the kvm test using the command line AS ROOT:") | 130 "you can run the kvm test using the command line AS ROOT:") |
131 logging.info("%s --verbose %s", autotest_bin, control_file) | 131 logging.info("%s --verbose %s", autotest_bin, control_file) |
132 logging.info("You can also edit the test config files (see output of " | 132 logging.info("You can also edit the test config files (see output of " |
133 "step 2 for a list)") | 133 "step 2 for a list)") |
OLD | NEW |