From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502316125000338.08062619210136; Wed, 9 Aug 2017 15:02:05 -0700 (PDT) Received: from localhost ([::1]:50051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfZ3D-0008D4-O7 for importer@patchew.org; Wed, 09 Aug 2017 18:02:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwi-0002Pf-9f for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwe-0006Ro-CU for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:20 -0400 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:37205) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwe-0006RM-2p; Wed, 09 Aug 2017 17:55:16 -0400 Received: by mail-wm0-x22a.google.com with SMTP id i66so7330942wmg.0; Wed, 09 Aug 2017 14:55:15 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VPjsrDn9lVjE4jhOnkf8ZzhYgFvO+1wxDMY3V3lI2ns=; b=IFrwYmLmHqhxG1XNJF/UoNYd5VrDT0UiX7m/dskhepatzzD60RTYnmTw2ptoT54Ky0 jcd0wrQR8icRl9mE6VYyG6jorMZoOp7A2+Ma+cDMksDgp61zWUqCn2BGB+GlYv930EmF BVNBnrCbW6KaJp+NREF08iORJ93S8C602uLN7S9myPDRnfwnept3MnMtQI/fuZDZ7e7P p5Vac6jxeeXzm0+n6XXTxXMI9Ani3t8fRF/BQafiyFioZl7rmS0uIsKbglxC+TRduX6X 9E2unInPafLpOMpnRMImvoG0T/9D0qHCElWtnSZuo+3uNzRvB0H5R+/GoSkslaY6tJPk 6BvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=VPjsrDn9lVjE4jhOnkf8ZzhYgFvO+1wxDMY3V3lI2ns=; b=kjoJlMZ3I4mQTyjgdbQOzElBmPuJL/bTTAJb/TSpMvL+lwXYvEBCHoXTkbsLjel6tb /6EYsk1Si5SCXkVxmta1OW1+6P+T5gfJa41eKwnB0N+3GRGIVS53u2bVF5LhQrx8brjv vk/fH4Valy06Z9qznQsYS5jVYREJLfzpY4ifgnW9BvdonyotFRb9l3OZRcKDimAcKlrv 1GWFu++Gg2wWJIUtjRbj00niyCjHZNb0DIRnZA2S7Kl4Lz1Gz8cMc8BQ5r+/CmyJg9S8 FDWpo5d3njHp5br7GHL0LxmjjF0lfH8USQnsUY0sYZ1maSJC8UxUQPfO+ttVQd55ZuIy 04Ew== X-Gm-Message-State: AHYfb5jxqP1x6a5lv9qAx1KeR73uX2fKgqzAJ114Ytxwjc69i962Crt3 K/uKDXF0BwhHObB9ee0= X-Received: by 10.28.150.142 with SMTP id y136mr5729899wmd.51.1502315714464; Wed, 09 Aug 2017 14:55:14 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:54:59 +0200 Message-Id: <20170809215510.22802-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22a Subject: [Qemu-devel] [PATCH 01/12] qemu-iotests: remove dead code 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This includes shell function, shell variables, command line options (randomize.awk does not exist) and conditions that can never be true (./qemu does not exist anymore). Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake --- tests/qemu-iotests/check | 36 +-------------------- tests/qemu-iotests/common | 23 -------------- tests/qemu-iotests/common.config | 26 --------------- tests/qemu-iotests/common.rc | 68 ------------------------------------= ---- 4 files changed, 1 insertion(+), 152 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 2a55ec9ada..01fd5a26e5 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -65,8 +65,7 @@ then export SOCKET_SCM_HELPER=3D"$build_iotests/socket_scm_helper" fi =20 -# if ./qemu exists, it should be prioritized and will be chosen by common.= config -if [[ -z "$QEMU_PROG" && ! -x './qemu' ]] +if [[ -z "$QEMU_PROG" ]] then arch=3D$(uname -m 2> /dev/null) =20 @@ -123,12 +122,6 @@ fi # we need common . "$source_iotests/common" =20 -#if [ `id -u` -ne 0 ] -#then -# echo "check: QA must be run as root" -# exit 1 -#fi - TIMESTAMP_FILE=3Dcheck.time-$IMGPROTO-$IMGFMT =20 tmp=3D"${TEST_DIR}"/$$ @@ -146,12 +139,6 @@ _timestamp() =20 _wrapup() { - # for hangcheck ... - # remove files that were used by hangcheck - # - [ -f "${TEST_DIR}"/check.pid ] && rm -rf "${TEST_DIR}"/check.pid - [ -f "${TEST_DIR}"/check.sts ] && rm -rf "${TEST_DIR}"/check.sts - if $showme then : @@ -207,24 +194,6 @@ END { if (NR > 0) { =20 trap "_wrapup; exit \$status" 0 1 2 3 15 =20 -# for hangcheck ... -# Save pid of check in a well known place, so that hangcheck can be sure it -# has the right pid (getting the pid from ps output is not reliable enough= ). -# -rm -rf "${TEST_DIR}"/check.pid -echo $$ > "${TEST_DIR}"/check.pid - -# for hangcheck ... -# Save the status of check in a well known place, so that hangcheck can be -# sure to know where check is up to (getting test number from ps output is -# not reliable enough since the trace stuff has been introduced). -# -rm -rf "${TEST_DIR}"/check.sts -echo "preamble" > "${TEST_DIR}"/check.sts - -# don't leave old full output behind on a clean run -rm -f check.full - [ -f $TIMESTAMP_FILE ] || touch $TIMESTAMP_FILE =20 FULL_IMGFMT_DETAILS=3D`_full_imgfmt_details` @@ -287,9 +256,6 @@ do fi rm -f core $seq.notrun =20 - # for hangcheck ... - echo "$seq" > "${TEST_DIR}"/check.sts - start=3D`_wallclock` $timestamp && printf %s " [$(date "+%T")]" =20 diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index d34c11c056..867918895b 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -19,17 +19,6 @@ # common procedures for QA scripts # =20 -_setenvironment() -{ - MSGVERB=3D"text:action" - export MSGVERB -} - -rm -f "$OUTPUT_DIR/$iam.out" -_setenvironment - -check=3D${check-true} - diff=3D"diff -u" verbose=3Dfalse debug=3Dfalse @@ -40,7 +29,6 @@ showme=3Dfalse sortme=3Dfalse expunge=3Dtrue have_test_arg=3Dfalse -randomize=3Dfalse cachemode=3Dfalse rm -f $tmp.list $tmp.tmp $tmp.sed =20 @@ -170,7 +158,6 @@ other options -n show me, do not run tests -o options -o options to pass to qemu-img create/convert -T output timestamps - -r randomize test order -c mode cache mode =20 testlist options @@ -327,11 +314,6 @@ testlist options cachemode=3Dtrue xpand=3Dfalse ;; - -r) # randomize test order - randomize=3Dtrue - xpand=3Dfalse - ;; - -T) # turn on timestamp output timestamp=3Dtrue xpand=3Dfalse @@ -445,11 +427,6 @@ fi list=3D`sort $tmp.list` rm -f $tmp.list $tmp.tmp $tmp.sed =20 -if $randomize -then - list=3D`echo $list | awk -f randomize.awk` -fi - [ "$QEMU" =3D "" ] && _fatal "qemu not found" [ "$QEMU_IMG" =3D "" ] && _fatal "qemu-img not found" [ "$QEMU_IO" =3D "" ] && _fatal "qemu-io not found" diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.c= onfig index e0883a0c65..b599c72211 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -15,33 +15,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# -# setup and check for config parameters, and in particular -# -# EMAIL - email of the script runner. -# TEST_DIR - scratch test directory -# -# - These can be added to $HOST_CONFIG_DIR (witch default to ./config) -# below or a separate local configuration file can be used (using -# the HOST_OPTIONS variable). -# - This script is shared by the stress test system and the auto-qa -# system (includes both regression test and benchmark components). -# - this script shouldn't make any assertions about filesystem -# validity or mountedness. -# - # all tests should use a common language setting to prevent golden # output mismatches. export LANG=3DC =20 PATH=3D".:$PATH" =20 -HOST=3D`hostname -s 2> /dev/null` HOSTOS=3D`uname -s` =20 -EMAIL=3Droot@localhost # where auto-qa will send its status messages -export HOST_OPTIONS=3D${HOST_OPTIONS:=3Dlocal.config} -export CHECK_OPTIONS=3D${CHECK_OPTIONS:=3D"-g auto"} export PWD=3D`pwd` =20 export _QEMU_HANDLE=3D0 @@ -78,11 +59,6 @@ _fatal() export AWK_PROG=3D"`set_prog_path awk`" [ "$AWK_PROG" =3D "" ] && _fatal "awk not found" =20 -export SED_PROG=3D"`set_prog_path sed`" -[ "$SED_PROG" =3D "" ] && _fatal "sed not found" - -export PS_ALL_FLAGS=3D"-ef" - if [ -z "$QEMU_PROG" ]; then export QEMU_PROG=3D"`set_prog_path qemu`" fi @@ -198,8 +174,6 @@ fi =20 export QEMU_DEFAULT_MACHINE=3D"$default_machine" =20 -[ -f /etc/qemu-iotest.config ] && . /etc/qemu-iotest.config - if [ -z "$TEST_DIR" ]; then TEST_DIR=3D`pwd`/scratch fi diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index bfbc80e5f6..dd91a2b79a 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -293,51 +293,6 @@ _img_info() done } =20 -_get_pids_by_name() -{ - if [ $# -ne 1 ] - then - echo "Usage: _get_pids_by_name process-name" 1>&2 - exit 1 - fi - - # Algorithm ... all ps(1) variants have a time of the form MM:SS or - # HH:MM:SS before the psargs field, use this as the search anchor. - # - # Matches with $1 (process-name) occur if the first psarg is $1 - # or ends in /$1 ... the matching uses sed's regular expressions, - # so passing a regex into $1 will work. - - ps $PS_ALL_FLAGS \ - | sed -n \ - -e 's/$/ /' \ - -e 's/[ ][ ]*/ /g' \ - -e 's/^ //' \ - -e 's/^[^ ]* //' \ - -e "/[0-9]:[0-9][0-9] *[^ ]*\/$1 /s/ .*//p" \ - -e "/[0-9]:[0-9][0-9] *$1 /s/ .*//p" -} - -# fqdn for localhost -# -_get_fqdn() -{ - host=3D`hostname` - $NSLOOKUP_PROG $host | $AWK_PROG '{ if ($1 =3D=3D "Name:") print $2 }' -} - -# check if run as root -# -_need_to_be_root() -{ - id=3D`id | $SED_PROG -e 's/(.*//' -e 's/.*=3D//'` - if [ "$id" -ne 0 ] - then - echo "Arrgh ... you need to be root (not uid=3D$id) to run this te= st" - exit 1 - fi -} - # bail out, setting up .notrun file # _notrun() @@ -496,28 +451,5 @@ _full_platform_details() echo "$os/$platform $host $kernel" } =20 -_link_out_file() -{ - if [ -z "$1" ]; then - echo Error must pass \$seq. - exit - fi - rm -f $1 - if [ "`uname`" =3D=3D "IRIX64" ] || [ "`uname`" =3D=3D "IRIX" ]; then - ln -s $1.irix $1 - elif [ "`uname`" =3D=3D "Linux" ]; then - ln -s $1.linux $1 - else - echo Error test $seq does not run on the operating system: `uname` - exit - fi -} - -_die() -{ - echo $@ - exit 1 -} - # make sure this script returns success true --=20 2.13.3 From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502315979594545.1616615346568; Wed, 9 Aug 2017 14:59:39 -0700 (PDT) Received: from localhost ([::1]:50030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfZ0s-0005l5-Ag for importer@patchew.org; Wed, 09 Aug 2017 17:59:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwi-0002Pe-8d for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwf-0006S6-2j for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:20 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:34553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwe-0006Rc-Sc; Wed, 09 Aug 2017 17:55:17 -0400 Received: by mail-wm0-x242.google.com with SMTP id x64so954404wmg.1; Wed, 09 Aug 2017 14:55:16 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=EISfrxy7M9wBW8+mPW/7+8l2ZBnd+qRMXdasLeL5vHo=; b=DLrY+9Oh0yFp3LJVTezs3sr6Z8hzvkWIgIZ2bYikpYOqsM+YVQTfEXh7mWf9gTIx8D pM6IUMgel4VS6Bc+R04N3PKTXIAKKcJ0WKzquAJlGoYyqrfII+1xlIsQPtAVNJ2/Ea2O wYGNwjq6tUDLTe6+AXy1c63ju2vSeP+vs8cpIH7UA/qCVdIE2LnIGLZ2ISRbWmWd1ktr ExMAxvgnRkyhkbgllMveH9GcYXz2uq4JDqgfTRbYNwrEmLses2D/naEn2xYus0n7/tvj tNyY5vcEoKlZlMkE1VjdfU04tpkpwsXI5ci0mXItExpyA8OGiBHcqzBhoi5m/TAfrOBx n3Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=EISfrxy7M9wBW8+mPW/7+8l2ZBnd+qRMXdasLeL5vHo=; b=XLOAcEskukXndFcRCdTUJfOMyhvvNHfx/4wCzDYoj9IMPe9OreCnhGghpK5DVPqEv2 atW8mS5kjUEzTtMtXrcr8KKJ+xMSFzA4MNW8Yw7ghX23+nqCWK0s8vzj725n8WkKUyLv KgdyEgRK9e/NILqQn//cuNa+U9wNm5mJY3fVdE3TgxlyO+XYtKXNmrIYyznQwHPAzWCK XuMwTUfSKlM0KjdmD9frqM8NVIB3jMo4APacuWndMAFNn5q+wzV6yShRXxPgc/Wot2ui 0QOKrl3sIsHekrYx5ZHQ6DVLccEbiXkwgIYnsqTTH5XiQqlsabJ8zbU+R+n/TAhrZSU2 VxTA== X-Gm-Message-State: AHYfb5hNhE083Pr0EtvglNFfaEHT+Wb/xFtbSsvxGRpTUUoNcqI70UGD VxMDQMgjRSdhiuDGcoU= X-Received: by 10.28.174.209 with SMTP id x200mr5807152wme.106.1502315715481; Wed, 09 Aug 2017 14:55:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:00 +0200 Message-Id: <20170809215510.22802-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH 02/12] qemu-iotests: get rid of AWK_PROG 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/qemu-iotests/check | 4 ++-- tests/qemu-iotests/common | 2 +- tests/qemu-iotests/common.config | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 01fd5a26e5..5075029e89 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -128,7 +128,7 @@ tmp=3D"${TEST_DIR}"/$$ =20 _wallclock() { - date "+%H %M %S" | $AWK_PROG '{ print $1*3600 + $2*60 + $3 }' + date "+%H %M %S" | awk '{ print $1*3600 + $2*60 + $3 }' } =20 _timestamp() @@ -147,7 +147,7 @@ _wrapup() if [ -f $TIMESTAMP_FILE -a -f $tmp.time ] then cat $TIMESTAMP_FILE $tmp.time \ - | $AWK_PROG ' + | awk ' { t[$1] =3D $2 } END { if (NR > 0) { for (i in t) print i " " t[i] diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 867918895b..130f647a4d 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -366,7 +366,7 @@ testlist options if $xpand then have_test_arg=3Dtrue - $AWK_PROG Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502315834086599.5679523310994; Wed, 9 Aug 2017 14:57:14 -0700 (PDT) Received: from localhost ([::1]:50021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYyW-0003k7-HF for importer@patchew.org; Wed, 09 Aug 2017 17:57:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwi-0002Ph-9q for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwg-0006SX-8b for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:20 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:34487) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwg-0006SC-2E; Wed, 09 Aug 2017 17:55:18 -0400 Received: by mail-wr0-x242.google.com with SMTP id o33so5313599wrb.1; Wed, 09 Aug 2017 14:55:17 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=I+slIov0iljRTpSEvLrHrjGOrnctbTsccpIwvwEPnjU=; b=kIzcPaLn63otAqBYULj0dzBxiuhb6dDLEjbYFS5bgqQcaXvhxXkteucyqXScrc7z41 j1+9jFlZ8FemGboZsDnhfpOqxQ0j8CMMgBldukNGrK5zfeKXkUC1kCRKIBKOaHeKGdXd 2xOyw+hPjycy1TpjPoaf+UBlRunJWbcNuQ8piVoJioYsFda2NCsQTKpb+z6ioqNteimD Jm3xSAO9Pb8mzffKmgObK54oIGgwkQDuWQJz32ONdwKFb7/+Fx0kijYbvo4F20xWnhkl 4qOoJyqa4uaiHDVJKKzOG//wm/X89C5lR8llbhJXX7z3QVYcZptOJPWJlc8t4ORek8Un T6Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=I+slIov0iljRTpSEvLrHrjGOrnctbTsccpIwvwEPnjU=; b=a7pQGqN2d+7Qoq98tV6FP3FhweaIoiRrkSz8kObg6miAVoHpV1/P/3YC5OkvipB1Sd G28MiPZDlrQeflz4ZRmUmX4QqVbFrv/9YnCfLq0kcxFp3fMYekTuamWqvm1FX5pW9ywJ pGWuu1wwONeKZzCmU4GiaBRExYHnHal2o653iPvRr2Er5ZOEPTOkbezM76zREsmPz8WK IpsOD/71xgN8ZTyg1mDWdJaDKPph2gCUfzIsU3FF1K3BRYJQzf8ahOQVs0JzeAlW1guh Df/AYjaOmrOP3LeZmY7AUE/n4y/Xl1B261uTq9+a0xlgs+ocZqniBF/utr/oqDSEmwSb IcvQ== X-Gm-Message-State: AHYfb5iCa+eCc5xjfIsbYzTRv2D3qE8bSjGsgBV8paQxVPVxoZ7nVGuB h6ANiDNPubxPd+Dq63k= X-Received: by 10.223.187.143 with SMTP id q15mr7882581wrg.16.1502315716622; Wed, 09 Aug 2017 14:55:16 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:01 +0200 Message-Id: <20170809215510.22802-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PATCH 03/12] qemu-iotests: move "check" code out of common.rc 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Some functions in common.rc are never used by the tests. Move them out of that file and into common, which is already included only by "check". Code that actually *is* common to "check" and tests can be placed in common.config. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/qemu-iotests/common | 30 ++++++++++++++++++++++++++- tests/qemu-iotests/common.config | 12 +++++++++++ tests/qemu-iotests/common.rc | 45 ------------------------------------= ---- 3 files changed, 41 insertions(+), 46 deletions(-) diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 130f647a4d..50720f080f 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -19,6 +19,29 @@ # common procedures for QA scripts # =20 +_full_imgfmt_details() +{ + if [ -n "$IMGOPTS" ]; then + echo "$IMGFMT ($IMGOPTS)" + else + echo "$IMGFMT" + fi +} + +_full_imgproto_details() +{ + echo "$IMGPROTO" +} + +_full_platform_details() +{ + os=3D`uname -s` + host=3D`hostname -s` + kernel=3D`uname -r` + platform=3D`uname -m` + echo "$os/$platform $host $kernel" +} + diff=3D"diff -u" verbose=3Dfalse debug=3Dfalse @@ -404,7 +427,12 @@ if [ "$IMGOPTSSYNTAX" !=3D "true" ]; then fi =20 # Set default options for qemu-img create -o if they were not specified -_set_default_imgopts +if [ "$IMGFMT" =3D=3D "qcow2" ] && ! (echo "$IMGOPTS" | grep "compat=3D" >= /dev/null); then + IMGOPTS=3D$(_optstr_add "$IMGOPTS" "compat=3D1.1") +fi +if [ "$IMGFMT" =3D=3D "luks" ] && ! (echo "$IMGOPTS" | grep "iter-time=3D"= > /dev/null); then + IMGOPTS=3D$(_optstr_add "$IMGOPTS" "iter-time=3D10") +fi =20 if [ -s $tmp.list ] then diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.c= onfig index 0f571d46eb..91da65f3dc 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -27,6 +27,9 @@ export PWD=3D`pwd` =20 export _QEMU_HANDLE=3D0 =20 +# make sure we have a standard umask +umask 022 + # $1 =3D prog to look for, $2* =3D default pathnames if not found in $PATH set_prog_path() { @@ -49,6 +52,15 @@ set_prog_path() return 1 } =20 +_optstr_add() +{ + if [ -n "$1" ]; then + echo "$1,$2" + else + echo "$2" + fi +} + _fatal() { echo "$*" diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index dd91a2b79a..6f6e03366f 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -50,9 +50,6 @@ then fi fi =20 -# make sure we have a standard umask -umask 022 - if [ "$IMGOPTSSYNTAX" =3D "true" ]; then DRIVER=3D"driver=3D$IMGFMT" if [ "$IMGFMT" =3D "luks" ]; then @@ -94,25 +91,6 @@ else fi ORIG_TEST_IMG=3D"$TEST_IMG" =20 -_optstr_add() -{ - if [ -n "$1" ]; then - echo "$1,$2" - else - echo "$2" - fi -} - -_set_default_imgopts() -{ - if [ "$IMGFMT" =3D=3D "qcow2" ] && ! (echo "$IMGOPTS" | grep "compat= =3D" > /dev/null); then - IMGOPTS=3D$(_optstr_add "$IMGOPTS" "compat=3D1.1") - fi - if [ "$IMGFMT" =3D=3D "luks" ] && ! (echo "$IMGOPTS" | grep "iter-time= =3D" > /dev/null); then - IMGOPTS=3D$(_optstr_add "$IMGOPTS" "iter-time=3D10") - fi -} - _use_sample_img() { SAMPLE_IMG_FILE=3D"${1%\.bz2}" @@ -428,28 +406,5 @@ _require_command() [ -x "$c" ] || _notrun "$1 utility required, skipped this test" } =20 -_full_imgfmt_details() -{ - if [ -n "$IMGOPTS" ]; then - echo "$IMGFMT ($IMGOPTS)" - else - echo "$IMGFMT" - fi -} - -_full_imgproto_details() -{ - echo "$IMGPROTO" -} - -_full_platform_details() -{ - os=3D`uname -s` - host=3D`hostname -s` - kernel=3D`uname -r` - platform=3D`uname -m` - echo "$os/$platform $host $kernel" -} - # make sure this script returns success true --=20 2.13.3 From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502316231906340.635211916755; Wed, 9 Aug 2017 15:03:51 -0700 (PDT) Received: from localhost ([::1]:50060 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfZ4w-0000xT-1x for importer@patchew.org; Wed, 09 Aug 2017 18:03:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwk-0002Q1-6J for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwh-0006TU-Sj for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:22 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:33554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwh-0006Sr-I8; Wed, 09 Aug 2017 17:55:19 -0400 Received: by mail-wr0-x243.google.com with SMTP id y43so5301342wrd.0; Wed, 09 Aug 2017 14:55:19 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=md/PvA7aBc9VlnY0XSJVz95N603dlMj1lTpHuDTc2No=; b=BrXTDG+MnAhhrTVn5AtpB7hkwzam09OzeWbOzBsU+R4rPZPvYQhTfZE5QkciwIKUu9 KWpbYtGXSMKBK9Qxf4soZynqDhr5rvKs3KGoIxq9QwF2YFxIZrOmsA/3A9PIu7rJl34X +mLD6WtsOvLvLQD6YK40tsB8IhtqLq0JniWcvU3AeudS625zfXjLInLtY5skh197FSsh v0PBtbvzaII5kcWZLP5trIYZy/4NYdcgGi1XusKubxINBOx3x2hYkm54ZxWsb36Jxk/V oHH/VkAEewg/61UrCS/X0JeNH0c249nSSLNRVSffzbX4iDst1RYQ5TgilAZy7DMdzudq T/qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=md/PvA7aBc9VlnY0XSJVz95N603dlMj1lTpHuDTc2No=; b=mbESlUIwZbMEdGzANBrjA2fyLqbwcZpNXyflpIJytY8dQlac+RPCTE0zyWaeecT+W1 WPxYODUMB07wCDDKhj9HBRhGQrM/NBRE77VBrlSXPc18txYYw17vS8wHnWkI55rXB9Po sdYlrbb5Ut3a75BzB3Iq0ofDukIjMjNAQIHSqmEb9cotKwmz8Nw3FJHqVFYc8SzhzxH/ rtlwj+UG/sVfkxjg3paFUwGkhidppIWRViWtNMwDPO6pZ7RofwDcidoWaeWXGJm7449P JP1V6jl7OIoZc3BCRQJUAAVRaSY5OHfXdiakjzBIso9Hm14Vgcq0xu+rZehbVY4ncXce tghw== X-Gm-Message-State: AHYfb5gWX4Hj0/xgNqU8tADPDRCFUvJdmkyPiaQrf2ybAqnHP7L8vqQA 4rTBSANvlJ9ZTgQy1u4= X-Received: by 10.223.166.162 with SMTP id t31mr6378410wrc.52.1502315717978; Wed, 09 Aug 2017 14:55:17 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:02 +0200 Message-Id: <20170809215510.22802-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PATCH 04/12] qemu-iotests: limit non-_PROG-suffixed variables to common.rc 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" These are never used by "check", with one exception that does not need $QEMU_OPTIONS. Keep them in common.rc, which will be soon included only by the tests. Signed-off-by: Paolo Bonzini --- tests/qemu-iotests/039.out | 10 ++--- tests/qemu-iotests/061.out | 4 +- tests/qemu-iotests/137.out | 2 +- tests/qemu-iotests/common | 8 ---- tests/qemu-iotests/common.config | 75 +------------------------------------ tests/qemu-iotests/common.rc | 80 ++++++++++++++++++++++++++++++++++++= ++++ 6 files changed, 90 insertions(+), 89 deletions(-) diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out index c6e0ac2da3..724d7b2508 100644 --- a/tests/qemu-iotests/039.out +++ b/tests/qemu-iotests/039.out @@ -11,7 +11,7 @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -./common.config: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; @@ -50,7 +50,7 @@ read 512/512 bytes at offset 0 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -./common.config: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; @@ -68,7 +68,7 @@ incompatible_features 0x0 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -./common.config: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; @@ -91,7 +91,7 @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -./common.config: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; @@ -105,7 +105,7 @@ Data may be corrupted, or further writes to the image m= ay corrupt it. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -./common.config: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out index a431b7f305..942485de99 100644 --- a/tests/qemu-iotests/061.out +++ b/tests/qemu-iotests/061.out @@ -57,7 +57,7 @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 wrote 131072/131072 bytes at offset 0 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -./common.config: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; @@ -219,7 +219,7 @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 wrote 131072/131072 bytes at offset 0 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -./common.config: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; diff --git a/tests/qemu-iotests/137.out b/tests/qemu-iotests/137.out index c0e753483b..05efd74d17 100644 --- a/tests/qemu-iotests/137.out +++ b/tests/qemu-iotests/137.out @@ -31,7 +31,7 @@ Cache clean interval too big Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are an= y of the following: none, constant, cached, all wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -./common.config: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; else exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"; diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 50720f080f..f58e56fc40 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -454,11 +454,3 @@ fi # list=3D`sort $tmp.list` rm -f $tmp.list $tmp.tmp $tmp.sed - -[ "$QEMU" =3D "" ] && _fatal "qemu not found" -[ "$QEMU_IMG" =3D "" ] && _fatal "qemu-img not found" -[ "$QEMU_IO" =3D "" ] && _fatal "qemu-io not found" - -if [ "$IMGPROTO" =3D "nbd" ] ; then - [ "$QEMU_NBD" =3D "" ] && _fatal "qemu-nbd not found" -fi diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.c= onfig index 91da65f3dc..ee10c23672 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -61,13 +61,6 @@ _optstr_add() fi } =20 -_fatal() -{ - echo "$*" - status=3D1 - exit 1 -} - if [ -z "$QEMU_PROG" ]; then export QEMU_PROG=3D"`set_prog_path qemu`" fi @@ -99,70 +92,6 @@ if [ -n "$QEMU_VXHS_PROG" ]; then export QEMU_VXHS_PROG=3D$(realpath -- "$(type -p "$QEMU_VXHS_PROG")") fi =20 -_qemu_wrapper() -{ - ( - if [ -n "${QEMU_NEED_PID}" ]; then - echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid" - fi - exec "$QEMU_PROG" $QEMU_OPTIONS "$@" - ) -} - -_qemu_img_wrapper() -{ - (exec "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS "$@") -} - -_qemu_io_wrapper() -{ - local VALGRIND_LOGFILE=3D"${TEST_DIR}"/$$.valgrind - local QEMU_IO_ARGS=3D"$QEMU_IO_OPTIONS" - if [ "$IMGOPTSSYNTAX" =3D "true" ]; then - QEMU_IO_ARGS=3D"--image-opts $QEMU_IO_ARGS" - if [ -n "$IMGKEYSECRET" ]; then - QEMU_IO_ARGS=3D"--object secret,id=3Dkeysec0,data=3D$IMGKEYSEC= RET $QEMU_IO_ARGS" - fi - fi - local RETVAL - ( - if [ "${VALGRIND_QEMU}" =3D=3D "y" ]; then - exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitc= ode=3D99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" - else - exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" - fi - ) - RETVAL=3D$? - if [ "${VALGRIND_QEMU}" =3D=3D "y" ]; then - if [ $RETVAL =3D=3D 99 ]; then - cat "${VALGRIND_LOGFILE}" - fi - rm -f "${VALGRIND_LOGFILE}" - fi - (exit $RETVAL) -} - -_qemu_nbd_wrapper() -{ - ( - echo $BASHPID > "${QEMU_TEST_DIR}/qemu-nbd.pid" - exec "$QEMU_NBD_PROG" $QEMU_NBD_OPTIONS "$@" - ) -} - -_qemu_vxhs_wrapper() -{ - ( - echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid" - exec "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@" - ) -} - -export QEMU=3D_qemu_wrapper -export QEMU_IMG=3D_qemu_img_wrapper -export QEMU_IO=3D_qemu_io_wrapper -export QEMU_NBD=3D_qemu_nbd_wrapper -export QEMU_VXHS=3D_qemu_vxhs_wrapper =20 QEMU_IMG_EXTRA_ARGS=3D if [ "$IMGOPTSSYNTAX" =3D "true" ]; then @@ -174,8 +103,8 @@ fi export QEMU_IMG_EXTRA_ARGS =20 =20 -default_machine=3D$($QEMU -machine help | sed -n '/(default)/ s/ .*//p') -default_alias_machine=3D$($QEMU -machine help | \ +default_machine=3D$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//= p') +default_alias_machine=3D$($QEMU_PROG -machine help | \ sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }") if [[ "$default_alias_machine" ]]; then default_machine=3D"$default_alias_machine" diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 6f6e03366f..ef5cdb3385 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -50,6 +50,86 @@ then fi fi =20 +_fatal() +{ + echo "$*" + status=3D1 + exit 1 +} + +[ -n "$QEMU_PROG" ] || _fatal "qemu not found" +[ -n "$QEMU_IMG_PROG" ] || _fatal "qemu-img not found" +[ -n "$QEMU_IO_PROG" ] || _fatal "qemu-io not found" +[ -n "$QEMU_NBD_PROG" ] || _fatal "qemu-nbd not found" +if [ -z "$QEMU_VXHS_PROG" ] && [ "$IMGPROTO" =3D "vhxs" ]; then + _fatal "qnio_server not found" +fi + +_qemu_wrapper() +{ + ( + if [ -n "${QEMU_NEED_PID}" ]; then + echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid" + fi + exec "$QEMU_PROG" $QEMU_OPTIONS "$@" + ) +} + +_qemu_img_wrapper() +{ + (exec "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS "$@") +} + +_qemu_io_wrapper() +{ + local VALGRIND_LOGFILE=3D"${TEST_DIR}"/$$.valgrind + local QEMU_IO_ARGS=3D"$QEMU_IO_OPTIONS" + if [ "$IMGOPTSSYNTAX" =3D "true" ]; then + QEMU_IO_ARGS=3D"--image-opts $QEMU_IO_ARGS" + if [ -n "$IMGKEYSECRET" ]; then + QEMU_IO_ARGS=3D"--object secret,id=3Dkeysec0,data=3D$IMGKEYSEC= RET $QEMU_IO_ARGS" + fi + fi + local RETVAL + ( + if [ "${VALGRIND_QEMU}" =3D=3D "y" ]; then + exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitc= ode=3D99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" + else + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" + fi + ) + RETVAL=3D$? + if [ "${VALGRIND_QEMU}" =3D=3D "y" ]; then + if [ $RETVAL =3D=3D 99 ]; then + cat "${VALGRIND_LOGFILE}" + fi + rm -f "${VALGRIND_LOGFILE}" + fi + (exit $RETVAL) +} + +_qemu_nbd_wrapper() +{ + ( + echo $BASHPID > "${QEMU_TEST_DIR}/qemu-nbd.pid" + exec "$QEMU_NBD_PROG" $QEMU_NBD_OPTIONS "$@" + ) +} + +_qemu_vxhs_wrapper() +{ + ( + echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid" + exec "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@" + ) +} + +export QEMU=3D_qemu_wrapper +export QEMU_IMG=3D_qemu_img_wrapper +export QEMU_IO=3D_qemu_io_wrapper +export QEMU_NBD=3D_qemu_nbd_wrapper +export QEMU_VXHS=3D_qemu_vxhs_wrapper + if [ "$IMGOPTSSYNTAX" =3D "true" ]; then DRIVER=3D"driver=3D$IMGFMT" if [ "$IMGFMT" =3D "luks" ]; then --=20 2.13.3 From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502315985457455.2217233234086; Wed, 9 Aug 2017 14:59:45 -0700 (PDT) Received: from localhost ([::1]:50031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfZ0y-0005qi-8h for importer@patchew.org; Wed, 09 Aug 2017 17:59:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwj-0002Pw-SF for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwi-0006Tv-Dc for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:21 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:34489) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwi-0006TN-6a; Wed, 09 Aug 2017 17:55:20 -0400 Received: by mail-wr0-x242.google.com with SMTP id o33so5313658wrb.1; Wed, 09 Aug 2017 14:55:20 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Cz243I5HhA9+Zbz4UQLKGfL8soBShWPgsW1266ozHSY=; b=iZvU4kGNHvai1P+MnWHjzK3wRz2HRs9Rpn4yJW5+czAOa+9YdnzQwchcGss1PZNvs+ REq0TUiJU3BbOMGnNKmJWsz7GpAw2Dw4XNJ1Hjme5rpXIx2ggpd0qMNB0lC+iPdtY/+/ FRpNr/hZ9L7muxWdG4JCAwj4mjln4pjTmsEfVAsMBuHSOeLtqcu1quv9crzYf5WMfXZg FHQD+9dT9eGQVvThi6JQYHmUVQu4p64gGFqZ4iNbwfIyK0xjjDWnglyhQ9UmtguHPZLV eDzbAfp46J2YN3EMV0Uv7dt4pDDWHmkrlpliaxIq4X+R0e1UMxkUzOnXuuGTk6faDhXV fTKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Cz243I5HhA9+Zbz4UQLKGfL8soBShWPgsW1266ozHSY=; b=if+p3/PmPHXDalADkKl2CVypqdtfEbC3yI4HBRNoNNbUVZRLSsNbSJgaSOwOysbi7f fW7mAmY884TNlNgC6Sw+r7++78ncQx6MGnr2PB8drGZE3xSVSi9fZgFza0XdxfeFTB8I uamKCvDeF79UglGfloTp5ZO/YCNErInV5WrOGe7SnAI2AkVNDeGbv2QzrLPnuSW/d8JP 99C4i6DtEkGfZ+zbHd7a96Nl4rzn/DD7LdXfFESWsiSFWlczcz7tmBkvO5Rii5FKpbD4 xT31+Rk8iwIQZndCqJiuVp63P0bUtz4gry2v+0KB+2clHoRsvqx6XNUoNVsLg5/rFMKA 34Fw== X-Gm-Message-State: AHYfb5jVzwNVTFBBCJAzrdH+Q5whojRp8oafium+/NFvVCXSzwHGH+Cz Y+iiTnbcrkHMoq9RcMM= X-Received: by 10.223.161.19 with SMTP id o19mr7832003wro.235.1502315718913; Wed, 09 Aug 2017 14:55:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:03 +0200 Message-Id: <20170809215510.22802-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PATCH 05/12] qemu-iotests: do not include common.rc in "check" 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" It only provides functions used by the test programs. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/qemu-iotests/check | 6 ------ tests/qemu-iotests/common.rc | 13 +++++-------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 5075029e89..1ef6d0ac3a 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -113,12 +113,6 @@ then _init_error "failed to source common.config" fi =20 -# we need common.rc -if ! . "$source_iotests/common.rc" -then - _init_error "failed to source common.rc" -fi - # we need common . "$source_iotests/common" =20 diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index ef5cdb3385..390aa81224 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -40,14 +40,11 @@ poke_file() printf "$3" | dd "of=3D$1" bs=3D1 "seek=3D$2" conv=3Dnotrunc &>/dev/nu= ll } =20 -# we need common.config -if [ "$iam" !=3D "check" ] -then - if ! . ./common.config - then - echo "$iam: failed to source common.config" - exit 1 - fi + +if ! . ./common.config + then + echo "$iam: failed to source common.config" + exit 1 fi =20 _fatal() --=20 2.13.3 From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502315843901723.4902936800216; Wed, 9 Aug 2017 14:57:23 -0700 (PDT) Received: from localhost ([::1]:50022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYyg-0003ta-Bt for importer@patchew.org; Wed, 09 Aug 2017 17:57:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwk-0002QT-Tr for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwj-0006Uv-Js for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:23 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:38858) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwj-0006UM-Ds; Wed, 09 Aug 2017 17:55:21 -0400 Received: by mail-wr0-x244.google.com with SMTP id g32so5295001wrd.5; Wed, 09 Aug 2017 14:55:21 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Hqiye1dztfgjGdXqutT5p2qHXzCshwcqvdhc3yogOpY=; b=o03XomY9u5VPAO+ipJHSwFfcWIx+RKITMoHjjggQ08QqSBUbhmEsGCiiGTkB26zwbF Wzh5PzgkJoyOHimy6WdGSZuVcJbk/biQl85GRh2HoXlo1aUxAZaQEnwfrKFFdDHpJbam wIeEo9g+jd413VhKTmRRuY3KJ6I198I3zgR601N8K/XR3N5aakXU1DxvT3J8khTEHKTx L+bnF6eELT/KONi2dCwtZwvCwOIFpERe0hfwGgHRCa3esOD+QiaxJb2xqCoX18WOM+Ge z7121acBfKLba8rMIjh1kfC5WEa3W+B2pwOrfQmMc+GpgeBxpfOfQVlcq/aq3N0oilTQ emnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Hqiye1dztfgjGdXqutT5p2qHXzCshwcqvdhc3yogOpY=; b=A4F0EsVdB7P6EwIa26GObqg9byo16PmPOGPPrmRPf2Ei++DEZ7XxrW+e5uUXo3gTMa V05cOu9sCqvsyMOjJgWkd71NQtnACUEe+rNH+8HRjlM5YKXNg3+IP+S3zjXdJRdqVop+ We+z5ET6wa6q+CPFRPyQDVF8VI8EGAj21WBju5BHPjBxqqVhOMv/i6b3EX1Xk3wdsaPh HWKEGUnWpYLFm6fJzEWY14QjprbCcUoDS12N51u6SjJpiP+y8Ook+FSvY4msggkefNaR c41XWk2IE/xQvcAZnjSAwu3ebibLhB1ZQBmDU7GNoZalllAGqW+tVVad3Y0tPFVZz3Zp xrQw== X-Gm-Message-State: AHYfb5i2+B0lSTTIVaptOncHjwCEsNVxY0rAPiNhmbRuLYwI/yM6ivG7 yjGyPY8bPy7anaMmnOE= X-Received: by 10.223.180.66 with SMTP id v2mr6284770wrd.210.1502315720085; Wed, 09 Aug 2017 14:55:20 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:04 +0200 Message-Id: <20170809215510.22802-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PATCH 06/12] qemu-iotests: do not do useless search for QEMU_*_PROG 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With the exception of qnio_server, all the variables are initialized by "check" prior to "common" being sourced. They cannot be empty. Only the "realpath" invocation is useful, and can be done just once in "check" rather than in the tests. For qnio_server, move the detection to "common", simplifying set_prog_path to stop handling the unused second argument, and embedding the "realpath" pass. Signed-off-by: Paolo Bonzini --- tests/qemu-iotests/common | 19 ++++++++++++++ tests/qemu-iotests/common.config | 54 ------------------------------------= ---- 2 files changed, 19 insertions(+), 54 deletions(-) diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index f58e56fc40..33557abe6c 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -42,6 +42,25 @@ _full_platform_details() echo "$os/$platform $host $kernel" } =20 +# $1 =3D prog to look for +set_prog_path() +{ + p=3D`command -v $1 2> /dev/null` + if [ -n "$p" -a -x "$p" ]; then + realpath -- "$(type -p "$p")" + else + return 1 + fi +} + +export QEMU_PROG=3D$(realpath -- "$(type -p "$QEMU_PROG")") +export QEMU_IMG_PROG=3D$(realpath -- "$(type -p "$QEMU_IMG_PROG")") +export QEMU_IO_PROG=3D$(realpath -- "$(type -p "$QEMU_IO_PROG")") +export QEMU_NBD_PROG=3D$(realpath -- "$(type -p "$QEMU_NBD_PROG")") +if [ -z "$QEMU_VXHS_PROG" ]; then + export QEMU_VXHS_PROG=3D"`set_prog_path qnio_server`" +fi + diff=3D"diff -u" verbose=3Dfalse debug=3Dfalse diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.c= onfig index ee10c23672..9d535415b5 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -30,28 +30,6 @@ export _QEMU_HANDLE=3D0 # make sure we have a standard umask umask 022 =20 -# $1 =3D prog to look for, $2* =3D default pathnames if not found in $PATH -set_prog_path() -{ - p=3D`command -v $1 2> /dev/null` - if [ -n "$p" -a -x "$p" ]; then - echo $p - return 0 - fi - p=3D$1 - - shift - for f; do - if [ -x $f ]; then - echo $f - return 0 - fi - done - - echo "" - return 1 -} - _optstr_add() { if [ -n "$1" ]; then @@ -61,38 +39,6 @@ _optstr_add() fi } =20 -if [ -z "$QEMU_PROG" ]; then - export QEMU_PROG=3D"`set_prog_path qemu`" -fi - -if [ -z "$QEMU_IMG_PROG" ]; then - export QEMU_IMG_PROG=3D"`set_prog_path qemu-img`" -fi - -if [ -z "$QEMU_IO_PROG" ]; then - export QEMU_IO_PROG=3D"`set_prog_path qemu-io`" -fi - -if [ -z "$QEMU_NBD_PROG" ]; then - export QEMU_NBD_PROG=3D"`set_prog_path qemu-nbd`" -fi - -if [ -z "$QEMU_VXHS_PROG" ]; then - export QEMU_VXHS_PROG=3D"`set_prog_path qnio_server`" -fi - -export QEMU_PROG=3D$(realpath -- "$(type -p "$QEMU_PROG")") -export QEMU_IMG_PROG=3D$(realpath -- "$(type -p "$QEMU_IMG_PROG")") -export QEMU_IO_PROG=3D$(realpath -- "$(type -p "$QEMU_IO_PROG")") -export QEMU_NBD_PROG=3D$(realpath -- "$(type -p "$QEMU_NBD_PROG")") - -# This program is not built as part of qemu but (possibly) provided by the -# system, so it may not be present at all -if [ -n "$QEMU_VXHS_PROG" ]; then - export QEMU_VXHS_PROG=3D$(realpath -- "$(type -p "$QEMU_VXHS_PROG")") -fi - - QEMU_IMG_EXTRA_ARGS=3D if [ "$IMGOPTSSYNTAX" =3D "true" ]; then QEMU_IMG_EXTRA_ARGS=3D"--image-opts $QEMU_IMG_EXTRA_ARGS" --=20 2.13.3 From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502315853980162.43348407212727; Wed, 9 Aug 2017 14:57:33 -0700 (PDT) Received: from localhost ([::1]:50023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYyq-00042W-KZ for importer@patchew.org; Wed, 09 Aug 2017 17:57:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwm-0002Rw-Jm for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwl-0006Wa-3X for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:24 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:34557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwk-0006Vf-QN; Wed, 09 Aug 2017 17:55:23 -0400 Received: by mail-wm0-x244.google.com with SMTP id x64so954687wmg.1; Wed, 09 Aug 2017 14:55:22 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ss/JyFvpVaBbk4fVWV8hOl6bDZtmv+GzOX/p05Z84sw=; b=p49MORYRFnpKCI9J+jlNJZNjUkNN3OJYwh/cp9QNka7sQJrbYIrFHILPtxOSA2A8FH aItZ96RZ4oeETj/k1RQBDhP674K9qmj3vCt/059k/KXp72LSQClAEg7UwCXY0351dTcu C1Iy2J+qZcaQRZF4QOfFKG2U0BBGY1IlABp9ImpS/Jm2QIguDzLKdH2UsD54WLVnqn71 f/gzCpPT29XB1pzle4V3wrIr3Vod69KtZJYGrFOWGJwSsdPHsjs31pLGtW0n+co4hxwi vq16+sIUGRK0h9B/rLIVMowBazOcTTz4JI/OsaS+JXdDNoedDLr8lMSYLyFMPa5g8Qlc 12xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Ss/JyFvpVaBbk4fVWV8hOl6bDZtmv+GzOX/p05Z84sw=; b=dGajWu+dhRVlWwsDWrKy743ssgHiwF/bBtktY/r3+7wRKnLHOfbo5BZQraHg6GL3oi cezRYf9o9fdGSIcFHX+9qiaNvhy2+K55kilHjG4+LQQ+ubQW2mY0q+lLa20sqAa8Xob1 kuAe1gqOVq5kYCXqoQZram97hbn6JlGzxLLtAOAUbQaw87VfyxMEoTCoeyIk1+3k6DZu OfKzZSvFApJFCrq5BMRV1t98nIr0Lt9LF8SY+d1j+u95da4br+fUTfzb3UAi9UbUsV/Y R9jIOs3qhOn9LV2jiRc+p+NhHO7kXSx+dSwqW2O/a5nqz52e3LQ6ofY2Pf6BeEc/HJLc wNmw== X-Gm-Message-State: AHYfb5gZuxlsVLC2XbwTHroUIEUBpVl3JWv0Ea/ODh5nYcuuf7ZDjg+4 Hp+QJ55jrZvTSXZRTS8= X-Received: by 10.28.145.2 with SMTP id t2mr6792437wmd.179.1502315721333; Wed, 09 Aug 2017 14:55:21 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:05 +0200 Message-Id: <20170809215510.22802-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 07/12] qemu-iotests: disintegrate more parts of common.config 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Split "check" parts from tests part. For the directory setup, the actual computation of directories goes in "check", while the sanity checks go in the tests. Signed-off-by: Paolo Bonzini --- tests/qemu-iotests/common | 24 ++++++++++++++++++++ tests/qemu-iotests/common.config | 49 ------------------------------------= ---- tests/qemu-iotests/common.qemu | 1 + tests/qemu-iotests/common.rc | 25 ++++++++++++++++++++ 4 files changed, 50 insertions(+), 49 deletions(-) diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 33557abe6c..adf427501e 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -61,6 +61,14 @@ if [ -z "$QEMU_VXHS_PROG" ]; then export QEMU_VXHS_PROG=3D"`set_prog_path qnio_server`" fi =20 +if [ -z "$TEST_DIR" ]; then + TEST_DIR=3D`pwd`/scratch +fi + +if [ ! -e "$TEST_DIR" ]; then + mkdir "$TEST_DIR" +fi + diff=3D"diff -u" verbose=3Dfalse debug=3Dfalse @@ -87,6 +95,15 @@ export VALGRIND_QEMU=3D export IMGKEYSECRET=3D export IMGOPTSSYNTAX=3Dfalse =20 +default_machine=3D$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//= p') +default_alias_machine=3D$($QEMU_PROG -machine help | \ + sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }") +if [[ "$default_alias_machine" ]]; then + default_machine=3D"$default_alias_machine" +fi + +export QEMU_DEFAULT_MACHINE=3D"$default_machine" + for r do =20 @@ -453,6 +470,13 @@ if [ "$IMGFMT" =3D=3D "luks" ] && ! (echo "$IMGOPTS" |= grep "iter-time=3D" > /dev/null IMGOPTS=3D$(_optstr_add "$IMGOPTS" "iter-time=3D10") fi =20 +if [ -z "$SAMPLE_IMG_DIR" ]; then + SAMPLE_IMG_DIR=3D"$source_iotests/sample_images" +fi + +export TEST_DIR +export SAMPLE_IMG_DIR + if [ -s $tmp.list ] then # found some valid test numbers ... this is good diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.c= onfig index 9d535415b5..dd2ffe034d 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -25,8 +25,6 @@ HOSTOS=3D`uname -s` =20 export PWD=3D`pwd` =20 -export _QEMU_HANDLE=3D0 - # make sure we have a standard umask umask 022 =20 @@ -39,52 +37,5 @@ _optstr_add() fi } =20 -QEMU_IMG_EXTRA_ARGS=3D -if [ "$IMGOPTSSYNTAX" =3D "true" ]; then - QEMU_IMG_EXTRA_ARGS=3D"--image-opts $QEMU_IMG_EXTRA_ARGS" - if [ -n "$IMGKEYSECRET" ]; then - QEMU_IMG_EXTRA_ARGS=3D"--object secret,id=3Dkeysec0,data=3D$IMGKEY= SECRET $QEMU_IMG_EXTRA_ARGS" - fi -fi -export QEMU_IMG_EXTRA_ARGS - - -default_machine=3D$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//= p') -default_alias_machine=3D$($QEMU_PROG -machine help | \ - sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }") -if [[ "$default_alias_machine" ]]; then - default_machine=3D"$default_alias_machine" -fi - -export QEMU_DEFAULT_MACHINE=3D"$default_machine" - -if [ -z "$TEST_DIR" ]; then - TEST_DIR=3D`pwd`/scratch -fi - -QEMU_TEST_DIR=3D"${TEST_DIR}" - -if [ ! -e "$TEST_DIR" ]; then - mkdir "$TEST_DIR" -fi - -if [ ! -d "$TEST_DIR" ]; then - echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory" - exit 1 -fi - -export TEST_DIR - -if [ -z "$SAMPLE_IMG_DIR" ]; then - SAMPLE_IMG_DIR=3D"$source_iotests/sample_images" -fi - -if [ ! -d "$SAMPLE_IMG_DIR" ]; then - echo "common.config: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not = a directory" - exit 1 -fi - -export SAMPLE_IMG_DIR - # make sure this script returns success true diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu index 7645f1dc72..9f9aecc9df 100644 --- a/tests/qemu-iotests/common.qemu +++ b/tests/qemu-iotests/common.qemu @@ -31,6 +31,7 @@ QEMU_FIFO_IN=3D"${QEMU_TEST_DIR}/qmp-in-$$" QEMU_FIFO_OUT=3D"${QEMU_TEST_DIR}/qmp-out-$$" =20 QEMU_HANDLE=3D0 +export _QEMU_HANDLE=3D0 =20 # If bash version is >=3D 4.1, these will be overwritten and dynamic # file descriptor values assigned. diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 390aa81224..7046a83974 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -129,6 +129,10 @@ export QEMU_VXHS=3D_qemu_vxhs_wrapper =20 if [ "$IMGOPTSSYNTAX" =3D "true" ]; then DRIVER=3D"driver=3D$IMGFMT" + QEMU_IMG_EXTRA_ARGS=3D"--image-opts $QEMU_IMG_EXTRA_ARGS" + if [ -n "$IMGKEYSECRET" ]; then + QEMU_IMG_EXTRA_ARGS=3D"--object secret,id=3Dkeysec0,data=3D$IMGKEY= SECRET $QEMU_IMG_EXTRA_ARGS" + fi if [ "$IMGFMT" =3D "luks" ]; then DRIVER=3D"$DRIVER,key-secret=3Dkeysec0" fi @@ -148,6 +152,7 @@ if [ "$IMGOPTSSYNTAX" =3D "true" ]; then TEST_IMG=3D"$DRIVER,file.driver=3D$IMGPROTO,file.filename=3D$TEST_= DIR/t.$IMGFMT" fi else + QEMU_IMG_EXTRA_ARGS=3D if [ "$IMGPROTO" =3D "file" ]; then TEST_IMG=3D$TEST_DIR/t.$IMGFMT elif [ "$IMGPROTO" =3D "nbd" ]; then @@ -168,6 +173,26 @@ else fi ORIG_TEST_IMG=3D"$TEST_IMG" =20 +if [ -z "$TEST_DIR" ]; then + TEST_DIR=3D`pwd`/scratch +fi + +QEMU_TEST_DIR=3D"${TEST_DIR}" + +if [ ! -e "$TEST_DIR" ]; then + mkdir "$TEST_DIR" +fi + +if [ ! -d "$TEST_DIR" ]; then + echo "common.config: Error: \$TEST_DIR ($TEST_DIR) is not a directory" + exit 1 +fi + +if [ ! -d "$SAMPLE_IMG_DIR" ]; then + echo "common.config: Error: \$SAMPLE_IMG_DIR ($SAMPLE_IMG_DIR) is not = a directory" + exit 1 +fi + _use_sample_img() { SAMPLE_IMG_FILE=3D"${1%\.bz2}" --=20 2.13.3 From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502316003349133.66731085247648; Wed, 9 Aug 2017 15:00:03 -0700 (PDT) Received: from localhost ([::1]:50032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfZ1G-00066Q-3K for importer@patchew.org; Wed, 09 Aug 2017 18:00:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwn-0002SX-4G for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwl-0006XD-Qb for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:25 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwl-0006WL-Jh; Wed, 09 Aug 2017 17:55:23 -0400 Received: by mail-wm0-x242.google.com with SMTP id q189so966090wmd.0; Wed, 09 Aug 2017 14:55:23 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=n3U2/pCF+VnmtN4+rYdW2p1fp4Pgh/pJNSOgTHV61bI=; b=GJviJE7nQHd5mYbApVPyekzrWKxplZJym/lIMruDa+vGRW7mu0wtR3LCaLVxMwgF9q pvqj0W+MO6z+FJ0B9GRcXzfvduBsFrR8gSsNrxJtBOc0gQ5KL88ebGsq8qn83ys2KqWi sNdEfRkQPNWsq0tX99gI9omdGilWNtzWP1zkSlqFMEJW3n/PS0lKSblI7gLIHAad1QjY oFxvghWhBq5zYjAZ8eV8WQZSp7iYo7DCtcRthk5V6kcheSgGmq/Txlal8Q7tgIN3A5KH 4OX880jvK6OuQZMAblM18wMsojAKJ8xDtu0IjHn0dsuXSuJ4+wj+VEBzRmjZrOd/PaLB T6+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=n3U2/pCF+VnmtN4+rYdW2p1fp4Pgh/pJNSOgTHV61bI=; b=fX5NMTVaLsW2D0jxSkiVv8TQG2QCcIhPhrIjEcm702mCGFg4JZjsJDz48tH71Gxja8 ilvM9KqbaP6ZGYQ/jX7+DGlYezTDTyrjQjQwy/fhpbJbup0cHlqRDLDpmXcuDuxjSzCi gfyZQLgoln1BWGLSJbWXSf13NjXs2rxKIq2+DD+9pGehO9lbr/ReICQHn+yrAqRA1qa6 H5HdgpN3iFsNId1FjfwymKQUugubQMGYHSxMjiBJ3V1VEble7EDvIpAZe57GIj4cZrG3 qiY4Q+vXgfLTd0wI661Yh1XoG7ZFkFcPZi5G9sNyr0Fw+BUde+aeNI6IVp2K2boH/vMp 5NBw== X-Gm-Message-State: AHYfb5i5qp5z0er8NmYCwjHFCAaLdQdFtD2SxUQZBeKoIePNGN+7oSRy 2jKv8+1n4T09KPJtq4o= X-Received: by 10.28.211.145 with SMTP id k139mr5835750wmg.130.1502315722340; Wed, 09 Aug 2017 14:55:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:06 +0200 Message-Id: <20170809215510.22802-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH 08/12] qemu-iotests: fix uninitialized variable 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The function is used in "common" but defined only after the file is sourced. Signed-off-by: Paolo Bonzini --- tests/qemu-iotests/check | 2 -- tests/qemu-iotests/common | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 1ef6d0ac3a..5b9c0c8ade 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -118,8 +118,6 @@ fi =20 TIMESTAMP_FILE=3Dcheck.time-$IMGPROTO-$IMGFMT =20 -tmp=3D"${TEST_DIR}"/$$ - _wallclock() { date "+%H %M %S" | awk '{ print $1*3600 + $2*60 + $3 }' diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index adf427501e..35e4d0f87b 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -80,6 +80,8 @@ sortme=3Dfalse expunge=3Dtrue have_test_arg=3Dfalse cachemode=3Dfalse + +tmp=3D"${TEST_DIR}"/$$ rm -f $tmp.list $tmp.tmp $tmp.sed =20 export IMGFMT=3Draw --=20 2.13.3 From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502316006867420.53592929979345; Wed, 9 Aug 2017 15:00:06 -0700 (PDT) Received: from localhost ([::1]:50033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfZ1J-00068o-Jf for importer@patchew.org; Wed, 09 Aug 2017 18:00:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwn-0002TS-Uc for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwm-0006YO-Sg for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:26 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33250) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwm-0006XO-MC; Wed, 09 Aug 2017 17:55:24 -0400 Received: by mail-wm0-x241.google.com with SMTP id q189so966128wmd.0; Wed, 09 Aug 2017 14:55:24 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=kesTx1BOy9jvhANXkSo1eMlFAL5GmDXDeaMvOYZUjfI=; b=lbgiu5VH6QONCSpM2ktKUSsfhvEJsNzVl4NUFKufjlMjFRfvx/xtOwWs6tkXCHoX6o QkaNSWxiwdXV4850hWXs3dnFtYdmcy3gVuAWKC35+mgXQzuhzgOYXWluynzt5hioYhzt SnfJLsMzMpnX9p717koiUZW/dOVNJjZtZT8IrHinLqgnzld3a2xsHef3mvpQnfPPyScD rJ9TFdynxj+9lETIx6pj1NJp7Pb5Fd9DbWS8MJdFOfpioimK38AgeXWkeBzfjS/TDNAw 5jUhI2jiU1ffc+QM0d2wBZPtHC9Eqh3ZCsM7W4blV5L0ceRaN7HiVLxFDJzq9PwlIXYV eR/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=kesTx1BOy9jvhANXkSo1eMlFAL5GmDXDeaMvOYZUjfI=; b=TxYkWWf8na5GuGkL1V8kp8pbftQBRJY9mCvdzsOHtyRoS+1FUS9dKEaXh5Bm9OQNlt zCoDMdwLwhrC5zoS0MlTwXb7bhztzZgpWytLRjQVepZuvXtMsZ/jrMFFdqpTm6ewGesR YTZJpO5ivohTrMick3Vumj5iAticou/37/EHc/PTeLs17bwDQkKf3kvZ2mDCdPSVCYMB FM+3fHHhG4PiHs2Qo8sybLT7ujqTWI1WtokxjsFP3ys9xordK5EnkU/qUOTX7V+FMjdh 0CCsBO9id5E8vcBmxVWApfyMpKgTRjparew6FrUsdEC8U5B1+0A5EFnNlbJ9lISFNsXh kaSg== X-Gm-Message-State: AHYfb5jr1AOZ9qjjthJ9kqi3QxUz4mG1AM7c1CLHz5C/g3mDjPPY4NHy FQFNWJAMX0p5ixE3ogc= X-Received: by 10.28.133.129 with SMTP id h123mr7445457wmd.20.1502315723424; Wed, 09 Aug 2017 14:55:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:07 +0200 Message-Id: <20170809215510.22802-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH 09/12] qemu-iotests: do not search for binaries in the current directory 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Looking in the build root is enough. Signed-off-by: Paolo Bonzini --- tests/qemu-iotests/check | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 5b9c0c8ade..e5d1ae3d92 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -86,17 +86,17 @@ then fi fi =20 -if [[ -z $QEMU_IMG_PROG && -x "$build_root/qemu-img" && ! -x './qemu-img' = ]] +if [[ -z $QEMU_IMG_PROG && -x "$build_root/qemu-img" ]] then export QEMU_IMG_PROG=3D"$build_root/qemu-img" fi =20 -if [[ -z $QEMU_IO_PROG && -x "$build_root/qemu-io" && ! -x './qemu-io' ]] +if [[ -z $QEMU_IO_PROG && -x "$build_root/qemu-io" ]] then export QEMU_IO_PROG=3D"$build_root/qemu-io" fi =20 -if [[ -z $QEMU_NBD_PROG && -x "$build_root/qemu-nbd" && ! -x './qemu-nbd' = ]] +if [[ -z $QEMU_NBD_PROG && -x "$build_root/qemu-nbd" ]] then export QEMU_NBD_PROG=3D"$build_root/qemu-nbd" fi --=20 2.13.3 From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502316131526642.4964250780771; Wed, 9 Aug 2017 15:02:11 -0700 (PDT) Received: from localhost ([::1]:50052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfZ3K-0008HY-09 for importer@patchew.org; Wed, 09 Aug 2017 18:02:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwo-0002Ul-St for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwn-0006ZO-Tz for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:26 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33251) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwn-0006Yl-OK; Wed, 09 Aug 2017 17:55:25 -0400 Received: by mail-wm0-x244.google.com with SMTP id q189so966170wmd.0; Wed, 09 Aug 2017 14:55:25 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=iCA7buOzRsL9u/YIasw4oSnz2aQCu6t6d4HTqVRqP3I=; b=kTsToa7DypVqwRLkc8nisCwaaU0wU/mMROstpSzMDdC5ZgflIQsZxwoCDV4YokBQSn Ecs5dbwFewZ5BtUPiwGy93Xuafvjst8NfSQlmCkGWXHkXa15tqtmqXVUnwwOnt6ovEXu MF0lneyYdLBJK7Y0FENY2MxckXmqC/4BKZNrXhynp5xcKw/2BQxcCxw7Mqf6vHgDC0XZ Q8vb/8F0ZozMGriJIhF2dM52sCrEwL0TUv9+UeeK4EfnJhJ+CtaYEwFGysQHmyWkXZCQ 7D6AIF+yR+VkiFPVr8qqOOEKmHDQWZvZBde1qU2Wtvw/OV79obGW5FVx0slG99MgXimr 56CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=iCA7buOzRsL9u/YIasw4oSnz2aQCu6t6d4HTqVRqP3I=; b=HlONHJR9EfCY5mBgRolGnN3tNDtPl1ffvtGQaMp1joW0AJYaybgGyuM9VdJVi45Ap6 8CXyFWAgkRzFODFeKQGYKPSjG92Nz+SEtjwlCEsJ/eC6hqPlbpsMOhKASs+kCzgQ7mmf fgNb4ag5K+vo2n1qA3c2kdeTjSUZxHAAnaeV0xAbNpSFBI1gd3SGs7pceaQ0fbFblr51 eivTm+rp1ZJdCcL5RErqtgdZywSbY0dEWTbay+JLjM9WIQ6sZHXLV+KhccKyPnPGhK2P 9vrLIpQaiWSx0kGHz8pl2bhx/UW+zDUrgoiO1ZwrApFE/wJJ5gk41+I5q7U4L0/f1KIn T4wQ== X-Gm-Message-State: AHYfb5jIoIeghe9UbGjbXDqMzctL/VE/uZCCKnL+tbQQCKBt9GuWwKpy NqsNuOgnB4tZobms+UU= X-Received: by 10.28.150.87 with SMTP id y84mr5823097wmd.67.1502315724477; Wed, 09 Aug 2017 14:55:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:08 +0200 Message-Id: <20170809215510.22802-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 10/12] qemu-iotests: get rid of $iam 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The variable is almost unused, and one of the two uses is actually uninitialized. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/qemu-iotests/check | 5 +---- tests/qemu-iotests/common.rc | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index e5d1ae3d92..dc60e17e6a 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -30,12 +30,9 @@ interrupt=3Dtrue # by default don't output timestamps timestamp=3D${TIMESTAMP:=3Dfalse} =20 -# generic initialization -iam=3Dcheck - _init_error() { - echo "$iam: $1" >&2 + echo "check: $1" >&2 exit 1 } =20 diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 7046a83974..d0aa22543e 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -43,7 +43,7 @@ poke_file() =20 if ! . ./common.config then - echo "$iam: failed to source common.config" + echo "$0: failed to source common.config" exit 1 fi =20 --=20 2.13.3 From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502316236105682.3835057871457; Wed, 9 Aug 2017 15:03:56 -0700 (PDT) Received: from localhost ([::1]:50061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfZ50-0000z5-SX for importer@patchew.org; Wed, 09 Aug 2017 18:03:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYws-0002YK-2r for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwp-0006at-8w for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:30 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:38789) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwp-0006a8-25; Wed, 09 Aug 2017 17:55:27 -0400 Received: by mail-wm0-x244.google.com with SMTP id y206so936356wmd.5; Wed, 09 Aug 2017 14:55:26 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=1l5caR6wYN9Iut1nkRV4YYAj+Oa98lShgZ6gscpqsrg=; b=Zi/QyG9ZKSshPlGYFtmMCeSxbX7ParjNxYNZ2jYgCh+VoDMTuC5HC3tjQcXy0r9ehd EFXD62ZT0Ali+o8H6LADqjHr7vzkBQOvMXw2Wlx2LJ/ULB1heS0RCp2pnDeECZv824jS TlGlD1K9s0fdnpiNJhQvuEoB0Xwgu/uVxrdIUZyQR+7cI9oBgf9pM2W0Uqgm7ZTARHUO 16/+SNJsUH3fqEWjIxCOCl+M88ouYvgqEljH+XTeit4bGbfpkGmMaebYiIyuGjRS0PJ7 iYVS68sxFHuFYH51132tegHY5BnCHTMVC2c7cqdg5xN2oF4fdYJjzGoKDTIcyjbdQ/VU p0FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=1l5caR6wYN9Iut1nkRV4YYAj+Oa98lShgZ6gscpqsrg=; b=UknDBNJ0fV9P7gr0BrOsa/FVmN9ZbczeGgaqYHz6sNGYKFFcDXRQMBvAWstkyEd8RM 8XBuy1LFP/lVQLPHtwXPq72CN35WpW/WGV6r5Gay0cXZUBdJ56b2/fDeOh6ZCSgUXIiZ cY3zvYVmX/PpX37WJBn/j1tsDG1/OBi7450jpJLE7pnWtuBX+nOVW0rzftdJciEEcEWw vvMkIq/Ad11kagUA9+zqCLb79RBMtvNgpYrn0z2nGd2TRFUO4/bacUuBBPfaEeeQE6B2 9E26W+YKmZ/o7tbhVNEERx3gLaB/S1Qiltgv0Yt0ppgYFB/Dh6ulbioeUoEIai1enQeE rduQ== X-Gm-Message-State: AHYfb5iZMHpvQOpW0j2NZ0qv43i6Q//qkT3rhcOzIvzl9tSG23Avl0Sk y0RQh3jd6arWoVwpu5E= X-Received: by 10.28.54.214 with SMTP id y83mr6113276wmh.103.1502315725794; Wed, 09 Aug 2017 14:55:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:09 +0200 Message-Id: <20170809215510.22802-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 11/12] qemu-iotests: include common.env and common.config early 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" They are now very small and they do not have external dependencies. We can source them as soon as we have their path. Signed-off-by: Paolo Bonzini --- tests/qemu-iotests/check | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index dc60e17e6a..28b3444963 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -55,6 +55,18 @@ else build_iotests=3D$PWD fi =20 +# we need common.env +if ! . "$build_iotests/common.env" +then + _init_error "failed to source common.env (make sure the qemu-iotests a= re run from tests/qemu-iotests in the build tree)" +fi + +# we need common.config +if ! . "$source_iotests/common.config" +then + _init_error "failed to source common.config" +fi + build_root=3D"$build_iotests/../.." =20 if [ -x "$build_iotests/socket_scm_helper" ] @@ -98,18 +110,6 @@ then export QEMU_NBD_PROG=3D"$build_root/qemu-nbd" fi =20 -# we need common.env -if ! . "$build_iotests/common.env" -then - _init_error "failed to source common.env (make sure the qemu-iotests a= re run from tests/qemu-iotests in the build tree)" -fi - -# we need common.config -if ! . "$source_iotests/common.config" -then - _init_error "failed to source common.config" -fi - # we need common . "$source_iotests/common" =20 --=20 2.13.3 From nobody Sat May 4 15:32:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502316329104508.0755996197239; Wed, 9 Aug 2017 15:05:29 -0700 (PDT) Received: from localhost ([::1]:50076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfZ6V-0002Nb-MV for importer@patchew.org; Wed, 09 Aug 2017 18:05:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfYwu-0002bU-P8 for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfYwr-0006cK-QB for qemu-devel@nongnu.org; Wed, 09 Aug 2017 17:55:32 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:36331) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfYwr-0006be-Df; Wed, 09 Aug 2017 17:55:29 -0400 Received: by mail-wm0-x242.google.com with SMTP id d40so948292wma.3; Wed, 09 Aug 2017 14:55:29 -0700 (PDT) Received: from donizetti.lan (94-39-192-75.adsl-ull.clienti.tiscali.it. [94.39.192.75]) by smtp.gmail.com with ESMTPSA id v41sm4390478wrc.65.2017.08.09.14.55.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 14:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=AvrjH6VAW7hOhIr+OhgG4E6sCvztrTsJ/DVYocNrbnI=; b=iUXzpol3wjjHAuKYKX2iDM0AeFIREKjGCnsLf15tqKHq32vk1mEqOelbSyWrykp4rD Ij8B5HYeGXrH3yXq0GQTHoEs9z7VF9m+KGtObIMzBaudUGxjXBlXhdpr/YFMzkF4yfeZ uUOiPurB1ojaUuweyXVhDVgfeYgC6EPK8DwZD8SnMrCIxo2w9MSk6WcjU9vJUKVz5yT5 S1LGbKRb3MLa1eEL6N49/5bD6OO/CEMGXcikU4xxxAEkD6viWaI9peXR6r9MYK+ZFxc7 zItHEVqhI1DZ1yRFsXPUUbFeRGdQODpwt+vupIIQPVL9iWgtbdmJTyEyZgsZtJQTpKO8 I+Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=AvrjH6VAW7hOhIr+OhgG4E6sCvztrTsJ/DVYocNrbnI=; b=j3/GNnEt31WQeSE1xNK1FDqPLgto5V3y+ufnEsVc4yzlvXdmIX8YE4gFBJsPdfuczq AOkMAG3k2w4BEJdoKwtK/Wz8eO9zXy3VHpTXqmpZy7p/6sNDLx4yPhSLpchuyua2FknG Or6WBXDAvBJq+3L+eRip5ZyXpoJ61Kqtxv0amXHvBTCDR+IPyPYuZnFfKsXfq3SONDil 8hJlqeptUhkmjhnNX86TpHiKEQe834U4vzeWuJWfiHvHSGceb5FKJzbAb0fU2kuERabd PNpZiNBrqJo5TOl3rGR6fsJbng8/gkuykEyW6ZKfHP0y7KHn4Vcz/dYrWpUIPgcgG/To ma2w== X-Gm-Message-State: AHYfb5jYcjRzAENKbQY7atGdlxGDloY6OBzbYqLEryvKU9HOYIFpm7+5 zuQV/Fxl/v79vzx47IM= X-Received: by 10.28.109.27 with SMTP id i27mr5581241wmc.173.1502315727714; Wed, 09 Aug 2017 14:55:27 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 9 Aug 2017 23:55:10 +0200 Message-Id: <20170809215510.22802-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809215510.22802-1-pbonzini@redhat.com> References: <20170809215510.22802-1-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH 12/12] qemu-iotests: merge "check" and "common" 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, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" "check" is full of qemu-iotests--specific details. Separating it from "common" does not make much sense anymore. Signed-off-by: Paolo Bonzini --- tests/qemu-iotests/check | 482 ++++++++++++++++++++++++++++++++++++++++++= +- tests/qemu-iotests/common | 501 ------------------------------------------= ---- 2 files changed, 480 insertions(+), 503 deletions(-) delete mode 100644 tests/qemu-iotests/common diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 28b3444963..6d4d01e432 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -110,8 +110,486 @@ then export QEMU_NBD_PROG=3D"$build_root/qemu-nbd" fi =20 -# we need common -. "$source_iotests/common" +_full_imgfmt_details() +{ + if [ -n "$IMGOPTS" ]; then + echo "$IMGFMT ($IMGOPTS)" + else + echo "$IMGFMT" + fi +} + +_full_imgproto_details() +{ + echo "$IMGPROTO" +} + +_full_platform_details() +{ + os=3D`uname -s` + host=3D`hostname -s` + kernel=3D`uname -r` + platform=3D`uname -m` + echo "$os/$platform $host $kernel" +} + +# $1 =3D prog to look for +set_prog_path() +{ + p=3D`command -v $1 2> /dev/null` + if [ -n "$p" -a -x "$p" ]; then + realpath -- "$(type -p "$p")" + else + return 1 + fi +} + +export QEMU_PROG=3D$(realpath -- "$(type -p "$QEMU_PROG")") +export QEMU_IMG_PROG=3D$(realpath -- "$(type -p "$QEMU_IMG_PROG")") +export QEMU_IO_PROG=3D$(realpath -- "$(type -p "$QEMU_IO_PROG")") +export QEMU_NBD_PROG=3D$(realpath -- "$(type -p "$QEMU_NBD_PROG")") +if [ -z "$QEMU_VXHS_PROG" ]; then + export QEMU_VXHS_PROG=3D"`set_prog_path qnio_server`" +fi + +if [ -z "$TEST_DIR" ]; then + TEST_DIR=3D`pwd`/scratch +fi + +if [ ! -e "$TEST_DIR" ]; then + mkdir "$TEST_DIR" +fi + +diff=3D"diff -u" +verbose=3Dfalse +debug=3Dfalse +group=3Dfalse +xgroup=3Dfalse +imgopts=3Dfalse +showme=3Dfalse +sortme=3Dfalse +expunge=3Dtrue +have_test_arg=3Dfalse +cachemode=3Dfalse + +tmp=3D"${TEST_DIR}"/$$ +rm -f $tmp.list $tmp.tmp $tmp.sed + +export IMGFMT=3Draw +export IMGFMT_GENERIC=3Dtrue +export IMGPROTO=3Dfile +export IMGOPTS=3D"" +export CACHEMODE=3D"writeback" +export QEMU_IO_OPTIONS=3D"" +export QEMU_IO_OPTIONS_NO_FMT=3D"" +export CACHEMODE_IS_DEFAULT=3Dtrue +export QEMU_OPTIONS=3D"-nodefaults -machine accel=3Dqtest" +export VALGRIND_QEMU=3D +export IMGKEYSECRET=3D +export IMGOPTSSYNTAX=3Dfalse + +default_machine=3D$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//= p') +default_alias_machine=3D$($QEMU_PROG -machine help | \ + sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }") +if [[ "$default_alias_machine" ]]; then + default_machine=3D"$default_alias_machine" +fi + +export QEMU_DEFAULT_MACHINE=3D"$default_machine" + +for r +do + + if $group + then + # arg after -g + group_list=3D`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0= -9][0-9][0-9].* $r /"'{ +s/ .*//p +}'` + if [ -z "$group_list" ] + then + echo "Group \"$r\" is empty or not defined?" + exit 1 + fi + [ ! -s $tmp.list ] && touch $tmp.list + for t in $group_list + do + if grep -s "^$t\$" $tmp.list >/dev/null + then + : + else + echo "$t" >>$tmp.list + fi + done + group=3Dfalse + continue + + elif $xgroup + then + # arg after -x + # Populate $tmp.list with all tests + awk '/^[0-9]{3,}/ {print $1}' "${source_iotests}/group" > $tmp.lis= t 2>/dev/null + group_list=3D`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0= -9][0-9][0-9].* $r /"'{ +s/ .*//p +}'` + if [ -z "$group_list" ] + then + echo "Group \"$r\" is empty or not defined?" + exit 1 + fi + numsed=3D0 + rm -f $tmp.sed + for t in $group_list + do + if [ $numsed -gt 100 ] + then + sed -f $tmp.sed <$tmp.list >$tmp.tmp + mv $tmp.tmp $tmp.list + numsed=3D0 + rm -f $tmp.sed + fi + echo "/^$t\$/d" >>$tmp.sed + numsed=3D`expr $numsed + 1` + done + sed -f $tmp.sed <$tmp.list >$tmp.tmp + mv $tmp.tmp $tmp.list + xgroup=3Dfalse + continue + + elif $imgopts + then + IMGOPTS=3D"$r" + imgopts=3Dfalse + continue + elif $cachemode + then + CACHEMODE=3D"$r" + CACHEMODE_IS_DEFAULT=3Dfalse + cachemode=3Dfalse + continue + fi + + xpand=3Dtrue + case "$r" + in + + -\? | -h | --help) # usage + echo "Usage: $0 [options] [testlist]"' + +common options + -v verbose + -d debug + +image format options + -raw test raw (default) + -bochs test bochs + -cloop test cloop + -parallels test parallels + -qcow test qcow + -qcow2 test qcow2 + -qed test qed + -vdi test vdi + -vpc test vpc + -vhdx test vhdx + -vmdk test vmdk + -luks test luks + +image protocol options + -file test file (default) + -rbd test rbd + -sheepdog test sheepdog + -nbd test nbd + -ssh test ssh + -nfs test nfs + -vxhs test vxhs + +other options + -xdiff graphical mode diff + -nocache use O_DIRECT on backing file + -misalign misalign memory allocations + -n show me, do not run tests + -o options -o options to pass to qemu-img create/convert + -T output timestamps + -c mode cache mode + +testlist options + -g group[,group...] include tests from these groups + -x group[,group...] exclude tests from these groups + NNN include test NNN + NNN-NNN include test range (eg. 012-021) +' + exit 0 + ;; + + -raw) + IMGFMT=3Draw + xpand=3Dfalse + ;; + + -bochs) + IMGFMT=3Dbochs + IMGFMT_GENERIC=3Dfalse + xpand=3Dfalse + ;; + + -cloop) + IMGFMT=3Dcloop + IMGFMT_GENERIC=3Dfalse + xpand=3Dfalse + ;; + + -parallels) + IMGFMT=3Dparallels + IMGFMT_GENERIC=3Dfalse + xpand=3Dfalse + ;; + + -qcow) + IMGFMT=3Dqcow + xpand=3Dfalse + ;; + + -qcow2) + IMGFMT=3Dqcow2 + xpand=3Dfalse + ;; + + -luks) + IMGOPTSSYNTAX=3Dtrue + IMGFMT=3Dluks + IMGKEYSECRET=3D123456 + xpand=3Dfalse + ;; + + -qed) + IMGFMT=3Dqed + xpand=3Dfalse + ;; + + -vdi) + IMGFMT=3Dvdi + xpand=3Dfalse + ;; + + -vmdk) + IMGFMT=3Dvmdk + xpand=3Dfalse + ;; + + -vpc) + IMGFMT=3Dvpc + xpand=3Dfalse + ;; + + -vhdx) + IMGFMT=3Dvhdx + xpand=3Dfalse + ;; + + -file) + IMGPROTO=3Dfile + xpand=3Dfalse + ;; + + -rbd) + IMGPROTO=3Drbd + xpand=3Dfalse + ;; + + -sheepdog) + IMGPROTO=3Dsheepdog + xpand=3Dfalse + ;; + + -nbd) + IMGPROTO=3Dnbd + xpand=3Dfalse + ;; + + -vxhs) + IMGPROTO=3Dvxhs + xpand=3Dfalse + ;; + + -ssh) + IMGPROTO=3Dssh + xpand=3Dfalse + ;; + + -nfs) + IMGPROTO=3Dnfs + xpand=3Dfalse + ;; + + -nocache) + CACHEMODE=3D"none" + CACHEMODE_IS_DEFAULT=3Dfalse + xpand=3Dfalse + ;; + + -misalign) + QEMU_IO_OPTIONS=3D"$QEMU_IO_OPTIONS --misalign" + xpand=3Dfalse + ;; + + -valgrind) + VALGRIND_QEMU=3D'y' + xpand=3Dfalse + ;; + + -g) # -g group ... pick from group file + group=3Dtrue + xpand=3Dfalse + ;; + + -xdiff) # graphical diff mode + xpand=3Dfalse + + if [ ! -z "$DISPLAY" ] + then + command -v xdiff >/dev/null 2>&1 && diff=3Dxdiff + command -v gdiff >/dev/null 2>&1 && diff=3Dgdiff + command -v tkdiff >/dev/null 2>&1 && diff=3Dtkdiff + command -v xxdiff >/dev/null 2>&1 && diff=3Dxxdiff + fi + ;; + + -n) # show me, don't do it + showme=3Dtrue + xpand=3Dfalse + ;; + -o) + imgopts=3Dtrue + xpand=3Dfalse + ;; + -c) + cachemode=3Dtrue + xpand=3Dfalse + ;; + -T) # turn on timestamp output + timestamp=3Dtrue + xpand=3Dfalse + ;; + + -v) + verbose=3Dtrue + xpand=3Dfalse + ;; + -d) + debug=3Dtrue + xpand=3Dfalse + ;; + -x) # -x group ... exclude from group file + xgroup=3Dtrue + xpand=3Dfalse + ;; + '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]') + echo "No tests?" + status=3D1 + exit $status + ;; + + [0-9]*-[0-9]*) + eval `echo $r | sed -e 's/^/start=3D/' -e 's/-/ end=3D/'` + ;; + + [0-9]*-) + eval `echo $r | sed -e 's/^/start=3D/' -e 's/-//'` + end=3D`echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\= [0-9]//g' -e 's/ *$//' -e 's/.* //'` + if [ -z "$end" ] + then + echo "No tests in range \"$r\"?" + status=3D1 + exit $status + fi + ;; + + *) + start=3D$r + end=3D$r + ;; + + esac + + # get rid of leading 0s as can be interpreted as octal + start=3D`echo $start | sed 's/^0*//'` + end=3D`echo $end | sed 's/^0*//'` + + if $xpand + then + have_test_arg=3Dtrue + awk /dev/null + then + # in group file ... OK + echo $id >>$tmp.list + else + if [ -f expunged ] && $expunge && egrep "^$id([ ]|= \$)" expunged >/dev/null + then + # expunged ... will be reported, but not run, later + echo $id >>$tmp.list + else + # oops + if [ "$start" =3D=3D "$end" -a "$id" =3D=3D "$end" ] + then + echo "$id - unknown test" + exit 1 + else + echo "$id - unknown test, ignored" + fi + fi + fi + done || exit 1 + fi + +done + +# Set qemu-io cache mode with $CACHEMODE we have +QEMU_IO_OPTIONS=3D"$QEMU_IO_OPTIONS --cache $CACHEMODE" + +QEMU_IO_OPTIONS_NO_FMT=3D"$QEMU_IO_OPTIONS" +if [ "$IMGOPTSSYNTAX" !=3D "true" ]; then + QEMU_IO_OPTIONS=3D"$QEMU_IO_OPTIONS -f $IMGFMT" +fi + +# Set default options for qemu-img create -o if they were not specified +if [ "$IMGFMT" =3D=3D "qcow2" ] && ! (echo "$IMGOPTS" | grep "compat=3D" >= /dev/null); then + IMGOPTS=3D$(_optstr_add "$IMGOPTS" "compat=3D1.1") +fi +if [ "$IMGFMT" =3D=3D "luks" ] && ! (echo "$IMGOPTS" | grep "iter-time=3D"= > /dev/null); then + IMGOPTS=3D$(_optstr_add "$IMGOPTS" "iter-time=3D10") +fi + +if [ -z "$SAMPLE_IMG_DIR" ]; then + SAMPLE_IMG_DIR=3D"$source_iotests/sample_images" +fi + +export TEST_DIR +export SAMPLE_IMG_DIR + +if [ -s $tmp.list ] +then + # found some valid test numbers ... this is good + : +else + if $have_test_arg + then + # had test numbers, but none in group file ... do nothing + touch $tmp.list + else + # no test numbers, do everything from group file + sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <"$source_iotest= s/group" >$tmp.list + fi +fi + +# should be sort -n, but this did not work for Linux when this +# was ported from IRIX +# +list=3D`sort $tmp.list` +rm -f $tmp.list $tmp.tmp $tmp.sed =20 TIMESTAMP_FILE=3Dcheck.time-$IMGPROTO-$IMGFMT =20 diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common deleted file mode 100644 index 35e4d0f87b..0000000000 --- a/tests/qemu-iotests/common +++ /dev/null @@ -1,501 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2009 Red Hat, Inc. -# Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# -# common procedures for QA scripts -# - -_full_imgfmt_details() -{ - if [ -n "$IMGOPTS" ]; then - echo "$IMGFMT ($IMGOPTS)" - else - echo "$IMGFMT" - fi -} - -_full_imgproto_details() -{ - echo "$IMGPROTO" -} - -_full_platform_details() -{ - os=3D`uname -s` - host=3D`hostname -s` - kernel=3D`uname -r` - platform=3D`uname -m` - echo "$os/$platform $host $kernel" -} - -# $1 =3D prog to look for -set_prog_path() -{ - p=3D`command -v $1 2> /dev/null` - if [ -n "$p" -a -x "$p" ]; then - realpath -- "$(type -p "$p")" - else - return 1 - fi -} - -export QEMU_PROG=3D$(realpath -- "$(type -p "$QEMU_PROG")") -export QEMU_IMG_PROG=3D$(realpath -- "$(type -p "$QEMU_IMG_PROG")") -export QEMU_IO_PROG=3D$(realpath -- "$(type -p "$QEMU_IO_PROG")") -export QEMU_NBD_PROG=3D$(realpath -- "$(type -p "$QEMU_NBD_PROG")") -if [ -z "$QEMU_VXHS_PROG" ]; then - export QEMU_VXHS_PROG=3D"`set_prog_path qnio_server`" -fi - -if [ -z "$TEST_DIR" ]; then - TEST_DIR=3D`pwd`/scratch -fi - -if [ ! -e "$TEST_DIR" ]; then - mkdir "$TEST_DIR" -fi - -diff=3D"diff -u" -verbose=3Dfalse -debug=3Dfalse -group=3Dfalse -xgroup=3Dfalse -imgopts=3Dfalse -showme=3Dfalse -sortme=3Dfalse -expunge=3Dtrue -have_test_arg=3Dfalse -cachemode=3Dfalse - -tmp=3D"${TEST_DIR}"/$$ -rm -f $tmp.list $tmp.tmp $tmp.sed - -export IMGFMT=3Draw -export IMGFMT_GENERIC=3Dtrue -export IMGPROTO=3Dfile -export IMGOPTS=3D"" -export CACHEMODE=3D"writeback" -export QEMU_IO_OPTIONS=3D"" -export QEMU_IO_OPTIONS_NO_FMT=3D"" -export CACHEMODE_IS_DEFAULT=3Dtrue -export QEMU_OPTIONS=3D"-nodefaults -machine accel=3Dqtest" -export VALGRIND_QEMU=3D -export IMGKEYSECRET=3D -export IMGOPTSSYNTAX=3Dfalse - -default_machine=3D$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//= p') -default_alias_machine=3D$($QEMU_PROG -machine help | \ - sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }") -if [[ "$default_alias_machine" ]]; then - default_machine=3D"$default_alias_machine" -fi - -export QEMU_DEFAULT_MACHINE=3D"$default_machine" - -for r -do - - if $group - then - # arg after -g - group_list=3D`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0= -9][0-9][0-9].* $r /"'{ -s/ .*//p -}'` - if [ -z "$group_list" ] - then - echo "Group \"$r\" is empty or not defined?" - exit 1 - fi - [ ! -s $tmp.list ] && touch $tmp.list - for t in $group_list - do - if grep -s "^$t\$" $tmp.list >/dev/null - then - : - else - echo "$t" >>$tmp.list - fi - done - group=3Dfalse - continue - - elif $xgroup - then - # arg after -x - # Populate $tmp.list with all tests - awk '/^[0-9]{3,}/ {print $1}' "${source_iotests}/group" > $tmp.lis= t 2>/dev/null - group_list=3D`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0= -9][0-9][0-9].* $r /"'{ -s/ .*//p -}'` - if [ -z "$group_list" ] - then - echo "Group \"$r\" is empty or not defined?" - exit 1 - fi - numsed=3D0 - rm -f $tmp.sed - for t in $group_list - do - if [ $numsed -gt 100 ] - then - sed -f $tmp.sed <$tmp.list >$tmp.tmp - mv $tmp.tmp $tmp.list - numsed=3D0 - rm -f $tmp.sed - fi - echo "/^$t\$/d" >>$tmp.sed - numsed=3D`expr $numsed + 1` - done - sed -f $tmp.sed <$tmp.list >$tmp.tmp - mv $tmp.tmp $tmp.list - xgroup=3Dfalse - continue - - elif $imgopts - then - IMGOPTS=3D"$r" - imgopts=3Dfalse - continue - elif $cachemode - then - CACHEMODE=3D"$r" - CACHEMODE_IS_DEFAULT=3Dfalse - cachemode=3Dfalse - continue - fi - - xpand=3Dtrue - case "$r" - in - - -\? | -h | --help) # usage - echo "Usage: $0 [options] [testlist]"' - -common options - -v verbose - -d debug - -image format options - -raw test raw (default) - -bochs test bochs - -cloop test cloop - -parallels test parallels - -qcow test qcow - -qcow2 test qcow2 - -qed test qed - -vdi test vdi - -vpc test vpc - -vhdx test vhdx - -vmdk test vmdk - -luks test luks - -image protocol options - -file test file (default) - -rbd test rbd - -sheepdog test sheepdog - -nbd test nbd - -ssh test ssh - -nfs test nfs - -vxhs test vxhs - -other options - -xdiff graphical mode diff - -nocache use O_DIRECT on backing file - -misalign misalign memory allocations - -n show me, do not run tests - -o options -o options to pass to qemu-img create/convert - -T output timestamps - -c mode cache mode - -testlist options - -g group[,group...] include tests from these groups - -x group[,group...] exclude tests from these groups - NNN include test NNN - NNN-NNN include test range (eg. 012-021) -' - exit 0 - ;; - - -raw) - IMGFMT=3Draw - xpand=3Dfalse - ;; - - -bochs) - IMGFMT=3Dbochs - IMGFMT_GENERIC=3Dfalse - xpand=3Dfalse - ;; - - -cloop) - IMGFMT=3Dcloop - IMGFMT_GENERIC=3Dfalse - xpand=3Dfalse - ;; - - -parallels) - IMGFMT=3Dparallels - IMGFMT_GENERIC=3Dfalse - xpand=3Dfalse - ;; - - -qcow) - IMGFMT=3Dqcow - xpand=3Dfalse - ;; - - -qcow2) - IMGFMT=3Dqcow2 - xpand=3Dfalse - ;; - - -luks) - IMGOPTSSYNTAX=3Dtrue - IMGFMT=3Dluks - IMGKEYSECRET=3D123456 - xpand=3Dfalse - ;; - - -qed) - IMGFMT=3Dqed - xpand=3Dfalse - ;; - - -vdi) - IMGFMT=3Dvdi - xpand=3Dfalse - ;; - - -vmdk) - IMGFMT=3Dvmdk - xpand=3Dfalse - ;; - - -vpc) - IMGFMT=3Dvpc - xpand=3Dfalse - ;; - - -vhdx) - IMGFMT=3Dvhdx - xpand=3Dfalse - ;; - - -file) - IMGPROTO=3Dfile - xpand=3Dfalse - ;; - - -rbd) - IMGPROTO=3Drbd - xpand=3Dfalse - ;; - - -sheepdog) - IMGPROTO=3Dsheepdog - xpand=3Dfalse - ;; - - -nbd) - IMGPROTO=3Dnbd - xpand=3Dfalse - ;; - - -vxhs) - IMGPROTO=3Dvxhs - xpand=3Dfalse - ;; - - -ssh) - IMGPROTO=3Dssh - xpand=3Dfalse - ;; - - -nfs) - IMGPROTO=3Dnfs - xpand=3Dfalse - ;; - - -nocache) - CACHEMODE=3D"none" - CACHEMODE_IS_DEFAULT=3Dfalse - xpand=3Dfalse - ;; - - -misalign) - QEMU_IO_OPTIONS=3D"$QEMU_IO_OPTIONS --misalign" - xpand=3Dfalse - ;; - - -valgrind) - VALGRIND_QEMU=3D'y' - xpand=3Dfalse - ;; - - -g) # -g group ... pick from group file - group=3Dtrue - xpand=3Dfalse - ;; - - -xdiff) # graphical diff mode - xpand=3Dfalse - - if [ ! -z "$DISPLAY" ] - then - command -v xdiff >/dev/null 2>&1 && diff=3Dxdiff - command -v gdiff >/dev/null 2>&1 && diff=3Dgdiff - command -v tkdiff >/dev/null 2>&1 && diff=3Dtkdiff - command -v xxdiff >/dev/null 2>&1 && diff=3Dxxdiff - fi - ;; - - -n) # show me, don't do it - showme=3Dtrue - xpand=3Dfalse - ;; - -o) - imgopts=3Dtrue - xpand=3Dfalse - ;; - -c) - cachemode=3Dtrue - xpand=3Dfalse - ;; - -T) # turn on timestamp output - timestamp=3Dtrue - xpand=3Dfalse - ;; - - -v) - verbose=3Dtrue - xpand=3Dfalse - ;; - -d) - debug=3Dtrue - xpand=3Dfalse - ;; - -x) # -x group ... exclude from group file - xgroup=3Dtrue - xpand=3Dfalse - ;; - '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]') - echo "No tests?" - status=3D1 - exit $status - ;; - - [0-9]*-[0-9]*) - eval `echo $r | sed -e 's/^/start=3D/' -e 's/-/ end=3D/'` - ;; - - [0-9]*-) - eval `echo $r | sed -e 's/^/start=3D/' -e 's/-//'` - end=3D`echo [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] | sed -e 's/\= [0-9]//g' -e 's/ *$//' -e 's/.* //'` - if [ -z "$end" ] - then - echo "No tests in range \"$r\"?" - status=3D1 - exit $status - fi - ;; - - *) - start=3D$r - end=3D$r - ;; - - esac - - # get rid of leading 0s as can be interpreted as octal - start=3D`echo $start | sed 's/^0*//'` - end=3D`echo $end | sed 's/^0*//'` - - if $xpand - then - have_test_arg=3Dtrue - awk /dev/null - then - # in group file ... OK - echo $id >>$tmp.list - else - if [ -f expunged ] && $expunge && egrep "^$id([ ]|= \$)" expunged >/dev/null - then - # expunged ... will be reported, but not run, later - echo $id >>$tmp.list - else - # oops - if [ "$start" =3D=3D "$end" -a "$id" =3D=3D "$end" ] - then - echo "$id - unknown test" - exit 1 - else - echo "$id - unknown test, ignored" - fi - fi - fi - done || exit 1 - fi - -done - -# Set qemu-io cache mode with $CACHEMODE we have -QEMU_IO_OPTIONS=3D"$QEMU_IO_OPTIONS --cache $CACHEMODE" - -QEMU_IO_OPTIONS_NO_FMT=3D"$QEMU_IO_OPTIONS" -if [ "$IMGOPTSSYNTAX" !=3D "true" ]; then - QEMU_IO_OPTIONS=3D"$QEMU_IO_OPTIONS -f $IMGFMT" -fi - -# Set default options for qemu-img create -o if they were not specified -if [ "$IMGFMT" =3D=3D "qcow2" ] && ! (echo "$IMGOPTS" | grep "compat=3D" >= /dev/null); then - IMGOPTS=3D$(_optstr_add "$IMGOPTS" "compat=3D1.1") -fi -if [ "$IMGFMT" =3D=3D "luks" ] && ! (echo "$IMGOPTS" | grep "iter-time=3D"= > /dev/null); then - IMGOPTS=3D$(_optstr_add "$IMGOPTS" "iter-time=3D10") -fi - -if [ -z "$SAMPLE_IMG_DIR" ]; then - SAMPLE_IMG_DIR=3D"$source_iotests/sample_images" -fi - -export TEST_DIR -export SAMPLE_IMG_DIR - -if [ -s $tmp.list ] -then - # found some valid test numbers ... this is good - : -else - if $have_test_arg - then - # had test numbers, but none in group file ... do nothing - touch $tmp.list - else - # no test numbers, do everything from group file - sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <"$source_iotest= s/group" >$tmp.list - fi -fi - -# should be sort -n, but this did not work for Linux when this -# was ported from IRIX -# -list=3D`sort $tmp.list` -rm -f $tmp.list $tmp.tmp $tmp.sed --=20 2.13.3