提交 2149f347 编写于 作者: L Lucas Meneghel Rodrigues

Merge pull request #1301 from autotest/new-options

New options
......@@ -55,7 +55,7 @@ Execute the bootstrap script
Let's say you're interested in the qemu tests:
qemu/get_started.py
./run -t qemu --bootstrap
The script can help you to setup a data dir, copy the sample config files
to actual config files, and download the JeOS image.
......@@ -158,8 +158,7 @@ $ git pull
And then, reset you configuration. If you're going to run qemu tests, run::
$ qemu/update_config.py
$ ./run -t qemu --update-config
If you're still having problems after these basic troubleshoot steps,
please contact us!
import os
import sys
def load_setup_modules(client_dir):
try:
sys.path.insert(0, client_dir)
import setup_modules
finally:
sys.path.pop(0)
return setup_modules
dirname = os.path.dirname(sys.modules[__name__].__file__)
virt_test_dir = os.path.abspath(os.path.join(dirname, ".."))
sys.path.insert(0, virt_test_dir)
try:
import autotest.client.setup_modules as setup_modules
client_dir = os.path.dirname(setup_modules.__file__)
sm = setup_modules
except ImportError:
try:
client_dir = os.path.abspath(os.path.join(dirname, "..", "..", ".."))
sm = load_setup_modules(client_dir)
except:
try:
client_dir = os.path.join(os.environ['AUTOTEST_PATH'], 'client')
except KeyError:
print("Environment variable $AUTOTEST_PATH not set. "
"please set it to a path containing an autotest checkout")
print("Or install the autotest-framework package for your distro")
sys.exit(1)
if not os.path.isdir(client_dir):
print('Autotest client library directory was not found at: "%s"' %
client_dir)
print('Please check if the environment variable "$AUTOTEST_PATH" '
'points to a valid location')
sys.exit(1)
sm = load_setup_modules(client_dir)
sm.setup(base_path=client_dir, root_module_name="autotest.client")
#!/usr/bin/python
"""
Program to help setup kvm test environment
:copyright: Red Hat 2010
"""
import os
import sys
import logging
import common
from virttest import data_dir, bootstrap
test_name = "openvswitch"
test_dir = os.path.dirname(sys.modules[__name__].__file__)
test_dir = os.path.abspath(test_dir)
base_dir = data_dir.get_data_dir()
default_userspace_paths = ["/usr/bin/qemu-kvm", "/usr/bin/qemu-img"]
check_modules = ["openvswitch"]
online_docs_url = "https://github.com/autotest/autotest/wiki/OpenVSwitch"
interactive = True
if __name__ == "__main__":
import optparse
option_parser = optparse.OptionParser()
option_parser.add_option("-v", "--verbose",
action="store_true", dest="verbose",
help="Exhibit debug messages")
option_parser.add_option("-r", "--restore-image",
action="store_true", dest="restore",
help="Restore image from pristine image")
option_parser.add_option("--data-dir", action="store", dest="datadir",
help="Path to a data dir (that locates ISOS and images)")
options, args = option_parser.parse_args()
if options.datadir:
data_dir.set_backing_data_dir(options.datadir)
try:
bootstrap.bootstrap(test_name, test_dir, base_dir,
default_userspace_paths, check_modules,
online_docs_url, interactive=interactive,
restore_image=options.restore,
verbose=options.verbose)
except Exception, details:
logging.error("Setup error: %s", details)
#!/usr/bin/python
"""
Populate/update config files for virt-test
:copyright: Red Hat 2013
"""
import os
import sys
import common
from autotest.client.shared import logging_manager
from virttest import data_dir, bootstrap, utils_misc
test_dir = os.path.dirname(sys.modules[__name__].__file__)
test_dir = os.path.abspath(test_dir)
t_type = os.path.basename(test_dir)
shared_dir = os.path.join(data_dir.get_root_dir(), "shared")
if __name__ == "__main__":
import optparse
option_parser = optparse.OptionParser()
option_parser.add_option("-v", "--verbose",
action="store_true", dest="verbose",
help="Exhibit debug messages")
options, args = option_parser.parse_args()
if options.verbose:
logging_manager.configure_logging(utils_misc.VirtLoggingConfig(),
verbose=options.verbose)
bootstrap.create_config_files(test_dir, shared_dir, interactive=False,
force_update=True)
bootstrap.create_subtests_cfg(t_type)
bootstrap.create_guest_os_cfg(t_type)
import os
import sys
def load_setup_modules(client_dir):
try:
sys.path.insert(0, client_dir)
import setup_modules
finally:
sys.path.pop(0)
return setup_modules
dirname = os.path.dirname(sys.modules[__name__].__file__)
virt_test_dir = os.path.abspath(os.path.join(dirname, ".."))
sys.path.insert(0, virt_test_dir)
try:
import autotest.client.setup_modules as setup_modules
client_dir = os.path.dirname(setup_modules.__file__)
sm = setup_modules
except ImportError:
try:
client_dir = os.path.abspath(os.path.join(dirname, "..", "..", ".."))
sm = load_setup_modules(client_dir)
except:
try:
client_dir = os.path.join(os.environ['AUTOTEST_PATH'], 'client')
except KeyError:
print("Environment variable $AUTOTEST_PATH not set. "
"please set it to a path containing an autotest checkout")
print("Or install the autotest-framework package for your distro")
sys.exit(1)
if not os.path.isdir(client_dir):
print('Autotest client library directory was not found at: "%s"' %
client_dir)
print('Please check if the environment variable "$AUTOTEST_PATH" '
'points to a valid location')
sys.exit(1)
sm = load_setup_modules(client_dir)
sm.setup(base_path=client_dir, root_module_name="autotest.client")
#!/usr/bin/python
"""
Program to help setup kvm test environment
:copyright: Red Hat 2010
"""
import os
import sys
import logging
import common
from virttest import utils_misc, data_dir, bootstrap, arch
test_name = "qemu"
test_dir = os.path.dirname(sys.modules[__name__].__file__)
test_dir = os.path.abspath(test_dir)
base_dir = data_dir.get_data_dir()
default_userspace_paths = ["/usr/bin/qemu-kvm", "/usr/bin/qemu-img"]
check_modules = arch.get_kvm_module_list()
online_docs_url = "https://github.com/autotest/virt-test/wiki/GetStarted"
interactive = True
if __name__ == "__main__":
import optparse
option_parser = optparse.OptionParser()
option_parser.add_option("-v", "--verbose",
action="store_true", dest="verbose",
help="Exhibit debug messages")
option_parser.add_option("-r", "--restore-image",
action="store_true", dest="restore",
help="Restore image from pristine image")
option_parser.add_option("--data-dir", action="store", dest="datadir",
help="Path to a data dir (that locates ISOS and images)")
options, args = option_parser.parse_args()
if options.datadir:
data_dir.set_backing_data_dir(options.datadir)
try:
bootstrap.bootstrap(test_name, test_dir, base_dir,
default_userspace_paths, check_modules,
online_docs_url, interactive=interactive,
restore_image=options.restore,
verbose=options.verbose)
except Exception, details:
logging.error("Setup error: %s", details)
#!/usr/bin/python
"""
Populate/update config files for virt-test
:copyright: Red Hat 2013
"""
import os
import sys
import common
from autotest.client.shared import logging_manager
from virttest import data_dir, bootstrap, utils_misc
test_dir = os.path.dirname(sys.modules[__name__].__file__)
test_dir = os.path.abspath(test_dir)
t_type = os.path.basename(test_dir)
shared_dir = os.path.join(data_dir.get_root_dir(), "shared")
if __name__ == "__main__":
import optparse
option_parser = optparse.OptionParser()
option_parser.add_option("-v", "--verbose",
action="store_true", dest="verbose",
help="Exhibit debug messages")
options, args = option_parser.parse_args()
if options.verbose:
logging_manager.configure_logging(utils_misc.VirtLoggingConfig(),
verbose=options.verbose)
bootstrap.create_config_files(test_dir, shared_dir, interactive=False,
force_update=True)
bootstrap.create_subtests_cfg(t_type)
bootstrap.create_guest_os_cfg(t_type)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册