From 0bb0aea4bac2332389a9b481f650a2a9df80ea0c Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 15 May 2017 14:36:23 +0200 Subject: qemu-iotests: Test streaming with missing job ID This adds a small test for the image streaming error path for failing block_job_create(), which would have found the null pointer dereference in commit a170a91f. Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Reviewed-by: Kashyap Chamarthy Reviewed-by: Stefan Hajnoczi Reviewed-by: Jeff Cody --- tests/qemu-iotests/030 | 4 ++++ tests/qemu-iotests/030.out | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index e00c11b804..feee86115d 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -147,6 +147,10 @@ class TestSingleDrive(iotests.QMPTestCase): result = self.vm.qmp('block-stream', device='nonexistent') self.assert_qmp(result, 'error/class', 'GenericError') + def test_job_id_missing(self): + result = self.vm.qmp('block-stream', device='mid') + self.assert_qmp(result, 'error/class', 'GenericError') + class TestParallelOps(iotests.QMPTestCase): num_ops = 4 # Number of parallel block-stream operations diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out index 84bfd63fba..391c8573ca 100644 --- a/tests/qemu-iotests/030.out +++ b/tests/qemu-iotests/030.out @@ -1,5 +1,5 @@ -...................... +....................... ---------------------------------------------------------------------- -Ran 22 tests +Ran 23 tests OK -- cgit v1.2.3 From cf1cd117e2b38f1b5d28e435b4b527a32055e133 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 5 May 2017 18:21:53 +0800 Subject: iotests: 147: Don't test inet6 if not available This is the case in our docker tests, as we use --net=none there. Skip this method. Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- tests/qemu-iotests/147 | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147 index 32afea63d4..db34838cd0 100755 --- a/tests/qemu-iotests/147 +++ b/tests/qemu-iotests/147 @@ -147,6 +147,13 @@ class BuiltinNBD(NBDBlockdevAddBase): self._server_down() def test_inet6(self): + try: + socket.getaddrinfo("::0", "0", socket.AF_INET6, + socket.SOCK_STREAM, socket.IPPROTO_TCP, + socket.AI_ADDRCONFIG | socket.AI_CANONNAME) + except socket.gaierror: + # IPv6 not available, skip + return address = { 'type': 'inet', 'data': { 'host': '::1', -- cgit v1.2.3 From bcb07dba9290407eb01971ade287ca9a332ad49d Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 8 May 2017 12:13:02 -0500 Subject: block: Tweak error message related to qemu-img amend When converting a 1.1 image down to 0.10, qemu-iotests 060 forces a contrived failure where allocating a cluster used to replace a zero cluster reads unaligned data. Since it is a zero cluster rather than a data cluster being converted, changing the error message to match our earlier change in 'qcow2: Make distinction between zero cluster types obvious' is worthwhile. Suggested-by: Max Reitz Signed-off-by: Eric Blake Message-id: 20170508171302.17805-1-eblake@redhat.com [mreitz: Commit message fixes] Signed-off-by: Max Reitz --- tests/qemu-iotests/060.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out index 9e8f5b9d79..3bc14616be 100644 --- a/tests/qemu-iotests/060.out +++ b/tests/qemu-iotests/060.out @@ -143,7 +143,7 @@ read failed: Input/output error Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -qcow2: Marking image as corrupt: Data cluster offset 0x52a00 unaligned (L2 offset: 0x40000, L2 index: 0); further corruption events will be suppressed +qcow2: Marking image as corrupt: Cluster allocation offset 0x52a00 unaligned (L2 offset: 0x40000, L2 index: 0); further corruption events will be suppressed qemu-img: Error while amending options: Input/output error === Testing unaligned reftable entry === -- cgit v1.2.3