diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-06-29 16:08:49 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-06-29 16:08:49 +0100 |
commit | ef8757f1fe8095a256ee617e4dbac69d3b33ae94 (patch) | |
tree | 9999c7bead1c8768eb6d783376f55b140431cc59 /tests | |
parent | 845d1e7e42cfc5abdd00cf715da9bd656f5a747d (diff) | |
parent | 15d6729850728ee49859711dd40b00d8d85d94ee (diff) | |
download | qemu-ef8757f1fe8095a256ee617e4dbac69d3b33ae94.tar.gz qemu-ef8757f1fe8095a256ee617e4dbac69d3b33ae94.tar.bz2 qemu-ef8757f1fe8095a256ee617e4dbac69d3b33ae94.zip |
Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging
# gpg: Signature made Wed 29 Jun 2016 04:09:26 BST
# gpg: using RSA key 0xBDBE7B27C0DE3057
# gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>"
# gpg: aka "Jeffrey Cody <jeff@codyprime.org>"
# gpg: aka "Jeffrey Cody <codyprime@gmail.com>"
# Primary key fingerprint: 9957 4B4D 3474 90E7 9D98 D624 BDBE 7B27 C0DE 3057
* remotes/cody/tags/block-pull-request:
mirror: fix misleading comments
blockjob: assert(cb) when create job
iotests: add small-granularity mirror test
mirror: limit niov to IOV_MAX elements, again
mirror: clarify mirror_do_read return code
block/gluster: add support for selecting debug logging level
mirror: fix trace_mirror_yield_in_flight usage in mirror_iteration()
block/nfs: add support for libnfs pagecache
block/nfs: refuse readahead if cache.direct is on
block/gluster: add support for SEEK_DATA/SEEK_HOLE
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/qemu-iotests/041 | 30 | ||||
-rw-r--r-- | tests/qemu-iotests/041.out | 4 |
2 files changed, 32 insertions, 2 deletions
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index ed1d9d464c..cbf5e0ba5c 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -727,6 +727,36 @@ class TestUnbackedSource(iotests.QMPTestCase): self.complete_and_wait() self.assert_no_active_block_jobs() +class TestGranularity(iotests.QMPTestCase): + image_len = 10 * 1024 * 1024 # MB + + def setUp(self): + qemu_img('create', '-f', iotests.imgfmt, test_img, + str(TestGranularity.image_len)) + qemu_io('-c', 'write 0 %d' % (self.image_len), + test_img) + self.vm = iotests.VM().add_drive(test_img) + self.vm.launch() + + def tearDown(self): + self.vm.shutdown() + self.assertTrue(iotests.compare_images(test_img, target_img), + 'target image does not match source after mirroring') + os.remove(test_img) + os.remove(target_img) + + def test_granularity(self): + self.assert_no_active_block_jobs() + result = self.vm.qmp('drive-mirror', device='drive0', + sync='full', target=target_img, + mode='absolute-paths', granularity=8192) + self.assert_qmp(result, 'return', {}) + event = self.vm.get_qmp_event(wait=60.0) + # Failures will manifest as COMPLETED/ERROR. + self.assert_qmp(event, 'event', 'BLOCK_JOB_READY') + self.complete_and_wait(drive='drive0', wait_ready=False) + self.assert_no_active_block_jobs() + class TestRepairQuorum(iotests.QMPTestCase): """ This class test quorum file repair using drive-mirror. It's mostly a fork of TestSingleDrive """ diff --git a/tests/qemu-iotests/041.out b/tests/qemu-iotests/041.out index b0cadc8245..b67d0504a6 100644 --- a/tests/qemu-iotests/041.out +++ b/tests/qemu-iotests/041.out @@ -1,5 +1,5 @@ -........................................................................... +............................................................................ ---------------------------------------------------------------------- -Ran 75 tests +Ran 76 tests OK |