From nobody Mon Feb 9 16:02:18 2026 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585052719; cv=none; d=zohomail.com; s=zohoarc; b=BE64Q2nT0qy+vOdftqPVKMYsBPMuAkSh2bfUyEuuspyNnn+S+kIZJUXfggEFNZqIrIR2cbR/FeM8CWq1TIzWn/rlfOUKoFZv++MgZwYHTqDdoi+WapaEyi6/JZn/Idxa9PXIrsLsDMTz89vj41V0dpr2//KMfZzeJti+TS8AeHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585052719; h=Content-Type: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=Ah8bOhnAqJ3nIIRfmGaTBRsQaL0HlDpJ9Py310uZSO4=; b=OnJ05BloOO80ZA0EvCY2LeVFOkHCb6H/wks6C9Q6YnymDjD/s0z5jCIuIBot3F2usiwpo9ck/uQ+soVNt3FJdR40dsxlWwnJh8uSJ1bQ40sb5N4Uhmdbhey/d1GJ/kqoSXMvt6aFr1JbMgmDEQdim7yy8pMrirdx6lmLoayRgL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585052719170731.7100905178077; Tue, 24 Mar 2020 05:25:19 -0700 (PDT) Received: from localhost ([::1]:47940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGicP-0001Dw-Sf for importer@patchew.org; Tue, 24 Mar 2020 08:25:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41288) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGiYU-0004Sm-Ft for qemu-devel@nongnu.org; Tue, 24 Mar 2020 08:21:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGiYS-00082m-Jq for qemu-devel@nongnu.org; Tue, 24 Mar 2020 08:21:14 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:26131) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGiYS-00082c-Fb for qemu-devel@nongnu.org; Tue, 24 Mar 2020 08:21:12 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-80-6SJ05763MaS7xeNv8LIvjA-1; Tue, 24 Mar 2020 08:21:08 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 938228017CC; Tue, 24 Mar 2020 12:21:07 +0000 (UTC) Received: from localhost (ovpn-114-213.ams2.redhat.com [10.36.114.213]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8B7FBBBC2; Tue, 24 Mar 2020 12:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585052472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ah8bOhnAqJ3nIIRfmGaTBRsQaL0HlDpJ9Py310uZSO4=; b=RwkpU1AJl5qZvwlyhM8EpumaHbg8v4Ey0R9cem9b2xqG5Py8QhK4RoyeJz472qo5uH8MWT hRGGT58gXXjLQIlDUfpX2EUoY1nPj/foXl7foMah3IP9bmc3emrnlf9bSwNoZaXT3TRw4F Ge/MqGIAKFE6QAcbuwQoIMr6EQVUDS8= X-MC-Unique: 6SJ05763MaS7xeNv8LIvjA-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 6/6] iotests/026: Move v3-exclusive test to new file Date: Tue, 24 Mar 2020 13:20:44 +0100 Message-Id: <20200324122044.1131326-7-mreitz@redhat.com> In-Reply-To: <20200324122044.1131326-1-mreitz@redhat.com> References: <20200324122044.1131326-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 63.128.21.74 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" data_file does not work with v2, and we probably want 026 to keep working for v2 images. Thus, open a new file for v3-exclusive error path test cases. Fixes: 81311255f217859413c94f2cd9cebf2684bbda94 (=E2=80=9Ciotests/026: Test EIO on allocation in a data-file=E2=80= =9D) Signed-off-by: Max Reitz Message-Id: <20200311140707.1243218-1-mreitz@redhat.com> Reviewed-by: John Snow Tested-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/026 | 31 ----------- tests/qemu-iotests/026.out | 6 -- tests/qemu-iotests/026.out.nocache | 6 -- tests/qemu-iotests/289 | 89 ++++++++++++++++++++++++++++++ tests/qemu-iotests/289.out | 8 +++ tests/qemu-iotests/group | 1 + 6 files changed, 98 insertions(+), 43 deletions(-) create mode 100755 tests/qemu-iotests/289 create mode 100644 tests/qemu-iotests/289.out diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026 index b05a4692cf..b9713eb591 100755 --- a/tests/qemu-iotests/026 +++ b/tests/qemu-iotests/026 @@ -240,37 +240,6 @@ $QEMU_IO -c "write 0 $CLUSTER_SIZE" "$BLKDBG_TEST_IMG"= | _filter_qemu_io =20 _check_test_img =20 -echo -echo =3D=3D=3D Avoid freeing external data clusters on failure =3D=3D=3D -echo - -# Similar test as the last one, except we test what happens when there -# is an error when writing to an external data file instead of when -# writing to a preallocated zero cluster -_make_test_img -o "data_file=3D$TEST_IMG.data_file" $CLUSTER_SIZE - -# Put blkdebug above the data-file, and a raw node on top of that so -# that blkdebug will see a write_aio event and emit an error -$QEMU_IO -c "write 0 $CLUSTER_SIZE" \ - "json:{ - 'driver': 'qcow2', - 'file': { 'driver': 'file', 'filename': '$TEST_IMG' }, - 'data-file': { - 'driver': 'raw', - 'file': { - 'driver': 'blkdebug', - 'config': '$TEST_DIR/blkdebug.conf', - 'image': { - 'driver': 'file', - 'filename': '$TEST_IMG.data_file' - } - } - } - }" \ - | _filter_qemu_io - -_check_test_img - # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/026.out b/tests/qemu-iotests/026.out index c1b3b58482..83989996ff 100644 --- a/tests/qemu-iotests/026.out +++ b/tests/qemu-iotests/026.out @@ -653,10 +653,4 @@ wrote 1024/1024 bytes at offset 0 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) write failed: Input/output error No errors were found on the image. - -=3D=3D=3D Avoid freeing external data clusters on failure =3D=3D=3D - -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1024 data_file=3DTEST_= DIR/t.IMGFMT.data_file -write failed: Input/output error -No errors were found on the image. *** done diff --git a/tests/qemu-iotests/026.out.nocache b/tests/qemu-iotests/026.ou= t.nocache index 8d5001648a..9359d26d7e 100644 --- a/tests/qemu-iotests/026.out.nocache +++ b/tests/qemu-iotests/026.out.nocache @@ -661,10 +661,4 @@ wrote 1024/1024 bytes at offset 0 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) write failed: Input/output error No errors were found on the image. - -=3D=3D=3D Avoid freeing external data clusters on failure =3D=3D=3D - -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1024 data_file=3DTEST_= DIR/t.IMGFMT.data_file -write failed: Input/output error -No errors were found on the image. *** done diff --git a/tests/qemu-iotests/289 b/tests/qemu-iotests/289 new file mode 100755 index 0000000000..1c11d4030e --- /dev/null +++ b/tests/qemu-iotests/289 @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# +# qcow2 v3-exclusive error path testing +# (026 tests paths common to v2 and v3) +# +# Copyright (C) 2020 Red Hat, Inc. +# +# 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; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will 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 . +# + +seq=3D$(basename $0) +echo "QA output created by $seq" + +status=3D1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img + rm "$TEST_DIR/blkdebug.conf" + rm -f "$TEST_IMG.data_file" +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.pattern + +_supported_fmt qcow2 +_supported_proto file +# This is a v3-exclusive test; +# As for data_file, error paths often very much depend on whether +# there is an external data file or not; so we create one exactly when +# we want to test it +_unsupported_imgopts 'compat=3D0.10' data_file + +echo +echo =3D=3D=3D Avoid freeing external data clusters on failure =3D=3D=3D +echo + +cat > "$TEST_DIR/blkdebug.conf" <