From patchwork Thu Nov 22 18:48:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Shinkevich X-Patchwork-Id: 10694717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4670713B5 for ; Thu, 22 Nov 2018 18:49:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E4DD2C4BC for ; Thu, 22 Nov 2018 18:49:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 329612C4CF; Thu, 22 Nov 2018 18:49:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BB9482C4BC for ; Thu, 22 Nov 2018 18:49:35 +0000 (UTC) Received: from localhost ([::1]:48927 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPu2g-0004zA-SF for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Nov 2018 13:49:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPu1S-0003O5-Jw for qemu-devel@nongnu.org; Thu, 22 Nov 2018 13:48:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPu1P-00073c-ET for qemu-devel@nongnu.org; Thu, 22 Nov 2018 13:48:18 -0500 Received: from relay.sw.ru ([185.231.240.75]:48756) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPu1P-0006zx-4Z; Thu, 22 Nov 2018 13:48:15 -0500 Received: from [172.16.25.136] (helo=localhost.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gPu1J-0006jl-5L; Thu, 22 Nov 2018 21:48:09 +0300 From: Andrey Shinkevich To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Thu, 22 Nov 2018 21:48:06 +0300 Message-Id: <1542912487-279165-5-git-send-email-andrey.shinkevich@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1542912487-279165-1-git-send-email-andrey.shinkevich@virtuozzo.com> References: <1542912487-279165-1-git-send-email-andrey.shinkevich@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH 4/5] iotests: prepare 030 for graph change X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, jcody@redhat.com, armbru@redhat.com, dgilbert@redhat.com, andrey.shinkevich@virtuozzo.com, den@openvz.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The discard option for block-stream command requires insertion of the filter to write into the backing chain. In that case, the job will not resume by device name. So, the node name is specified. Signed-off-by: Andrey Shinkevich --- tests/qemu-iotests/030 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 276e06b..5d148b0 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -36,7 +36,8 @@ class TestSingleDrive(iotests.QMPTestCase): qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img) qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 512', backing_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 524288 512', mid_img) - self.vm = iotests.VM().add_drive("blkdebug::" + test_img, "backing.node-name=mid") + self.vm = iotests.VM().add_drive("blkdebug::" + test_img, + "node-name=source,backing.node-name=mid") self.vm.launch() def tearDown(self): @@ -87,7 +88,7 @@ class TestSingleDrive(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) self.pause_job('drive0', wait=False) - self.vm.resume_drive('drive0') + self.vm.resume_drive('source') self.pause_wait('drive0') result = self.vm.qmp('query-block-jobs') @@ -743,7 +744,8 @@ class TestStreamStop(iotests.QMPTestCase): qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 32M', backing_img) qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 32M 32M', test_img) - self.vm = iotests.VM().add_drive("blkdebug::" + test_img) + self.vm = iotests.VM().add_drive("blkdebug::" + test_img, + "node-name=source") self.vm.launch() def tearDown(self): @@ -764,7 +766,7 @@ class TestStreamStop(iotests.QMPTestCase): self.assert_qmp(e, 'event', 'JOB_STATUS_CHANGE') self.assert_qmp(e, 'data/id', 'drive0') - self.cancel_and_wait(resume=True) + self.cancel_and_wait(resume=True, resume_node='source') class TestSetSpeed(iotests.QMPTestCase): image_len = 80 * 1024 * 1024 # MB @@ -774,7 +776,8 @@ class TestSetSpeed(iotests.QMPTestCase): qemu_io('-f', 'raw', '-c', 'write -P 0x1 0 32M', backing_img) qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % backing_img, test_img) qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0x1 32M 32M', test_img) - self.vm = iotests.VM().add_drive('blkdebug::' + test_img) + self.vm = iotests.VM().add_drive('blkdebug::' + test_img, + "node-name=source") self.vm.launch() def tearDown(self): @@ -817,7 +820,7 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_qmp(result, 'return[0]/device', 'drive0') self.assert_qmp(result, 'return[0]/speed', 8 * 1024 * 1024) - self.cancel_and_wait(resume=True) + self.cancel_and_wait(resume=True, resume_node='source') self.vm.pause_drive('drive0') # Check setting speed in block-stream works @@ -828,7 +831,7 @@ class TestSetSpeed(iotests.QMPTestCase): self.assert_qmp(result, 'return[0]/device', 'drive0') self.assert_qmp(result, 'return[0]/speed', 4 * 1024 * 1024) - self.cancel_and_wait(resume=True) + self.cancel_and_wait(resume=True, resume_node='source') def test_set_speed_invalid(self): self.assert_no_active_block_jobs() @@ -845,7 +848,8 @@ class TestSetSpeed(iotests.QMPTestCase): result = self.vm.qmp('block-job-set-speed', device='drive0', speed=-1) self.assert_qmp(result, 'error/class', 'GenericError') - self.cancel_and_wait(resume=True) + self.cancel_and_wait(resume=True, resume_node='source') + if __name__ == '__main__': iotests.main(supported_fmts=['qcow2', 'qed'])