From patchwork Sun Feb 12 01:36:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 9568243 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 B77C060476 for ; Sun, 12 Feb 2017 01:43:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A867B284CE for ; Sun, 12 Feb 2017 01:43:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BFB428590; Sun, 12 Feb 2017 01:43:08 +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.9 required=2.0 tests=BAYES_00,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 40746284CE for ; Sun, 12 Feb 2017 01:43:08 +0000 (UTC) Received: from localhost ([::1]:50244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccjBz-0002aR-5M for patchwork-qemu-devel@patchwork.kernel.org; Sat, 11 Feb 2017 20:43:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccj6R-0005NN-N1 for qemu-devel@nongnu.org; Sat, 11 Feb 2017 20:37:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccj6Q-00077I-KR for qemu-devel@nongnu.org; Sat, 11 Feb 2017 20:37:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46700) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ccj6N-00076e-F0; Sat, 11 Feb 2017 20:37:19 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 95C13C056800; Sun, 12 Feb 2017 01:37:19 +0000 (UTC) Received: from localhost (ovpn-204-18.brq.redhat.com [10.40.204.18]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1C1bHqB013082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 11 Feb 2017 20:37:19 -0500 From: Max Reitz To: qemu-block@nongnu.org Date: Sun, 12 Feb 2017 02:36:51 +0100 Message-Id: <20170212013704.6378-6-mreitz@redhat.com> In-Reply-To: <20170212013704.6378-1-mreitz@redhat.com> References: <20170212013440.5919-1-mreitz@redhat.com> <20170212013704.6378-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 12 Feb 2017 01:37:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/21] qemu-iotests: Don't create fifos / pidfiles with protocol paths 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: Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Jeff Cody Trying to create, use, and remove fifos and pidfiles on protocol paths (e.g. nfs://localhost/scratch/qemu-nbd.pid) is obviously broken. Use the local $TEST_DIR path before it is 'protocolized' for these files. Signed-off-by: Jeff Cody Message-id: bb4a731a35bc4ac81fe3db17479dd686315317c7.1485392617.git.jcody@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- tests/qemu-iotests/common.config | 6 ++++-- tests/qemu-iotests/common.qemu | 10 +++++----- tests/qemu-iotests/common.rc | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config index f6384fbae7..55527aac87 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -109,7 +109,7 @@ _qemu_wrapper() { ( if [ -n "${QEMU_NEED_PID}" ]; then - echo $BASHPID > "${TEST_DIR}/qemu-${_QEMU_HANDLE}.pid" + echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid" fi exec "$QEMU_PROG" $QEMU_OPTIONS "$@" ) @@ -151,7 +151,7 @@ _qemu_io_wrapper() _qemu_nbd_wrapper() { ( - echo $BASHPID > "${TEST_DIR}/qemu-nbd.pid" + echo $BASHPID > "${QEMU_TEST_DIR}/qemu-nbd.pid" exec "$QEMU_NBD_PROG" $QEMU_NBD_OPTIONS "$@" ) } @@ -186,6 +186,8 @@ if [ -z "$TEST_DIR" ]; then TEST_DIR=`pwd`/scratch fi +QEMU_TEST_DIR="${TEST_DIR}" + if [ ! -e "$TEST_DIR" ]; then mkdir "$TEST_DIR" fi diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu index e657361790..42787896af 100644 --- a/tests/qemu-iotests/common.qemu +++ b/tests/qemu-iotests/common.qemu @@ -27,8 +27,8 @@ QEMU_COMM_TIMEOUT=10 -QEMU_FIFO_IN="${TEST_DIR}/qmp-in-$$" -QEMU_FIFO_OUT="${TEST_DIR}/qmp-out-$$" +QEMU_FIFO_IN="${QEMU_TEST_DIR}/qmp-in-$$" +QEMU_FIFO_OUT="${QEMU_TEST_DIR}/qmp-out-$$" QEMU_HANDLE=0 @@ -204,9 +204,9 @@ function _cleanup_qemu() for i in "${!QEMU_OUT[@]}" do local QEMU_PID - if [ -f "${TEST_DIR}/qemu-${i}.pid" ]; then - read QEMU_PID < "${TEST_DIR}/qemu-${i}.pid" - rm -f "${TEST_DIR}/qemu-${i}.pid" + if [ -f "${QEMU_TEST_DIR}/qemu-${i}.pid" ]; then + read QEMU_PID < "${QEMU_TEST_DIR}/qemu-${i}.pid" + rm -f "${QEMU_TEST_DIR}/qemu-${i}.pid" if [ -z "${wait}" ] && [ -n "${QEMU_PID}" ]; then kill -KILL ${QEMU_PID} 2>/dev/null fi diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 3213765f4e..4bb9b77807 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -193,11 +193,11 @@ _cleanup_test_img() case "$IMGPROTO" in nbd) - if [ -f "${TEST_DIR}/qemu-nbd.pid" ]; then + if [ -f "${QEMU_TEST_DIR}/qemu-nbd.pid" ]; then local QEMU_NBD_PID - read QEMU_NBD_PID < "${TEST_DIR}/qemu-nbd.pid" + read QEMU_NBD_PID < "${QEMU_TEST_DIR}/qemu-nbd.pid" kill ${QEMU_NBD_PID} - rm -f "${TEST_DIR}/qemu-nbd.pid" + rm -f "${QEMU_TEST_DIR}/qemu-nbd.pid" fi rm -f "$TEST_IMG_FILE" ;;