From nobody Fri Nov 14 00:48:46 2025 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=1583936176; cv=none; d=zohomail.com; s=zohoarc; b=Qh1Fvs56aK+PnYFPNcLv1qaAZayuAy735J6Bm+hkzLBXbSSkzftI0VDVYd1bUdhWXZJPZVuazCZLpZn9wL5XUSUb7P48lRGmeeWWsJbhHa+RLvvpQ3NdlWkBCsoiXbGkLmZYVjNlYpLmdxvIV+7Cj3byWSqreT9eRWpJ5mRxOec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583936176; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=q1+xKLvY0Rc5gYIni1A+NEFzbp/PMO7k9dQobpBzxFc=; b=cDEW5G37S2KP9yqWrSyCgNatd8bU1phKQIh9B70FNl0meLDpvmWyUc3bou5x8K3OILrSHWMJMVREHRcQ7ZJQLIg+f8aPlUzzNyhmO1smzWyvBtTATt2Ki+z9xb1f7BjoZEt2h2hJcMoG41CjIJy7e7sovFkUIiRUt5zDfyblYP4= 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 1583936176594825.925442404773; Wed, 11 Mar 2020 07:16:16 -0700 (PDT) Received: from localhost ([::1]:53134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC29d-0004oO-8V for importer@patchew.org; Wed, 11 Mar 2020 10:16:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40613) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC211-0007ZE-Fn for qemu-devel@nongnu.org; Wed, 11 Mar 2020 10:07:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jC20y-0005Pr-Ut for qemu-devel@nongnu.org; Wed, 11 Mar 2020 10:07:18 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:40737 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jC20y-0005Pf-RG for qemu-devel@nongnu.org; Wed, 11 Mar 2020 10:07:16 -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-301-iBSJ08WePqO8yqTbTeyIeg-1; Wed, 11 Mar 2020 10:07:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34F3D1006183; Wed, 11 Mar 2020 14:07:10 +0000 (UTC) Received: from localhost (ovpn-117-216.ams2.redhat.com [10.36.117.216]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D0ED10013A1; Wed, 11 Mar 2020 14:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583935636; 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; bh=q1+xKLvY0Rc5gYIni1A+NEFzbp/PMO7k9dQobpBzxFc=; b=MTowrT896tZ5C37WPKtfw2SfWh3yXCrsUb+JwsVg44tydxOTVMuRFrdVx3xgp8OObOVsMC uEMPbTitKWxF9CK0bU4WVOqPFaaW5xnzhNq6k/zNYOghdvk9qRZf2O8XLWsX68Vnh2YsqY l0G4fo3GKXyR/A3JZMPGGRxEebTRChI= X-MC-Unique: iBSJ08WePqO8yqTbTeyIeg-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PATCH] iotests/026: Move v3-exclusive test to new file Date: Wed, 11 Mar 2020 15:07:07 +0100 Message-Id: <20200311140707.1243218-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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] [fuzzy] X-Received-From: 207.211.31.120 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 , 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 Reviewed-by: John Snow Tested-by: John Snow --- 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" <