提交 36943ee7 编写于 作者: C Cleber Rosa

Default options: use first item from supported values

Instead of repeating the values as the default for a given option,
let's just use the first entry for each of the supported values list.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 7929cf20
......@@ -89,13 +89,14 @@ class VirtTestOptionsProcess(object):
set_opt(self.options, 'vt_smp',
settings.get_value('vt.qemu', 'smp', default='2'))
set_opt(self.options, 'vt_image_type',
settings.get_value('vt.qemu', 'image_type', default='qcow2'))
settings.get_value('vt.qemu', 'image_type',
default=SUPPORTED_IMAGE_TYPES[0]))
set_opt(self.options, 'vt_nic_model',
settings.get_value('vt.qemu', 'nic_model',
default='virtio_net'))
default=SUPPORTED_NIC_MODELS[0]))
set_opt(self.options, 'vt_disk_bus',
settings.get_value('vt.qemu', 'disk_bus',
default='virtio_blk'))
default=SUPPORTED_DISK_BUSES[0]))
set_opt(self.options, 'vt_qemu_sandbox',
settings.get_value('vt.qemu', 'sandbox', default='on'))
set_opt(self.options, 'vt_qemu_defconfig',
......
......@@ -53,7 +53,7 @@ def add_basic_vt_options(parser):
msg = ("Choose test type (%s). Default: %%(default)s" %
", ".join(SUPPORTED_TEST_TYPES))
parser.add_argument("--vt-type", action="store", dest="vt_type",
help=msg, default='qemu')
help=msg, default=SUPPORTED_TEST_TYPES[0])
arch = settings.get_value('vt.common', 'arch', default=None)
parser.add_argument("--vt-arch", help="Choose the VM architecture. "
"Default: %(default)s", default=arch)
......
......@@ -21,14 +21,18 @@ def _variant_only_file(filename):
if not _.lstrip().startswith('#')])
#: The first entry of these lists will be used as a default value.
#: Only change the first entry if you intend to change the default
#: value. See :func:`avocado_vt.plugins.vt.add_basic_vt_options` and
#: class:`avocado_vt.options.VirtTestOptionsProcess` for usage examples.
SUPPORTED_TEST_TYPES = [
'qemu', 'libvirt', 'libguestfs', 'openvswitch', 'v2v', 'lvsb', 'spice']
SUPPORTED_LIBVIRT_URIS = ['qemu:///system', 'lxc:///']
SUPPORTED_LIBVIRT_DRIVERS = ['qemu', 'lxc', 'xen']
SUPPORTED_IMAGE_TYPES = ['raw', 'qcow2', 'qed', 'vmdk']
SUPPORTED_DISK_BUSES = ['ide', 'scsi', 'virtio_blk',
SUPPORTED_IMAGE_TYPES = ['qcow2', 'raw', 'qed', 'vmdk']
SUPPORTED_DISK_BUSES = ['virtio_blk', 'ide', 'scsi',
'virtio_scsi', 'lsi_scsi', 'ahci', 'usb2', 'xenblk']
SUPPORTED_NIC_MODELS = ["virtio_net", "e1000", "rtl8139", "spapr-vlan"]
SUPPORTED_NET_TYPES = ["bridge", "user", "none"]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册