From patchwork Tue Nov 8 00:59:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashish Mittal X-Patchwork-Id: 9416303 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C11BC6048F for ; Tue, 8 Nov 2016 01:04:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B28AE28E88 for ; Tue, 8 Nov 2016 01:04:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A39EB28E8F; Tue, 8 Nov 2016 01:04:42 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 E8CAF28E88 for ; Tue, 8 Nov 2016 01:04:41 +0000 (UTC) Received: from localhost ([::1]:57553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3uq9-0000zk-5w for patchwork-qemu-devel@patchwork.kernel.org; Mon, 07 Nov 2016 20:04:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3um0-0006eA-7G for qemu-devel@nongnu.org; Mon, 07 Nov 2016 20:00:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3ulz-0004dW-3q for qemu-devel@nongnu.org; Mon, 07 Nov 2016 20:00:24 -0500 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:35196) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c3uly-0004dK-VL for qemu-devel@nongnu.org; Mon, 07 Nov 2016 20:00:23 -0500 Received: by mail-qk0-x243.google.com with SMTP id n204so13137244qke.2 for ; Mon, 07 Nov 2016 17:00:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aQcxcoWOHTZE0Ov41f4fCm6X6c405T2/0UbtvLcvlRU=; b=gIVMf2teeMCBqhbm1lgd8JX6RkQfYYybtYT6ijrb958HnTTlhjCazup08FhnKfiUy+ rqTWWvhlluRZFgQ7mfXpeHUug6EYFvVxpNWVfn0i7Rj5IDm6fW30znqki5QE0loWYpa6 fim8iPhOd+QAKTq1ceKveznKUNVsCFkEXEKaIVJsvPSjJkGyBv+gwUrp9q0nau37P50b niqG7fWouSWRHbTfVamjen7TD1EnCZMhvnmYYsKmSjfJ+YvC9ZEvBcnPArIPG3NqRA7H veT4O125tjkkG6gcaiFKlCPhrNBBga65Ss3C/jh6ZPLOzsNnC0YabJ9f2QAiztexKtT2 SXIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aQcxcoWOHTZE0Ov41f4fCm6X6c405T2/0UbtvLcvlRU=; b=Q2U3heDTJXj+cs2LXbuCpAL/GWKf3Lh82sPzDqrxcZ3ij4FYDMtDWn8Hd4g8Oqgty3 CVqm0vm29nBEDiNbvaWrgtlKXX4g6FM4+dl7Yd0RbTgM0eaXuF3n29mQwuMF1UruyCAT kq76/YHJYojcOFlr4IIqI1W4bZkzFuPSk7DGrOfLHaf3mGZVSxdzsrEGZTP2xZ2HegK1 UlK/6Iw4kK1cAm+hAHqPnhmCtt+ox2BsWsBzpnPToAVeW52qrPLdXEm/D7EngU1OfW28 a8axaAQPGP6ELHBLPtLo2HjmX1x3qbhleAXmSAR2V87uVgYKp0Fz1MESbiUkOfY7X2yv c3pg== X-Gm-Message-State: ABUngvd7uboXilyaQ+0la3PwVnOur0CwbsTnVg0lQOiKfmodJSgUni6la7pdTinfbuInYQ== X-Received: by 10.55.182.65 with SMTP id g62mr9843306qkf.6.1478566822292; Mon, 07 Nov 2016 17:00:22 -0800 (PST) Received: from localhost.localdomain.localdomain ([172.58.67.112]) by smtp.gmail.com with ESMTPSA id q53sm18001796qtq.0.2016.11.07.17.00.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 17:00:21 -0800 (PST) From: Ashish Mittal X-Google-Original-From: Ashish Mittal To: qemu-devel@nongnu.org, pbonzini@redhat.com, kwolf@redhat.com, armbru@redhat.com, berrange@redhat.com, jcody@redhat.com, famz@redhat.com, ashish.mittal@veritas.com, stefanha@gmail.com, Rakesh.Ranjan@veritas.com, Buddhi.Madhav@veritas.com Date: Mon, 7 Nov 2016 16:59:45 -0800 Message-Id: <1478566785-4002-3-git-send-email-ashish.mittal@veritas.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1478566785-4002-1-git-send-email-ashish.mittal@veritas.com> References: <1478566785-4002-1-git-send-email-ashish.mittal@veritas.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH v6 2/2] block/vxhs.c: Add qemu-iotests for new block device type "vxhs" 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: Ketan.Nilangekar@veritas.com, Abhijit.Dey@veritas.com, Venkatesha.Mg@veritas.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP These changes use a vxhs test server that is a part of the following repository: https://github.com/MittalAshish/libqnio.git Signed-off-by: Ashish Mittal --- v6 changelog: (1) Added iotests for VxHS block device. tests/qemu-iotests/common | 6 ++++++ tests/qemu-iotests/common.config | 13 +++++++++++++ tests/qemu-iotests/common.filter | 1 + tests/qemu-iotests/common.rc | 19 +++++++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index d60ea2c..41430d8 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -158,6 +158,7 @@ check options -nfs test nfs -archipelago test archipelago -luks test luks + -vxhs test vxhs -xdiff graphical mode diff -nocache use O_DIRECT on backing file -misalign misalign memory allocations @@ -261,6 +262,11 @@ testlist options xpand=false ;; + -vxhs) + IMGPROTO=vxhs + xpand=false + ;; + -ssh) IMGPROTO=ssh xpand=false diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config index f6384fb..c7a80c0 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -105,6 +105,10 @@ if [ -z "$QEMU_NBD_PROG" ]; then export QEMU_NBD_PROG="`set_prog_path qemu-nbd`" fi +if [ -z "$QEMU_VXHS_PROG" ]; then + export QEMU_VXHS_PROG="`set_prog_path qnio_server /usr/local/bin`" +fi + _qemu_wrapper() { ( @@ -156,10 +160,19 @@ _qemu_nbd_wrapper() ) } +_qemu_vxhs_wrapper() +{ + ( + echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid" + exec "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@" + ) +} + export QEMU=_qemu_wrapper export QEMU_IMG=_qemu_img_wrapper export QEMU_IO=_qemu_io_wrapper export QEMU_NBD=_qemu_nbd_wrapper +export QEMU_VXHS=_qemu_vxhs_wrapper QEMU_IMG_EXTRA_ARGS= if [ "$IMGOPTSSYNTAX" = "true" ]; then diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter index 240ed06..a8a4d0e 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -123,6 +123,7 @@ _filter_img_info() -e "s#$TEST_DIR#TEST_DIR#g" \ -e "s#$IMGFMT#IMGFMT#g" \ -e 's#nbd://127.0.0.1:10810$#TEST_DIR/t.IMGFMT#g' \ + -e 's#json.*vdisk-id.*vxhs"}}#TEST_DIR/t.IMGFMT#' \ -e "/encrypted: yes/d" \ -e "/cluster_size: [0-9]\\+/d" \ -e "/table_size: [0-9]\\+/d" \ diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 3213765..06a3164 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -89,6 +89,9 @@ else TEST_IMG=$TEST_DIR/t.$IMGFMT elif [ "$IMGPROTO" = "archipelago" ]; then TEST_IMG="archipelago:at.$IMGFMT" + elif [ "$IMGPROTO" = "vxhs" ]; then + TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT + TEST_IMG="vxhs://127.0.0.1:9999/t.$IMGFMT" else TEST_IMG=$IMGPROTO:$TEST_DIR/t.$IMGFMT fi @@ -175,6 +178,12 @@ _make_test_img() eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT $TEST_IMG_FILE &" sleep 1 # FIXME: qemu-nbd needs to be listening before we continue fi + + # Start QNIO server on image directory for vxhs protocol + if [ $IMGPROTO = "vxhs" ]; then + eval "$QEMU_VXHS -d $TEST_DIR &" + sleep 1 # Wait for server to come up. + fi } _rm_test_img() @@ -201,6 +210,16 @@ _cleanup_test_img() fi rm -f "$TEST_IMG_FILE" ;; + vxhs) + if [ -f "${TEST_DIR}/qemu-vxhs.pid" ]; then + local QEMU_VXHS_PID + read QEMU_VXHS_PID < "${TEST_DIR}/qemu-vxhs.pid" + kill ${QEMU_VXHS_PID} >/dev/null 2>&1 + rm -f "${TEST_DIR}/qemu-vxhs.pid" + fi + rm -f "$TEST_IMG_FILE" + ;; + file) _rm_test_img "$TEST_DIR/t.$IMGFMT" _rm_test_img "$TEST_DIR/t.$IMGFMT.orig"