From nobody Sun Apr 13 10:55:54 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1674217994; cv=none; d=zohomail.com; s=zohoarc; b=MHbKeCc5BpFDaj9T9PfRkBwkTiIdgereRjc+Y90uNnotGXkBhE5gQes4/IfaMciz97HlJ3WAVQFw9B/I8TdtlvjX6+vi0mg+exI2ukmnI52BUzU39bXgLfRAuL/r8eqxGqBTkPussTwSJAtOUlDBdKk/UXmdqwS7NulKqDfkNwA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674217994; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GKojYdrMESCd942kK/e4cqghIL9ZAsgeFTcF29GcQWE=; b=baq6qztwm8Pj8vU/chVLdrerBpK9qbCkEJ07kWmFxkPtZRiReBScYzQlO1Tm49Efdq1NTkkjohYzcwTiQXcuQI8aAXJfkvMvEuZ/SiRJrta8qXec7kZC1IrbTcBy2ckU+Z5BHGm8MvWdJJXwRLBsI2Rd43eiIKbvk90dZh/76Pw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674217994642620.7310796302423; Fri, 20 Jan 2023 04:33:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIqUN-0003Q9-NZ; Fri, 20 Jan 2023 07:27:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIqUL-0003Mv-JV for qemu-devel@nongnu.org; Fri, 20 Jan 2023 07:27:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIqUJ-0000VJ-U2 for qemu-devel@nongnu.org; Fri, 20 Jan 2023 07:27:21 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-335-yP3j3AciP-Sc-BHIi8AL5w-1; Fri, 20 Jan 2023 07:27:15 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8F4D6101157B; Fri, 20 Jan 2023 12:27:15 +0000 (UTC) Received: from merkur.fritz.box (unknown [10.39.193.74]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4E4A40C6EC4; Fri, 20 Jan 2023 12:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674217639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GKojYdrMESCd942kK/e4cqghIL9ZAsgeFTcF29GcQWE=; b=W7jJUJDcaZbmvD3k0khehOWhkJvlyQxnrjfypWjzKdJE192hZmcX0JkUo8tJgKueY/2cFi +Rcw9GrcVkDmJLw44MuJ7Hck1Zn14sY1GLa1AN2dZpXxYWevL3NyIa9s/9MEY5d/pfbW4z Vhwnc0KC9uEJGZ10imaPvI0w+bQMPF0= X-MC-Unique: yP3j3AciP-Sc-BHIi8AL5w-1 From: Kevin Wolf To: qemu-block@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PULL 36/38] iotests/106, 214, 308: Read only one size line Date: Fri, 20 Jan 2023 13:26:31 +0100 Message-Id: <20230120122633.84983-37-kwolf@redhat.com> In-Reply-To: <20230120122633.84983-1-kwolf@redhat.com> References: <20230120122633.84983-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1674217995291100001 Content-Type: text/plain; charset="utf-8" From: Hanna Reitz These tests read size information (sometimes disk size, sometimes virtual size) from qemu-img info's output. Once qemu-img starts printing info about child nodes, we are going to see multiple instances of that per image, but these tests are only interested in the first one, so use "head -n 1" to get it. Signed-off-by: Hanna Reitz Message-Id: <20220620162704.80987-11-hreitz@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/106 | 4 ++-- tests/qemu-iotests/214 | 6 ++++-- tests/qemu-iotests/308 | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/106 b/tests/qemu-iotests/106 index 9d6adb542d..ae0fc46691 100755 --- a/tests/qemu-iotests/106 +++ b/tests/qemu-iotests/106 @@ -66,7 +66,7 @@ for create_mode in off falloc full; do expected_size=3D$((expected_size + $GROWTH_SIZE)) fi =20 - actual_size=3D$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'di= sk size') + actual_size=3D$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'di= sk size' | head -n 1) actual_size=3D$(echo "$actual_size" | sed -e 's/^[^0-9]*\([0-9]\+\= ).*$/\1/') =20 # The actual size may exceed the expected size, depending on the f= ile @@ -105,7 +105,7 @@ for growth_mode in falloc full; do _make_test_img -o "extent_size_hint=3D0" 2G $QEMU_IMG resize -f "$IMGFMT" --preallocation=3D$growth_mode "$TEST_IM= G" +${GROWTH_SIZE}K =20 - actual_size=3D$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'disk s= ize') + actual_size=3D$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'disk s= ize' | head -n 1) actual_size=3D$(echo "$actual_size" | sed -e 's/^[^0-9]*\([0-9]\+\).*$= /\1/') =20 if [ $actual_size -lt $GROWTH_SIZE ]; then diff --git a/tests/qemu-iotests/214 b/tests/qemu-iotests/214 index c66e246ba2..55ffcd7f44 100755 --- a/tests/qemu-iotests/214 +++ b/tests/qemu-iotests/214 @@ -102,7 +102,8 @@ let data_size=3D"8 * $cluster_size" $QEMU_IO -c "write -P 0xaa 0 $data_size" "$TEST_IMG" \ 2>&1 | _filter_qemu_io | _filter_testdir sizeA=3D$($QEMU_IMG info --output=3Djson "$TEST_IMG" | - sed -n '/"actual-size":/ s/[^0-9]//gp') + sed -n '/"actual-size":/ s/[^0-9]//gp' | + head -n 1) =20 _make_test_img 2M -o cluster_size=3D$cluster_size echo "Write compressed data:" @@ -124,7 +125,8 @@ $QEMU_IO -c "write -P 0xcc $offset $data_size" "json:{\ _filter_qemu_io | _filter_testdir =20 sizeB=3D$($QEMU_IMG info --output=3Djson "$TEST_IMG" | - sed -n '/"actual-size":/ s/[^0-9]//gp') + sed -n '/"actual-size":/ s/[^0-9]//gp' | + head -n 1) =20 if [ $sizeA -lt $sizeB ] then diff --git a/tests/qemu-iotests/308 b/tests/qemu-iotests/308 index bde4aac2fa..09275e9a10 100755 --- a/tests/qemu-iotests/308 +++ b/tests/qemu-iotests/308 @@ -217,12 +217,12 @@ echo echo '=3D=3D=3D Remove export =3D=3D=3D' =20 # Double-check that $EXT_MP appears as a non-empty file (the raw image) -$QEMU_IMG info -f raw "$EXT_MP" | grep 'virtual size' +$QEMU_IMG info -f raw "$EXT_MP" | grep 'virtual size' | head -n 1 =20 fuse_export_del 'export-mp' =20 # See that the file appears empty again -$QEMU_IMG info -f raw "$EXT_MP" | grep 'virtual size' +$QEMU_IMG info -f raw "$EXT_MP" | grep 'virtual size' | head -n 1 =20 echo echo '=3D=3D=3D Writable export =3D=3D=3D' --=20 2.38.1