{"id":807173,"url":"http://patchwork.ozlabs.org/api/1.0/patches/807173/?format=json","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.0/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<1504025019-16820-3-git-send-email-chugh.ishani@research.iiit.ac.in>","date":"2017-08-29T16:43:38","name":"[v2,2/3] Test for full Backup","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"6400ece2a262f648a3c7266fb18b48e874153ac3","submitter":{"id":71382,"url":"http://patchwork.ozlabs.org/api/1.0/people/71382/?format=json","name":"Ishani","email":"chugh.ishani@research.iiit.ac.in"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/1504025019-16820-3-git-send-email-chugh.ishani@research.iiit.ac.in/mbox/","series":[{"id":406,"url":"http://patchwork.ozlabs.org/api/1.0/series/406/?format=json","date":"2017-08-29T16:43:37","name":"QEMU Backup Tool","version":2,"mbox":"http://patchwork.ozlabs.org/series/406/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/807173/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=research.iiit.ac.in\n\theader.i=@research.iiit.ac.in header.b=\"ha/Nfv+y\"; \n\tdkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhZMH49V7z9t3F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 02:48:11 +1000 (AEST)","from localhost ([::1]:46085 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dmjgP-00031r-GE\n\tfor incoming@patchwork.ozlabs.org; Tue, 29 Aug 2017 12:48:09 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:46298)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <chugh.ishani@research.iiit.ac.in>)\n\tid 1dmjcE-0008Dq-6D\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 12:43:51 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <chugh.ishani@research.iiit.ac.in>)\n\tid 1dmjcC-0006EW-J5\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 12:43:50 -0400","from research.iiit.ac.in ([196.12.53.8]:43476)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <chugh.ishani@research.iiit.ac.in>)\n\tid 1dmjcB-0006DV-TF\n\tfor qemu-devel@nongnu.org; Tue, 29 Aug 2017 12:43:48 -0400","from localhost (localhost [127.0.0.1])\n\tby research.iiit.ac.in (Postfix) with ESMTP id 85A63741EE1;\n\tTue, 29 Aug 2017 22:13:45 +0530 (IST)","from research.iiit.ac.in ([127.0.0.1])\n\tby localhost (research.iiit.ac.in [127.0.0.1]) (amavisd-new,\n\tport 10032)\n\twith ESMTP id PG7On54zmYyy; Tue, 29 Aug 2017 22:13:38 +0530 (IST)","from localhost (localhost [127.0.0.1])\n\tby research.iiit.ac.in (Postfix) with ESMTP id 8BC9F744E27;\n\tTue, 29 Aug 2017 22:13:38 +0530 (IST)","from research.iiit.ac.in ([127.0.0.1])\n\tby localhost (research.iiit.ac.in [127.0.0.1]) (amavisd-new,\n\tport 10026)\n\twith ESMTP id sqNpnXIKVnzA; Tue, 29 Aug 2017 22:13:38 +0530 (IST)","from ishani-Inspiron-5558.iiit.ac.in (unknown [10.2.20.52])\n\tby research.iiit.ac.in (Postfix) with ESMTPSA id 73F79741F3C;\n\tTue, 29 Aug 2017 22:13:38 +0530 (IST)"],"DKIM-Filter":"OpenDKIM Filter v2.9.2 research.iiit.ac.in 8BC9F744E27","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=research.iiit.ac.in; \n\ts=4E8815E6-5B55-11E4-B758-8D4964374E96; t=1504025018;\n\tbh=WviRmQ1FmuEIxZkwInEu3U6Wik6TZc/kUTVc2BActd8=;\n\th=From:To:Subject:Date:Message-Id;\n\tb=ha/Nfv+yNwoHEAIY7T24u5a6pSJsUDRhdNIjFBWbv1A/TnHUx9Arg2tcDSiMqZUMF\n\tM0VOVmdtVIisFTtUoz70J5glFn6rzgGpw9PUT6Lw0hTwH/kJvMlZgkB0Rkj6w5AzGQ\n\tKM2wPpEAyKSi5wE7O+yK2TsC30gbWIkH/xIQy22I=","X-Virus-Scanned":"amavisd-new at research.iiit.ac.in","From":"Ishani Chugh <chugh.ishani@research.iiit.ac.in>","To":"qemu-devel@nongnu.org","Date":"Tue, 29 Aug 2017 22:13:38 +0530","Message-Id":"<1504025019-16820-3-git-send-email-chugh.ishani@research.iiit.ac.in>","X-Mailer":"git-send-email 2.7.4","In-Reply-To":"<1504025019-16820-1-git-send-email-chugh.ishani@research.iiit.ac.in>","References":"<1504025019-16820-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]\n\t[fuzzy]","X-Received-From":"196.12.53.8","Subject":"[Qemu-devel] [PATCH v2 2/3] Test for full Backup","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Ishani Chugh <chugh.ishani@research.iiit.ac.in>, jsnow@redhat.com,\n\tstefanha@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"This patch is the test for full backup implementation in Backup tool.\nThe test employs two basic substests:\n1) Backing up an empty guest and comparing it with base image.\n2) Writing a pattern to the guest, creating backup and comparing\n   with the base image.\n\nSigned-off-by: Ishani Chugh <chugh.ishani@research.iiit.ac.in>\n---\n tests/qemu-iotests/191     | 86 ++++++++++++++++++++++++++++++++++++++++++++++\n tests/qemu-iotests/191.out | 35 +++++++++++++++++++\n tests/qemu-iotests/group   |  2 ++\n 3 files changed, 123 insertions(+)\n create mode 100755 tests/qemu-iotests/191\n create mode 100644 tests/qemu-iotests/191.out","diff":"diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191\nnew file mode 100755\nindex 0000000..16988d8\n--- /dev/null\n+++ b/tests/qemu-iotests/191\n@@ -0,0 +1,86 @@\n+#!/bin/bash\n+#\n+# Test full backup functionality of qemu-backup tool\n+#\n+# Copyright (C) 2017 Ishani Chugh <chugh.ishani@research.iiit.ac.in>\n+#\n+# This program is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+#\n+\n+# creator\n+owner=chugh.ishani@research.iiit.ac.in\n+\n+seq=`basename $0`\n+echo \"QA output created by $seq\"\n+\n+here=`pwd`\n+status=1\t# failure is the default!\n+\n+\n+# get standard environment, filters and checks\n+. ./common.rc\n+. ./common.filter\n+. ./common.qemu\n+\n+_supported_fmt generic\n+_supported_proto generic\n+_supported_os Linux\n+\n+_cleanup()\n+{\n+        rm -f \"$TEST_DIR\"/virtio0\n+        rm -f \"$CONFIG_FILE\"\n+}\n+trap \"_cleanup; exit \\$status\" 0 1 2 3 15\n+\n+CONFIG_FILE=\"$TEST_DIR\"/backup-config\n+SOCKET=unix:\"$TEST_DIR\"/backup_socket\n+size=128M\n+\n+_make_test_img \"$size\"\n+export QEMU_BACKUP_CONFIG=\"$CONFIG_FILE\"\n+qemu_comm_method=\"monitor\"\n+echo\n+_launch_qemu -drive if=virtio,file=\"$TEST_IMG\" -qmp \"$SOCKET\",server,nowait\n+$PYTHON ../../contrib/backup/qemu-backup.py guest add --guest adad --qmp \"$SOCKET\"\n+$PYTHON ../../contrib/backup/qemu-backup.py drive add --id virtio0 --guest adad --target \"$TEST_DIR\"/virtio0\n+echo\n+echo \"== Creating backup ==\"\n+$PYTHON ../../contrib/backup/qemu-backup.py backup --guest adad\n+_send_qemu_cmd $QEMU_HANDLE 'quit' ''\n+wait=1 _cleanup_qemu\n+echo\n+echo \"== Comparing images ==\"\n+$QEMU_IMG compare \"$TEST_DIR\"/virtio0 \"$TEST_IMG\"\n+_cleanup\n+\n+_launch_qemu -drive if=virtio,id=virtio0,file=\"$TEST_IMG\" -qmp \"$SOCKET\",server,nowait\n+$PYTHON ../../contrib/backup/qemu-backup.py guest add --guest adad --qmp \"$SOCKET\"\n+$PYTHON ../../contrib/backup/qemu-backup.py drive add --id virtio0 --guest adad --target \"$TEST_DIR\"/virtio0\n+echo\n+echo \"== Writing Pattern ==\"\n+_send_qemu_cmd $QEMU_HANDLE 'qemu-io virtio0 \"write -P 0x22 0 1M\"' \"(qemu)\" | _filter_qemu_io\n+echo\n+echo \"== Creating backup ==\"\n+$PYTHON ../../contrib/backup/qemu-backup.py backup --guest adad\n+_send_qemu_cmd $QEMU_HANDLE 'quit' ''\n+wait=1 _cleanup_qemu\n+echo\n+echo \"== Comparing images ==\"\n+$QEMU_IMG compare \"$TEST_DIR\"/virtio0 \"$TEST_IMG\"\n+_cleanup\n+_cleanup_test_img\n+\n+echo \"*** done\"\n+status=0\n\\ No newline at end of file\ndiff --git a/tests/qemu-iotests/191.out b/tests/qemu-iotests/191.out\nnew file mode 100644\nindex 0000000..c60d47a\n--- /dev/null\n+++ b/tests/qemu-iotests/191.out\n@@ -0,0 +1,35 @@\n+QA output created by 191\n+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728\n+\n+Successfully Added Guest\n+Successfully Added Drive\n+\n+== Creating backup ==\n+Backup Started\n+*virtio0\n+Backup Complete\n+QEMU X.Y.Z monitor - type 'help' for more information\n+(qemu) Formatting 'TEST_DIR/virtio0', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16\n+quit\n+\n+== Comparing images ==\n+Images are identical.\n+Successfully Added Guest\n+Successfully Added Drive\n+\n+== Writing Pattern ==\n+QEMU X.Y.Z monitor - type 'help' for more information\n+(qemu) qemu-io virtio0 \"write -P 0x22 0 1M\"\n+\n+== Creating backup ==\n+Backup Started\n+*virtio0\n+Backup Complete\n+wrote 1048576/1048576 bytes at offset 0\n+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n+(qemu) Formatting 'TEST_DIR/virtio0', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16\n+quit\n+\n+== Comparing images ==\n+Images are identical.\n+*** done\ndiff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group\nindex afbdc42..66fa231 100644\n--- a/tests/qemu-iotests/group\n+++ b/tests/qemu-iotests/group\n@@ -186,4 +186,6 @@\n 188 rw auto quick\n 189 rw auto\n 190 rw auto quick\n+191 rw auto\n 192 rw auto quick\n+193 rw auto\n","prefixes":["v2","2/3"]}