From patchwork Tue Oct 17 16:31:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Cody X-Patchwork-Id: 10012429 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 97135600CC for ; Tue, 17 Oct 2017 16:34:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B7F828999 for ; Tue, 17 Oct 2017 16:34:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 803B72899C; Tue, 17 Oct 2017 16:34:05 +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 C7D7D28999 for ; Tue, 17 Oct 2017 16:34:04 +0000 (UTC) Received: from localhost ([::1]:40452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Uod-0006y2-Tn for patchwork-qemu-devel@patchwork.kernel.org; Tue, 17 Oct 2017 12:34:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4UnB-0006ui-BC for qemu-devel@nongnu.org; Tue, 17 Oct 2017 12:32:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4Un9-0006SR-N4 for qemu-devel@nongnu.org; Tue, 17 Oct 2017 12:32:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e4Un4-0006LO-So; Tue, 17 Oct 2017 12:32:27 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B9E07EAA1; Tue, 17 Oct 2017 16:32:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6B9E07EAA1 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jcody@redhat.com Received: from localhost (ovpn-117-62.phx2.redhat.com [10.3.117.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A885649A8; Tue, 17 Oct 2017 16:32:20 +0000 (UTC) From: Jeff Cody To: qemu-devel@nongnu.org Date: Tue, 17 Oct 2017 12:31:51 -0400 Message-Id: <24c7d85bd96b8cbf02bf60dabc0787724c19b18b.1508257445.git.jcody@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 17 Oct 2017 16:32:25 +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] [PATCH v5 06/10] qemu-iotests: make ./check automatically reap QEMU processes 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, jsnow@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Check will now take care of cleaning up all QEMU processes started from bash tests using the common.qemu framework. This also paves the way to added another check option to keep QEMU processes around, in the case of a failed test. Signed-off-by: Jeff Cody Reviewed-by: Eric Blake --- tests/qemu-iotests/085 | 2 -- tests/qemu-iotests/091 | 2 -- tests/qemu-iotests/094 | 2 -- tests/qemu-iotests/095 | 2 -- tests/qemu-iotests/102 | 2 -- tests/qemu-iotests/109 | 2 -- tests/qemu-iotests/117 | 2 -- tests/qemu-iotests/130 | 2 -- tests/qemu-iotests/140 | 2 -- tests/qemu-iotests/141 | 2 -- tests/qemu-iotests/143 | 2 -- tests/qemu-iotests/144 | 2 -- tests/qemu-iotests/146 | 2 -- tests/qemu-iotests/156 | 2 -- tests/qemu-iotests/173 | 2 -- tests/qemu-iotests/181 | 2 -- tests/qemu-iotests/183 | 2 -- tests/qemu-iotests/185 | 2 -- tests/qemu-iotests/191 | 6 ------ tests/qemu-iotests/check | 7 +++++-- 20 files changed, 5 insertions(+), 44 deletions(-) diff --git a/tests/qemu-iotests/085 b/tests/qemu-iotests/085 index 7b69f86..283f9a9 100755 --- a/tests/qemu-iotests/085 +++ b/tests/qemu-iotests/085 @@ -37,8 +37,6 @@ snapshot_virt1="snapshot-v1.qcow2" SNAPSHOTS=10 -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/091 b/tests/qemu-iotests/091 index c4df2fb..cc4c50c 100755 --- a/tests/qemu-iotests/091 +++ b/tests/qemu-iotests/091 @@ -31,8 +31,6 @@ status=1 # failure is the default! MIG_FIFO="${TEST_DIR}/migrate" -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/094 b/tests/qemu-iotests/094 index 35e882c..1587550 100755 --- a/tests/qemu-iotests/094 +++ b/tests/qemu-iotests/094 @@ -27,8 +27,6 @@ echo "QA output created by $seq" here="$PWD" status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/095 b/tests/qemu-iotests/095 index 75d60c4..2891014 100755 --- a/tests/qemu-iotests/095 +++ b/tests/qemu-iotests/095 @@ -30,8 +30,6 @@ echo "QA output created by $seq" here=`pwd` status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/102 b/tests/qemu-iotests/102 index 201c520..2980638 100755 --- a/tests/qemu-iotests/102 +++ b/tests/qemu-iotests/102 @@ -27,8 +27,6 @@ echo "QA output created by $seq" here=$PWD status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and qemu instance handling . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109 index d4fca99..2f6e456 100755 --- a/tests/qemu-iotests/109 +++ b/tests/qemu-iotests/109 @@ -27,8 +27,6 @@ echo "QA output created by $seq" here="$PWD" status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/117 b/tests/qemu-iotests/117 index 579cecb..a427ee7 100755 --- a/tests/qemu-iotests/117 +++ b/tests/qemu-iotests/117 @@ -27,8 +27,6 @@ echo "QA output created by $seq" here="$PWD" status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130 index 4aad4ea..3610738 100755 --- a/tests/qemu-iotests/130 +++ b/tests/qemu-iotests/130 @@ -29,8 +29,6 @@ echo "QA output created by $seq" here="$PWD" status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/140 b/tests/qemu-iotests/140 index c5e1a5b..ec79402 100755 --- a/tests/qemu-iotests/140 +++ b/tests/qemu-iotests/140 @@ -31,8 +31,6 @@ echo "QA output created by $seq" here="$PWD" status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141 index cff2319..39b75a4 100755 --- a/tests/qemu-iotests/141 +++ b/tests/qemu-iotests/141 @@ -27,8 +27,6 @@ echo "QA output created by $seq" here="$PWD" status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/143 b/tests/qemu-iotests/143 index b4736aa..e107ae3 100755 --- a/tests/qemu-iotests/143 +++ b/tests/qemu-iotests/143 @@ -27,8 +27,6 @@ echo "QA output created by $seq" here="$PWD" status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/144 b/tests/qemu-iotests/144 index b47c561..8b55d33 100755 --- a/tests/qemu-iotests/144 +++ b/tests/qemu-iotests/144 @@ -32,8 +32,6 @@ status=1 # failure is the default! TMP_SNAP1=${TEST_DIR}/tmp.qcow2 TMP_SNAP2=${TEST_DIR}/tmp2.qcow2 -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/146 b/tests/qemu-iotests/146 index 99b1e81..7dffe22 100755 --- a/tests/qemu-iotests/146 +++ b/tests/qemu-iotests/146 @@ -27,8 +27,6 @@ echo "QA output created by $seq" here=`pwd` status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156 index 9dbc6d7..26ebd73 100755 --- a/tests/qemu-iotests/156 +++ b/tests/qemu-iotests/156 @@ -35,8 +35,6 @@ echo "QA output created by $seq" here="$PWD" status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/173 b/tests/qemu-iotests/173 index 0c2fde4..933cd96 100755 --- a/tests/qemu-iotests/173 +++ b/tests/qemu-iotests/173 @@ -27,8 +27,6 @@ echo "QA output created by $seq" here=`pwd` status=1 # failure is the default! -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/181 b/tests/qemu-iotests/181 index 18fb133..e6f7908 100755 --- a/tests/qemu-iotests/181 +++ b/tests/qemu-iotests/181 @@ -29,8 +29,6 @@ status=1 # failure is the default! MIG_SOCKET="${TEST_DIR}/migrate" -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/183 b/tests/qemu-iotests/183 index 2e09679..cb82d3c 100755 --- a/tests/qemu-iotests/183 +++ b/tests/qemu-iotests/183 @@ -29,8 +29,6 @@ status=1 # failure is the default! MIG_SOCKET="${TEST_DIR}/migrate" -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/185 b/tests/qemu-iotests/185 index 7269d5e..ef4b1cd 100755 --- a/tests/qemu-iotests/185 +++ b/tests/qemu-iotests/185 @@ -29,8 +29,6 @@ status=1 # failure is the default! MIG_SOCKET="${TEST_DIR}/migrate" -trap "_cleanup_qemu; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/191 b/tests/qemu-iotests/191 index f97e580..7fc1365 100755 --- a/tests/qemu-iotests/191 +++ b/tests/qemu-iotests/191 @@ -29,12 +29,6 @@ status=1 # failure is the default! MIG_SOCKET="${TEST_DIR}/migrate" -_cleanup() -{ - _cleanup_qemu -} -trap "_cleanup; exit \$status" 0 1 2 3 15 - # get standard environment, filters and checks . ./common.rc . ./common.filter diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index b4ab646..057ea39 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -845,10 +845,13 @@ do # TEST_DIR / QEMU_TEST_DIR ( export TEST_DIR=$TEST_DIR_SEQ - . "$source_iotests/common.config" - . "$source_iotests/common.rc" + cd "$source_iotests"; + . ./common.config + . ./common.rc + . ./common.qemu _cleanup_protocols + _cleanup_qemu ) rm -rf "$TEST_DIR_SEQ"