From nobody Mon Feb 9 23:40:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503493610433962.791518408785; Wed, 23 Aug 2017 06:06:50 -0700 (PDT) Received: from localhost ([::1]:43648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVMv-0006Yf-2X for importer@patchew.org; Wed, 23 Aug 2017 09:06:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkVLC-0005R7-9w for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:05:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkVL6-00064E-1S for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:05:02 -0400 Received: from research.iiit.ac.in ([196.12.53.8]:39838) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkVL5-000630-Au for qemu-devel@nongnu.org; Wed, 23 Aug 2017 09:04:55 -0400 Received: from localhost (localhost [127.0.0.1]) by research.iiit.ac.in (Postfix) with ESMTP id ABC81741F50; Wed, 23 Aug 2017 18:34:50 +0530 (IST) Received: from research.iiit.ac.in ([127.0.0.1]) by localhost (research.iiit.ac.in [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id UKNMEHMfSDuz; Wed, 23 Aug 2017 18:34:47 +0530 (IST) Received: from localhost (localhost [127.0.0.1]) by research.iiit.ac.in (Postfix) with ESMTP id 77AF0744E30; Wed, 23 Aug 2017 18:34:47 +0530 (IST) Received: from research.iiit.ac.in ([127.0.0.1]) by localhost (research.iiit.ac.in [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id bBhKivqKTqd1; Wed, 23 Aug 2017 18:34:47 +0530 (IST) Received: from ishani-Inspiron-5558.iiit.ac.in (unknown [10.2.20.28]) by research.iiit.ac.in (Postfix) with ESMTPSA id 5CD62741E02; Wed, 23 Aug 2017 18:34:47 +0530 (IST) DKIM-Filter: OpenDKIM Filter v2.9.2 research.iiit.ac.in 77AF0744E30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=research.iiit.ac.in; s=4E8815E6-5B55-11E4-B758-8D4964374E96; t=1503493487; bh=OZT0cdOWO7hoV/MbKeGca3MCYlb/1ewSsMb64M/zs3g=; h=From:To:Subject:Date:Message-Id; b=a4A1ajtKvXkP/m6LV8bzehxTZts6x+wwzjMRsRYKp4rtUEAx+uBBgc+4knVHptG7m w2nKCtyeHeoCNazj310DMdnkzp3Nau0ILKKDvp0xQebl9LOfNbREU5SO5iUoMsabcO Cg+eOHnROpqtOcVhf+xnuMVLR9raOCbrwgMTQApA= X-Virus-Scanned: amavisd-new at research.iiit.ac.in From: Ishani Chugh To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 18:34:39 +0530 Message-Id: <1503493480-21691-3-git-send-email-chugh.ishani@research.iiit.ac.in> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503493480-21691-1-git-send-email-chugh.ishani@research.iiit.ac.in> References: <1503493480-21691-1-git-send-email-chugh.ishani@research.iiit.ac.in> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 196.12.53.8 Subject: [Qemu-devel] [PATCH 2/3] Test for full Backup 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: Ishani Chugh , jsnow@redhat.com, stefanha@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch is the test for full backup implementation in Backup tool. The test employs two basic substests: 1) Backing up an empty guest and comparing it with base image. 2) Writing a pattern to the guest, creating backup and comparing with the base image. Signed-off-by: Ishani Chugh --- tests/qemu-iotests/191 | 78 ++++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/191.out | 33 ++++++++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 112 insertions(+) create mode 100755 tests/qemu-iotests/191 create mode 100644 tests/qemu-iotests/191.out diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191 new file mode 100755 index 0000000..fb4cde9 --- /dev/null +++ b/tests/qemu-iotests/191 @@ -0,0 +1,78 @@ +#!/bin/bash +# +# Test full backup functionality of qemu-backup tool +# +# Copyright (C) 2009 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# creator +owner=3Dchugh.ishani@research.iiit.ac.in + +seq=3D`basename $0` +echo "QA output created by $seq" + +here=3D`pwd` +status=3D1 # failure is the default! + + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.qemu + +_supported_fmt generic +_supported_proto generic +_supported_os Linux + + +CONFIG_FILE=3D$TEST_DIR/backup-config +SOCKET=3Dunix:$TEST_DIR/backup_socket +size=3D128M + +_make_test_img $size +export QEMU_BACKUP_CONFIG=3D$CONFIG_FILE +qemu_comm_method=3D"monitor" +echo +_launch_qemu -drive if=3Dvirtio,file=3D$TEST_IMG -qmp $SOCKET,server,nowait +$PYTHON ../../contrib/backup/qemu-backup.py guest add --guest adad --qmp $= SOCKET +$PYTHON ../../contrib/backup/qemu-backup.py drive add --id virtio0 --guest= adad --target $TEST_DIR/virtio0 +echo +echo "=3D=3D Creating backup =3D=3D" +$PYTHON ../../contrib/backup/qemu-backup.py backup --guest adad +_send_qemu_cmd $QEMU_HANDLE 'quit' '' +wait=3D1 _cleanup_qemu +echo +echo "=3D=3D Comparing images =3D=3D" +$QEMU_IMG compare $TEST_DIR/virtio0 $TEST_IMG +rm $TEST_DIR/virtio0 + +_launch_qemu -drive if=3Dvirtio,id=3Dvirtio0,file=3D$TEST_IMG -qmp $SOCKET= ,server,nowait +echo +echo "=3D=3D Writing Pattern =3D=3D" +_send_qemu_cmd $QEMU_HANDLE 'qemu-io virtio0 "write -P 0x22 0 1M"' "(qemu)= " | _filter_qemu_io +echo +echo "=3D=3D Creating backup =3D=3D" +$PYTHON ../../contrib/backup/qemu-backup.py backup --guest adad +_send_qemu_cmd $QEMU_HANDLE 'quit' '' +wait=3D1 _cleanup_qemu +echo +echo "=3D=3D Comparing images =3D=3D" +$QEMU_IMG compare $TEST_DIR/virtio0 $TEST_IMG +rm $TEST_DIR/virtio0 +rm $CONFIG_FILE + +echo "*** done" +status=3D0 \ No newline at end of file diff --git a/tests/qemu-iotests/191.out b/tests/qemu-iotests/191.out new file mode 100644 index 0000000..a8b0dbb --- /dev/null +++ b/tests/qemu-iotests/191.out @@ -0,0 +1,33 @@ +QA output created by 191 +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 + +Successfully Added Guest +Successfully Added Drive + +=3D=3D Creating backup =3D=3D +Backup Started +*virtio0 +Backup Complete +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) Formatting 'TEST_DIR/virtio0', fmt=3Dqcow2 size=3D134217728 cluster= _size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +quit + +=3D=3D Comparing images =3D=3D +Images are identical. + +=3D=3D Writing Pattern =3D=3D +QEMU X.Y.Z monitor - type 'help' for more information +(qemu) qemu-io virtio0 "write -P 0x22 0 1M" + +=3D=3D Creating backup =3D=3D +Backup Started +*virtio0 +Backup Complete +wrote 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +(qemu) Formatting 'TEST_DIR/virtio0', fmt=3Dqcow2 size=3D134217728 cluster= _size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +quit + +=3D=3D Comparing images =3D=3D +Images are identical. +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index afbdc42..bfff383 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -187,3 +187,4 @@ 189 rw auto 190 rw auto quick 192 rw auto quick +193 rw auto --=20 2.7.4