提交 2fbcce1a 编写于 作者: L Lucas Meneghel Rodrigues

get_started.py: Update scripts with new options

Add the following new options to the kvm get started
script, as well as the other scripts:

1) Add a verbose option, to show more debugging output
2) Add a --restore-image option, to restore JeOS from pristine
3) Add a --data-dir option, to choose a different data dir

Made some of the wording of the scripts slightly shorter.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 32ca9c24
......@@ -14,12 +14,30 @@ 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 = ["kvm", "kvm-%s" % utils_misc.get_cpu_vendor(verbose=False)]
online_docs_url = "https://github.com/autotest/virt-test/wiki"
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:
utils_misc.virt_test_assistant(test_name, test_dir, base_dir,
default_userspace_paths, check_modules,
online_docs_url)
online_docs_url, interactive=interactive,
restore_image=options.restore,
verbose=options.verbose)
except Exception, details:
logging.error("Setup error: %s", details)
......@@ -4,7 +4,7 @@ Program to help setup kvm test environment
@copyright: Red Hat 2010
"""
import os, sys
import os, sys, logging
import common
from virttest import utils_misc, data_dir
......@@ -15,8 +15,29 @@ 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__":
utils_misc.virt_test_assistant(test_name, test_dir, base_dir,
default_userspace_paths, check_modules,
online_docs_url)
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:
utils_misc.virt_test_assistant(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)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册