summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKevin Wolf2016-07-13 13:45:55 +0200
committerKevin Wolf2016-07-13 13:45:55 +0200
commit543d7a42baf39c09db754ba9eca1d386e5958110 (patch)
tree567eef5c89ae7769a785b678dcd01e6f7e693cad /tests
parentblock: Remove BB options from blockdev-add (diff)
parentiotests: Make 157 actually format-agnostic (diff)
downloadqemu-543d7a42baf39c09db754ba9eca1d386e5958110.tar.gz
qemu-543d7a42baf39c09db754ba9eca1d386e5958110.tar.xz
qemu-543d7a42baf39c09db754ba9eca1d386e5958110.zip
Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2016-07-13' into queue-block
Block patches (v2) for the block queue. # gpg: Signature made Wed Jul 13 13:41:53 2016 CEST # gpg: using RSA key 0x3BB14202E838ACAD # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 # Subkey fingerprint: 58B3 81CE 2DC8 9CF9 9730 EE64 3BB1 4202 E838 ACAD * mreitz/tags/pull-block-for-kevin-2016-07-13: iotests: Make 157 actually format-agnostic vvfat: Fix qcow write target driver specification hmp: show all of snapshot info on every block dev in output of 'info snapshots' hmp: use snapshot name to determine whether a snapshot is 'fully available' qemu-iotests: Test naming of throttling groups blockdev: Fix regression with the default naming of throttling groups vmdk: fix metadata write regression Improve block job rate limiting for small bandwidth values qcow2: Fix qcow2_get_cluster_offset() qemu-io: Use correct range limitations qcow2: Avoid making the L1 table too big qemu-img: Use strerror() for generic resize error Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qemu-iotests/09398
-rw-r--r--tests/qemu-iotests/093.out4
-rwxr-xr-xtests/qemu-iotests/1573
-rw-r--r--tests/qemu-iotests/157.out16
4 files changed, 110 insertions, 11 deletions
diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093
index ce8e13cb49..ffcb271b36 100755
--- a/tests/qemu-iotests/093
+++ b/tests/qemu-iotests/093
@@ -184,5 +184,103 @@ class ThrottleTestCase(iotests.QMPTestCase):
class ThrottleTestCoroutine(ThrottleTestCase):
test_img = "null-co://"
+class ThrottleTestGroupNames(iotests.QMPTestCase):
+ test_img = "null-aio://"
+ max_drives = 3
+
+ def setUp(self):
+ self.vm = iotests.VM()
+ for i in range(0, self.max_drives):
+ self.vm.add_drive(self.test_img, "throttling.iops-total=100")
+ self.vm.launch()
+
+ def tearDown(self):
+ self.vm.shutdown()
+
+ def set_io_throttle(self, device, params):
+ params["device"] = device
+ result = self.vm.qmp("block_set_io_throttle", conv_keys=False, **params)
+ self.assert_qmp(result, 'return', {})
+
+ def verify_name(self, device, name):
+ result = self.vm.qmp("query-block")
+ for r in result["return"]:
+ if r["device"] == device:
+ info = r["inserted"]
+ if name:
+ self.assertEqual(info["group"], name)
+ else:
+ self.assertFalse(info.has_key('group'))
+ return
+
+ raise Exception("No group information found for '%s'" % device)
+
+ def test_group_naming(self):
+ params = {"bps": 0,
+ "bps_rd": 0,
+ "bps_wr": 0,
+ "iops": 0,
+ "iops_rd": 0,
+ "iops_wr": 0}
+
+ # Check the drives added using the command line.
+ # The default throttling group name is the device name.
+ for i in range(self.max_drives):
+ devname = "drive%d" % i
+ self.verify_name(devname, devname)
+
+ # Clear throttling settings => the group name is gone.
+ for i in range(self.max_drives):
+ devname = "drive%d" % i
+ self.set_io_throttle(devname, params)
+ self.verify_name(devname, None)
+
+ # Set throttling settings using block_set_io_throttle and
+ # check the default group names.
+ params["iops"] = 10
+ for i in range(self.max_drives):
+ devname = "drive%d" % i
+ self.set_io_throttle(devname, params)
+ self.verify_name(devname, devname)
+
+ # Set a custom group name for each device
+ for i in range(3):
+ devname = "drive%d" % i
+ groupname = "group%d" % i
+ params['group'] = groupname
+ self.set_io_throttle(devname, params)
+ self.verify_name(devname, groupname)
+
+ # Put drive0 in group1 and check that all other devices remain
+ # unchanged
+ params['group'] = 'group1'
+ self.set_io_throttle('drive0', params)
+ self.verify_name('drive0', 'group1')
+ for i in range(1, self.max_drives):
+ devname = "drive%d" % i
+ groupname = "group%d" % i
+ self.verify_name(devname, groupname)
+
+ # Put drive0 in group2 and check that all other devices remain
+ # unchanged
+ params['group'] = 'group2'
+ self.set_io_throttle('drive0', params)
+ self.verify_name('drive0', 'group2')
+ for i in range(1, self.max_drives):
+ devname = "drive%d" % i
+ groupname = "group%d" % i
+ self.verify_name(devname, groupname)
+
+ # Clear throttling settings from drive0 check that all other
+ # devices remain unchanged
+ params["iops"] = 0
+ self.set_io_throttle('drive0', params)
+ self.verify_name('drive0', None)
+ for i in range(1, self.max_drives):
+ devname = "drive%d" % i
+ groupname = "group%d" % i
+ self.verify_name(devname, groupname)
+
+
if __name__ == '__main__':
iotests.main(supported_fmts=["raw"])
diff --git a/tests/qemu-iotests/093.out b/tests/qemu-iotests/093.out
index 89968f35d7..914e3737bd 100644
--- a/tests/qemu-iotests/093.out
+++ b/tests/qemu-iotests/093.out
@@ -1,5 +1,5 @@
-....
+.....
----------------------------------------------------------------------
-Ran 4 tests
+Ran 5 tests
OK
diff --git a/tests/qemu-iotests/157 b/tests/qemu-iotests/157
index 2699168f1d..8d939cb747 100755
--- a/tests/qemu-iotests/157
+++ b/tests/qemu-iotests/157
@@ -57,7 +57,8 @@ function do_run_qemu()
function run_qemu()
{
- do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_generated_node_ids
+ do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_imgfmt \
+ | _filter_qemu | _filter_generated_node_ids
}
diff --git a/tests/qemu-iotests/157.out b/tests/qemu-iotests/157.out
index 5aa9c0e2e4..77a9c03d2c 100644
--- a/tests/qemu-iotests/157.out
+++ b/tests/qemu-iotests/157.out
@@ -3,20 +3,20 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
=== Setting WCE with qdev and with manually created BB ===
-Testing: -drive if=none,file=TEST_DIR/t.qcow2,driver=qcow2,cache=writeback -device virtio-blk,drive=none0
+Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,driver=IMGFMT,cache=writeback -device virtio-blk,drive=none0
Cache mode: writeback
-Testing: -drive if=none,file=TEST_DIR/t.qcow2,driver=qcow2,cache=writeback -device virtio-blk,drive=none0,write-cache=auto
+Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,driver=IMGFMT,cache=writeback -device virtio-blk,drive=none0,write-cache=auto
Cache mode: writeback
-Testing: -drive if=none,file=TEST_DIR/t.qcow2,driver=qcow2,cache=writeback -device virtio-blk,drive=none0,write-cache=on
+Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,driver=IMGFMT,cache=writeback -device virtio-blk,drive=none0,write-cache=on
Cache mode: writeback
-Testing: -drive if=none,file=TEST_DIR/t.qcow2,driver=qcow2,cache=writeback -device virtio-blk,drive=none0,write-cache=off
+Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,driver=IMGFMT,cache=writeback -device virtio-blk,drive=none0,write-cache=off
Cache mode: writethrough
-Testing: -drive if=none,file=TEST_DIR/t.qcow2,driver=qcow2,cache=writethrough -device virtio-blk,drive=none0
+Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,driver=IMGFMT,cache=writethrough -device virtio-blk,drive=none0
Cache mode: writethrough
-Testing: -drive if=none,file=TEST_DIR/t.qcow2,driver=qcow2,cache=writethrough -device virtio-blk,drive=none0,write-cache=auto
+Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,driver=IMGFMT,cache=writethrough -device virtio-blk,drive=none0,write-cache=auto
Cache mode: writethrough
-Testing: -drive if=none,file=TEST_DIR/t.qcow2,driver=qcow2,cache=writethrough -device virtio-blk,drive=none0,write-cache=on
+Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,driver=IMGFMT,cache=writethrough -device virtio-blk,drive=none0,write-cache=on
Cache mode: writeback
-Testing: -drive if=none,file=TEST_DIR/t.qcow2,driver=qcow2,cache=writethrough -device virtio-blk,drive=none0,write-cache=off
+Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,driver=IMGFMT,cache=writethrough -device virtio-blk,drive=none0,write-cache=off
Cache mode: writethrough
*** done