From nobody Sun Feb 8 21:28:32 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1603269816; cv=none; d=zohomail.com; s=zohoarc; b=XJz3s4gmfkPNNgSo1uvUPqfmJBWcDhj0lu9Vwwkhp/Nr2HLV5Wbs3VVQMWJ710OpIM4NTKbnSDTja96RvgnGnQI7TjbYboAQ7aD0U7/JvpRtYUp9jHVEMBgdwzRdI5sGP6r+sqA5A1KIOg3e+W+ry37hkX5GenTZgctgTKA4g/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603269816; 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=G3/qvD7M5OsaVFWaMGZJVZc+J1BxXQBPntz+FgrL7i4=; b=X8ALqk5Yf/7T0er9CnRZlM9Pwx16dAMWn8tKECL8+gXQCa8d3EZZ8HRmVLlUvh/cspNEzpsdTm2V3iIydfy9BeP39kx4s8HCpncFu/3+Bka/izxWQDNDsCZJ4h6ylvPqFsVkHB7wjQczC/PS1bYYH/Ae6HVCf0cE4jo6SH15TbE= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603269816172567.4366700275671; Wed, 21 Oct 2020 01:43:36 -0700 (PDT) Received: from localhost ([::1]:33200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kV9iZ-00035T-GC for importer@patchew.org; Wed, 21 Oct 2020 04:43:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kV8do-0002nZ-PH; Wed, 21 Oct 2020 03:34:36 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5196 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kV8dm-0004LN-Es; Wed, 21 Oct 2020 03:34:36 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1151A157D69E328213EB; Wed, 21 Oct 2020 15:34:24 +0800 (CST) Received: from DESKTOP-IB00AOP.china.huawei.com (10.174.184.163) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Wed, 21 Oct 2020 15:34:14 +0800 From: To: Subject: [PATCH 4/4] qemu-iotest: add 311 testcase Date: Wed, 21 Oct 2020 15:33:55 +0800 Message-ID: <20201021073355.2499-5-likejun6@huawei.com> X-Mailer: git-send-email 2.22.0.windows.1 In-Reply-To: <20201021073355.2499-1-likejun6@huawei.com> References: <20201021073355.2499-1-likejun6@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.174.184.163] X-CFilter-Loop: Reflected 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=45.249.212.190; envelope-from=likejun6@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 03:34:24 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 21 Oct 2020 04:40:13 -0400 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: kwolf@redhat.com, zhang.zhanghailiang@huawei.com, qemu-devel@nongnu.org, xiexiangyou@huawei.com, mreitz@redhat.com, likejun Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: likejun Test backing file is raw Signed-off-by: likejun --- tests/qemu-iotests/311 | 70 ++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/311.out | 30 ++++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 101 insertions(+) create mode 100755 tests/qemu-iotests/311 create mode 100644 tests/qemu-iotests/311.out diff --git a/tests/qemu-iotests/311 b/tests/qemu-iotests/311 new file mode 100755 index 0000000000..6c2b9f987f --- /dev/null +++ b/tests/qemu-iotests/311 @@ -0,0 +1,70 @@ +#!/bin/bash +# +# Test backing file is raw +# +# Copyright (C) 2020 Huawei, 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 . +# + +# creator +owner=3Dzhangshuai13@huawei.com + +seq=3D`basename $0` +echo "QA output created by $seq" + +status=3D1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc >/dev/null 2>&1 +. ./common.filter + +_supported_fmt qcow2 +_supported_proto file +_supported_os Linux + +echo "=3D=3D=3D Check qemu-img info output =3D=3D=3D" +echo +size=3D64M + +$QEMU_IMG create -f raw $TEST_IMG $size | _filter_img_create +_img_info | _filter_img_info +mv "$TEST_IMG" "$TEST_IMG.base" + +_make_test_img -b $TEST_IMG.base -F raw +_img_info --backing-chain | _filter_img_info + +echo +echo "=3D=3D reading whole image =3D=3D" +$QEMU_IO -c "read 0 $size" "$TEST_IMG" | _filter_qemu_io + +echo +echo "=3D=3D rewriting whole image =3D=3D" +$QEMU_IO -c "write -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io + +echo +echo "=3D=3D verify pattern =3D=3D" +$QEMU_IO -c "read -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io + + +# success, all done +echo "*** done" +rm -f $seq.full +status=3D0 diff --git a/tests/qemu-iotests/311.out b/tests/qemu-iotests/311.out new file mode 100644 index 0000000000..03b8374c04 --- /dev/null +++ b/tests/qemu-iotests/311.out @@ -0,0 +1,30 @@ +QA output created by 311 +=3D=3D=3D Check qemu-img info output =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3Draw size=3D67108864 +image: TEST_DIR/t.IMGFMT +file format: raw +virtual size: 64 MiB (67108864 bytes) +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 backing_file= =3DTEST_DIR/t.IMGFMT.base backing_fmt=3Draw +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 64 MiB (67108864 bytes) +backing file: TEST_DIR/t.IMGFMT.base +backing file format: raw + +image: TEST_DIR/t.IMGFMT.base +file format: raw +virtual size: 64 MiB (67108864 bytes) + +=3D=3D reading whole image =3D=3D +read 67108864/67108864 bytes at offset 0 +64 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D rewriting whole image =3D=3D +wrote 67108864/67108864 bytes at offset 0 +64 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D verify pattern =3D=3D +read 67108864/67108864 bytes at offset 0 +64 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index e8b6480890..ec57e16f07 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -318,3 +318,4 @@ 308 rw auto quick 309 rw auto quick 310 rw auto quick +311 rw auto quick --=20 2.19.1