virt tests: add dd_test
PATCH 2/2 virt: Fix usb_stick block device subsystem
In reply to Lukas Doktor* Add ehci controller when usbstick is selected
* Add default number of usb_max_port
With those mini-changes it's possible to run every test with usb_stick block device without further test/cfg modifications.
--- client/virt/guest-hw.cfg.sample | 2 ++ client/virt/kvm_vm.py | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-)
client/virt/guest-hw.cfg.sample +2 -0
@@ -71,6 +71,8 @@ variants: cd_format=ahci - usb_stick: drive_format=usb2 + usbs += " default-ehci" + usb_type_default-ehci = usb-ehci - usb_cdrom: cd_format=usb2 - xenblk:
client/virt/kvm_vm.py +1 -1
@@ -238,7 +238,7 @@ class VM(virt_vm.BaseVM): usb_dev = self.usb_dev_dict.get(usb) controller = usb - max_port = int(usb_params.get("usb_max_port")) + max_port = int(usb_params.get("usb_max_port", 6)) if len(usb_dev) < max_port: bus = "%s.0" % usb self.usb_dev_dict[usb].append(dev)
Signature · 1 line
1.7.7.6
This patchset adds a simple dd test on guest with RW and ReadOnly disk. The test itself is parametrizable and might be reused in more advanced tests later.
It also fixes some issues with usb_stick block subsystem.
See individual patch descriptions for details.
See pull request 278:
https://github.com/autotest/autotest/pull/278
Regards,
Lukáš Doktor
PATCH 1/2 virt tests: add dd_test
This patch adds dd_test which tries simple read/write from/to an attached disk. The purpose is to test readonly vs. readwrite subsystem.
The dd_test.py is highly parametrizable so it can be used in other tests by changing parameters.
It also adds another image parameter "image_readonly" (bool) which is required for this test.
--- client/virt/kvm_vm.py | 6 ++- client/virt/subtests.cfg.sample | 35 +++++++++++++ client/virt/tests/dd_test.py | 105 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 client/virt/tests/dd_test.py
client/virt/kvm_vm.py +4 -2
@@ -310,7 +310,7 @@ class VM(virt_vm.BaseVM): boot=False, blkdebug=None, bus=None, port=None, bootindex=None, removable=None, min_io_size=None, opt_io_size=None, physical_block_size=None, - logical_block_size=None): + logical_block_size=None, readonly=False): name = None dev = "" if format == "ahci":
@@ -362,6 +362,7 @@ class VM(virt_vm.BaseVM): cmd += _add_option("snapshot", snapshot, bool) cmd += _add_option("boot", boot, bool) cmd += _add_option("id", name) + cmd += _add_option("readonly", readonly, bool) return cmd + dev def add_nic(help, vlan, model=None, mac=None, device_id=None, netdev_id=None,
@@ -758,7 +759,8 @@ class VM(virt_vm.BaseVM): image_params.get("min_io_size"), image_params.get("opt_io_size"), image_params.get("physical_block_size"), - image_params.get("logical_block_size")) + image_params.get("logical_block_size"), + image_params.get("image_readonly")) redirs = [] for redir_name in params.objects("redirs"):
client/virt/subtests.cfg.sample +35 -0
@@ -398,6 +398,41 @@ variants: create_image_stg = yes image_size_stg = 10M + - dd_test: install setup image_copy unattended_install.cdrom + type = dd_test + images += " stg1" + image_name_stg1 = "sgt1" + image_size_stg1 = 1M + image_snapshot_stg1 = no + drive_index_stg1 = 3 + dd_count = 1 + # last input and output disk + dd_if_select = -1 + dd_of_select = -1 + variants: + - readwrite: + dd_stat = 0 + variants: + - zero2disk: + dd_if = ZERO + dd_of = /dev/[shv]d? + - disk2null: + dd_if = /dev/[shv]d? + dd_of = NULL + - readonly: + # ide, ahci don't support readonly disks + no ide, ahci + image_readonly_stg1 = yes + variants: + - zero2disk: + dd_if = ZERO + dd_of = /dev/[shv]d? + dd_stat = 1 + - disk2null: + dd_if = /dev/[shv]d? + dd_of = NULL + dd_stat = 0 + - virsh_migrate: install setup image_copy unattended_install.cdrom type = virsh_migrate
client/virt/tests/dd_test.py new file +105 -0
105 lines not on this page · raw message
Signature · 1 line
1.7.7.6