From patchwork Wed Oct 12 08:55:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hao QingFeng X-Patchwork-Id: 9372303 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 4537660772 for ; Wed, 12 Oct 2016 09:21:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3425F2924F for ; Wed, 12 Oct 2016 09:21:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 287CD293FB; Wed, 12 Oct 2016 09:21:45 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 829DA2924F for ; Wed, 12 Oct 2016 09:21:44 +0000 (UTC) Received: from localhost ([::1]:60225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buFjL-00028v-Ff for patchwork-qemu-devel@patchwork.kernel.org; Wed, 12 Oct 2016 05:21:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buFJf-0005at-6X for qemu-devel@nongnu.org; Wed, 12 Oct 2016 04:55:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buFJZ-0004Fh-2K for qemu-devel@nongnu.org; Wed, 12 Oct 2016 04:55:10 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36225 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buFJY-0004FT-TH for qemu-devel@nongnu.org; Wed, 12 Oct 2016 04:55:05 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9C8sPGW049932 for ; Wed, 12 Oct 2016 04:55:04 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 261djycym8-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 12 Oct 2016 04:55:03 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Oct 2016 02:55:03 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 12 Oct 2016 02:55:00 -0600 Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 271801FF0021; Wed, 12 Oct 2016 02:54:40 -0600 (MDT) Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9C8sxWj15794496; Wed, 12 Oct 2016 08:54:59 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 08BC312403D; Wed, 12 Oct 2016 04:54:59 -0400 (EDT) Received: from [9.119.157.118] (unknown [9.119.157.118]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id DBC45124037; Wed, 12 Oct 2016 04:54:56 -0400 (EDT) To: Max Reitz , qemu-block@nongnu.org References: <20160928204644.11523-1-mreitz@redhat.com> From: Hao QingFeng Date: Wed, 12 Oct 2016 16:55:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20160928204644.11523-1-mreitz@redhat.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16101208-0012-0000-0000-000010DD3E47 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005897; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000186; SDB=6.00767285; UDB=6.00367112; IPR=6.00543442; BA=6.00004803; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012960; XFM=3.00000011; UTC=2016-10-12 08:55:01 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101208-0013-0000-0000-0000463D1560 Message-Id: <1b3f7281-eaa6-586b-0f3c-f30cebf88322@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-12_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610120147 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id u9C8sPGW049932 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v4 0/3] iotests: Fix test 162 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: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi , Sascha Silbe Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Max, Just a common question for this case, if sshx block driver wasn't built into qemu-img, this case would fail as below: exec /home/haoqf/KVMonz/qemu/tests/qemu-iotests/../../qemu-img info --image-opts driver=ssh,host=localhost,port=0.42,path=/foo qemu-img: Could not open 'driver=ssh,host=localhost,port=0.42,path=/foo': Unknown driver 'ssh' Adding 162.notrun can bypass this case but it would skip it even if qemu-img has sshx block driver, in which case I think it should be run. So How about adding a script to dynamically check at runtime if the current env qemu-img can meet the requirement to run the test or not? I made a sample here whose result is: [Without sshx built in] ./check -qcow2 162 ... ... 162 0s ... [not run] case 162 not applicable! Not run: 162 Passed all 0 tests [Without sshx built in] ./check -qcow2 162 ... ... 162 0s ... Passed all 1 tests Rough code patch is(new file 162.check is introduced to check if sshx is built in): + exit 0 +fi + +exit 1 Thanks! Hao QingFeng 在 2016-09-29 4:46, Max Reitz 写道: > 162 is potentially racy and makes some invalid assumptions about what > should happen when connecting to a non-existing domain name. This series > fixes both issues. > > > v4: > - Added documentation for the new --fork option [Kevin] > > > git-backport-diff against v3: > > Key: > [----] : patches are identical > [####] : number of functional differences between upstream/downstream > patch > [down] : patch is downstream-only > The flags [FC] indicate (F)unctional and (C)ontextual differences, > respectively > > 001/3:[0004] [FC] 'qemu-nbd: Add --fork option' > 002/3:[----] [--] 'iotests: Remove raciness from 162' > 003/3:[----] [--] 'iotests: Do not rely on unavailable domains in 162' > > > Max Reitz (3): > qemu-nbd: Add --fork option > iotests: Remove raciness from 162 > iotests: Do not rely on unavailable domains in 162 > > qemu-nbd.c | 17 ++++++++++++++++- > qemu-nbd.texi | 2 ++ > tests/qemu-iotests/162 | 22 ++++++++++++++++------ > tests/qemu-iotests/162.out | 2 +- > 4 files changed, 35 insertions(+), 8 deletions(-) > diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 4cba215..e7ef395 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -18,7 +18,6 @@ # # Control script for QA # - status=0 needwrap=true try=0 @@ -291,6 +290,24 @@ do start=`_wallclock` $timestamp && echo -n " ["`date "+%T"`"]" + check_ret=0 + if [ -f "$source_iotests/$seq.check" -a -x "$source_iotests/$seq.check" ]; then + if [ "$(head -n 1 "$source_iotests/$seq.check")" == "#!/usr/bin/env python" ]; then + $PYTHON $seq.check + else + ./$seq.check + fi + check_ret=$? + fi + if [ $check_ret -ne 0 ]; then + $timestamp || echo -n " [not run] " + $timestamp && echo " [not run]" && echo -n " $seq -- " + echo "case $seq not applicable!" + notrun="$notrun $seq" + seq="after_$seq" + continue + fi + if [ "$(head -n 1 "$source_iotests/$seq")" == "#!/usr/bin/env python" ]; then run_command="$PYTHON $seq" else diff --git a/tests/qemu-iotests/162.check b/tests/qemu-iotests/162.check new file mode 100755 index 0000000..a80df7a --- /dev/null +++ b/tests/qemu-iotests/162.check @@ -0,0 +1,35 @@ +#!/bin/bash +#Return 0 if the case can run, others can not +#Typically the block drivers can be queried by "qemu-img --help" and +#the output is as: +#Supported formats: dmg luks ssh sheepdog nbd null-aio null-co host_cdrom host_device file blkreplay blkverify blkdebug parallels quorum qed qcow2 vvfat vpc bochs cloop vmdk vdi qcow raw +#set -x + +#. ./common.config +found=0 +. ./common.rc +. ./common.filter +#_supported_fmt generic +#_supported_os Linux +blk_drivers=`$QEMU_IMG --help|grep "Supported formats:"|sed 's/Supported formats://'` +#echo "drivers:"$blk_drivers +#echo $blk_drivers|awk '{print $0}' +found=$( +echo $blk_drivers|awk '{n=split($0, arr_drivers, " "); + for(i=1; i<=n; i++) print arr_drivers[i]}' | { while read driver + do + if [ "$driver"x = "sshx" ]; then + echo 1 + exit + fi + done + echo 0 + } +) + +#echo "ret:$found" +if [ "$found" = "1" ]; then