From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avPpU-0006q9-Nk for qemu-devel@nongnu.org; Wed, 27 Apr 2016 09:48:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avPpT-00019J-OT for qemu-devel@nongnu.org; Wed, 27 Apr 2016 09:48:36 -0400 References: <2483f3f1b677752d0f77da8628b0216bd4a26d3f.1459776815.git.berto@igalia.com> From: Max Reitz Message-ID: <5720C32A.7030807@redhat.com> Date: Wed, 27 Apr 2016 15:48:26 +0200 MIME-Version: 1.0 In-Reply-To: <2483f3f1b677752d0f77da8628b0216bd4a26d3f.1459776815.git.berto@igalia.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GAfMRusTGoSttgTjAcX6XlO7dJcaQM0aI" Subject: Re: [Qemu-devel] [PATCH v9 10/11] qemu-iotests: test overlapping block-stream operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Eric Blake , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --GAfMRusTGoSttgTjAcX6XlO7dJcaQM0aI Content-Type: multipart/mixed; boundary="L9Fwf6DhaRuRV11vvBr2DcWH8VuAQ5pAN" From: Max Reitz To: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Eric Blake , Stefan Hajnoczi Message-ID: <5720C32A.7030807@redhat.com> Subject: Re: [PATCH v9 10/11] qemu-iotests: test overlapping block-stream operations References: <2483f3f1b677752d0f77da8628b0216bd4a26d3f.1459776815.git.berto@igalia.com> In-Reply-To: <2483f3f1b677752d0f77da8628b0216bd4a26d3f.1459776815.git.berto@igalia.com> --L9Fwf6DhaRuRV11vvBr2DcWH8VuAQ5pAN Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 04.04.2016 15:44, Alberto Garcia wrote: > This test case checks that it's not possible to perform two > block-stream operations if there are nodes involved in both. >=20 > Signed-off-by: Alberto Garcia > --- > tests/qemu-iotests/030 | 60 ++++++++++++++++++++++++++++++++++++++= ++++++++ > tests/qemu-iotests/030.out | 4 ++-- > 2 files changed, 62 insertions(+), 2 deletions(-) >=20 > diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 > index 1c53f80..6348872 100755 > --- a/tests/qemu-iotests/030 > +++ b/tests/qemu-iotests/030 > @@ -145,6 +145,66 @@ class TestSingleDrive(iotests.QMPTestCase): > self.assert_qmp(result, 'error/class', 'GenericError') > =20 > =20 > +class TestMultipleOps(iotests.QMPTestCase): > + num_imgs =3D 9 # It must be > 5 or some tests will break > + image_len =3D num_imgs * 1024 * 1024 > + imgs =3D [] > + > + def setUp(self): > + opts =3D [] > + self.imgs =3D [] > + > + # Initialize file names and command-line options > + for i in range(self.num_imgs): > + img_depth =3D self.num_imgs - i - 1 > + opts.append("backing." * img_depth + "node-name=3Dnode%d" = % i) > + self.imgs.append(os.path.join(iotests.test_dir, 'img-%d.im= g' % i)) > + > + # Create all images > + iotests.create_image(self.imgs[0], self.image_len) > + for i in range(1, self.num_imgs): > + qemu_img('create', '-f', iotests.imgfmt, > + '-o', 'backing_file=3D%s' % self.imgs[i-1], self.= imgs[i]) > + > + # Put data into some images so there's something to copy > + for i in range(1, self.num_imgs, 2): > + qemu_io('-f', iotests.imgfmt, > + '-c', 'write -P %d %d %d' % (i, i*1024*1024, 1024*= 1024), > + self.imgs[i]) > + > + # Attach the drive to the VM > + self.vm =3D iotests.VM() > + self.vm.add_drive("blkdebug::" + self.imgs[-1], ','.join(opts)= ) Any special reason for blkdebug? For me it works just fine without. With or without: Reviewed-by: Max Reitz > + self.vm.launch() > + > + def tearDown(self): > + self.vm.shutdown() > + for img in self.imgs: > + os.remove(img) > + > + # Test that it's not possible to perform two block-stream > + # operations if there are nodes involved in both. > + def test_overlapping(self): > + self.assert_no_active_block_jobs() > + > + # Set a speed limit to make sure that this job blocks the rest= > + result =3D self.vm.qmp('block-stream', device=3D'node4', base=3D= self.imgs[0], speed=3D32768) > + self.assert_qmp(result, 'return', {}) > + > + result =3D self.vm.qmp('block-stream', device=3D'node5', base=3D= self.imgs[1]) > + self.assert_qmp(result, 'error/class', 'GenericError') > + > + result =3D self.vm.qmp('block-stream', device=3D'node3', base=3D= self.imgs[2]) > + self.assert_qmp(result, 'error/class', 'GenericError') > + > + result =3D self.vm.qmp('block-stream', device=3D'node4') > + self.assert_qmp(result, 'error/class', 'GenericError') > + > + self.wait_until_completed(drive=3D'node4') > + self.assert_no_active_block_jobs() > + > + self.vm.shutdown() > + > class TestSmallerBackingFile(iotests.QMPTestCase): > backing_len =3D 1 * 1024 * 1024 # MB > image_len =3D 2 * backing_len > diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out > index 96961ed..b6f2576 100644 > --- a/tests/qemu-iotests/030.out > +++ b/tests/qemu-iotests/030.out > @@ -1,5 +1,5 @@ > -............... > +................ > ----------------------------------------------------------------------= > -Ran 15 tests > +Ran 16 tests > =20 > OK >=20 --L9Fwf6DhaRuRV11vvBr2DcWH8VuAQ5pAN-- --GAfMRusTGoSttgTjAcX6XlO7dJcaQM0aI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXIMMqAAoJEDuxQgLoOKyt9p4H/3yy4Ix6E5pYtHTTXfk4mxVJ 6KZUbtvrkeseFOL4+0QfKEcbz78GcOhzoBUgASxrFuamrv/5uuSWOLA9LLC+B4ur rqcWPn9WKZI3YC85vugWpUP/2ZLFE2LEtHoRRy7xmEbHqY7OxydG2lxDXfz/EVhe lKCDuTRYn8jjClUH1TTcaMmWyOFs7Mn1/eYsg7nWxhnM9pfFo6UvqiVBP74kXjdF Ks+b8Zyj3k3A3fwm97NXcjL/iQgbQjAgcf1EUEkWGICFjW6xxTjfbRe7WKjgrxL0 Xsw3yLFmYROtnRmlOjy2guQ3ODG2WQNdYpvEKt0eQnNri7XGvGG8ZLIRVaFZF08= =fdQu -----END PGP SIGNATURE----- --GAfMRusTGoSttgTjAcX6XlO7dJcaQM0aI--