From nobody Sun May 19 20:47:30 2024 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=1603269692; cv=none; d=zohomail.com; s=zohoarc; b=ba5yl12MTP7vj40pVPkIrfGF1UeY/JoXhMOkRee/wmnnLgQyts06XGT3UGuLg5Di3lVIXuNPJXi9DX8OPKTybzxvOYGnqJoLh98aEZ4wJ6jXft9HgI7DSwd3T/j6qTj40UZ2wueFmrbsV5nMVNU8iYePXoPFg/2NYHKbhmX/NEQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603269692; 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=0FNldpcBbMKpAQRcN5FXTNEFIOMpQ2JxXjD9I6wFeg8=; b=BweWwolNug32q/L0hrBwsc3E4DCDGmJXe6K8JYDXCbQZ93dhRVklSjEVqOYeRuh3zfWIjMy1FaM8IYgSi+lMegSA+mML4+aAoH0tPL4Hx1tIyPhgc3aLm0im247CfgWeD9yiqEWXNfL2hIh1A+MM9S4BLVkfhR59s6AdAKT6oq4= 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 1603269692310999.4134628183386; Wed, 21 Oct 2020 01:41:32 -0700 (PDT) Received: from localhost ([::1]:53842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kV9gZ-0008QS-8L for importer@patchew.org; Wed, 21 Oct 2020 04:41:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kV8dm-0002mt-LE; Wed, 21 Oct 2020 03:34:34 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5709 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 1kV8di-0004Jd-2F; Wed, 21 Oct 2020 03:34:34 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 09EE45E5C61C7C790572; Wed, 21 Oct 2020 15:34:19 +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:12 +0800 From: To: Subject: [PATCH 1/4] qemu-iotest: add 308 testcase Date: Wed, 21 Oct 2020 15:33:52 +0800 Message-ID: <20201021073355.2499-2-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.191; envelope-from=likejun6@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 03:34:19 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:10 -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 thick image creation, size and rw Signed-off-by: likejun --- tests/qemu-iotests/308 | 104 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/308.out | 21 ++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 126 insertions(+) create mode 100755 tests/qemu-iotests/308 create mode 100644 tests/qemu-iotests/308.out diff --git a/tests/qemu-iotests/308 b/tests/qemu-iotests/308 new file mode 100755 index 0000000000..a97e312017 --- /dev/null +++ b/tests/qemu-iotests/308 @@ -0,0 +1,104 @@ +#!/bin/bash +# +# Test thick image creation, size and rw +# +# 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 + +_img_info_tmp() +{ + if [[ "$1" =3D=3D "--format-specific" ]]; then + local format_specific=3D1 + shift + else + local format_specific=3D0 + fi + + discard=3D0 + regex_json_spec_start=3D'^ *"format-specific": \{' + $QEMU_IMG info "$@" "$TEST_IMG" 2>&1 | \ + sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ + -e "s#$TEST_DIR#TEST_DIR#g" \ + -e "s#$IMGFMT#IMGFMT#g" \ + -e "/actual-size/ D" | \ + while IFS=3D'' read line; do + if [[ $format_specific =3D=3D 1 ]]; then + discard=3D0 + elif [[ $line =3D=3D "Format specific information:" ]]; then + discard=3D1 + elif [[ $line =3D~ $regex_json_spec_start ]]; then + discard=3D2 + regex_json_spec_end=3D"^${line%%[^ ]*}\\},? *$" + fi + if [[ $discard =3D=3D 0 ]]; then + echo "$line" + elif [[ $discard =3D=3D 1 && ! $line ]]; then + echo + discard=3D0 + elif [[ $discard =3D=3D 2 && $line =3D~ $regex_json_spec_end ]= ]; then + discard=3D0 + fi + done +} + +IMGOPTS=3D"preallocation=3Dfull" + +echo "=3D=3D=3D Check qemu-img info output =3D=3D=3D" +echo +size=3D64M + +_make_test_img $size +_img_info_tmp | _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/308.out b/tests/qemu-iotests/308.out new file mode 100644 index 0000000000..209237c8c8 --- /dev/null +++ b/tests/qemu-iotests/308.out @@ -0,0 +1,21 @@ +QA output created by 308 +=3D=3D=3D Check qemu-img info output =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 preallocation= =3Dfull +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 64 MiB (67108864 bytes) +disk size: 64.3 MiB + +=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 3432989283..25a876ef20 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -315,3 +315,4 @@ 304 rw quick 305 rw quick 307 rw quick export +308 rw auto quick --=20 2.19.1 From nobody Sun May 19 20:47:30 2024 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=1603269695; cv=none; d=zohomail.com; s=zohoarc; b=dvE/Y+CUMd/98WVa8P9ErFlKCKTjTnas9xAa12Zby51rCIAea8lVJxDwG34P9zU4+b+7Wz0CTAp5077njVWPrQsLgJs10M6E8gHaBUolXIFgNhTVyxV6HPaUe0BjXd/Tnl4FYlKAhCR0AJYl1A44tTE0W8ws1316KIXyuxlWft8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603269695; 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=9gyYXzUT/vA9E0CPqdU/TWhDhRgwJ2Bzd7PfNKzoh/Q=; b=PLDAlJr6eB2lZ+DDh5cGQ3pcyq7E04PAIPKmdxKsUNOX3ibO81YpnCh950edVzq/1Vt7604pJf9UWxLyD9J7/yNlxtCqXP9A1P2OU5q2yK2zmz3/iYbJ4QuLMEILTew6F5L6TSUlN5NPy5ramXKmkC/eEPZ/IRYv+8fkJeS35sI= 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 1603269695015680.5755655587454; Wed, 21 Oct 2020 01:41:35 -0700 (PDT) Received: from localhost ([::1]:54210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kV9gc-000083-5a for importer@patchew.org; Wed, 21 Oct 2020 04:41:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kV8do-0002nB-3p; Wed, 21 Oct 2020 03:34:36 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5711 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 1kV8dl-0004Je-0p; Wed, 21 Oct 2020 03:34:35 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 04E976EB4376A049350F; Wed, 21 Oct 2020 15:34:19 +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:12 +0800 From: To: Subject: [PATCH 2/4] qemu-iotest: add 309 testcase Date: Wed, 21 Oct 2020 15:33:53 +0800 Message-ID: <20201021073355.2499-3-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.191; envelope-from=likejun6@huawei.com; helo=huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 03:34:19 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:12 -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 raw thin provisioned image creation, size and rw Signed-off-by: likejun --- tests/qemu-iotests/309 | 102 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/309.out | 21 ++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 124 insertions(+) create mode 100755 tests/qemu-iotests/309 create mode 100644 tests/qemu-iotests/309.out diff --git a/tests/qemu-iotests/309 b/tests/qemu-iotests/309 new file mode 100755 index 0000000000..7bbe5a1704 --- /dev/null +++ b/tests/qemu-iotests/309 @@ -0,0 +1,102 @@ +#!/bin/bash +# +# Test raw thin provisioned image creation, size and rw +# +# 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 + +_img_info_tmp() +{ + if [[ "$1" =3D=3D "--format-specific" ]]; then + local format_specific=3D1 + shift + else + local format_specific=3D0 + fi + + discard=3D0 + regex_json_spec_start=3D'^ *"format-specific": \{' + $QEMU_IMG info "$@" "$TEST_IMG" 2>&1 | \ + sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ + -e "s#$TEST_DIR#TEST_DIR#g" \ + -e "s#$IMGFMT#IMGFMT#g" \ + -e "/actual-size/ D" | \ + while IFS=3D'' read line; do + if [[ $format_specific =3D=3D 1 ]]; then + discard=3D0 + elif [[ $line =3D=3D "Format specific information:" ]]; then + discard=3D1 + elif [[ $line =3D~ $regex_json_spec_start ]]; then + discard=3D2 + regex_json_spec_end=3D"^${line%%[^ ]*}\\},? *$" + fi + if [[ $discard =3D=3D 0 ]]; then + echo "$line" + elif [[ $discard =3D=3D 1 && ! $line ]]; then + echo + discard=3D0 + elif [[ $discard =3D=3D 2 && $line =3D~ $regex_json_spec_end ]= ]; then + discard=3D0 + fi + done +} + +echo "=3D=3D=3D Check qemu-img info output =3D=3D=3D" +echo +size=3D64M + +_make_test_img $size +_img_info_tmp | _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/309.out b/tests/qemu-iotests/309.out new file mode 100644 index 0000000000..c5e7757a15 --- /dev/null +++ b/tests/qemu-iotests/309.out @@ -0,0 +1,21 @@ +QA output created by 309 +=3D=3D=3D Check qemu-img info output =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 64 MiB (67108864 bytes) +disk size: 196 KiB + +=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 25a876ef20..632a05b25e 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -316,3 +316,4 @@ 305 rw quick 307 rw quick export 308 rw auto quick +309 rw auto quick --=20 2.19.1 From nobody Sun May 19 20:47:30 2024 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=1603269697; cv=none; d=zohomail.com; s=zohoarc; b=FwaoGk2l0Gc0/j9Q57NQXBhSKb3TMydXKIxFUphH2tcq/Osv1yPu5weoUkJafRrkIgpngag/4ggi4STusigDV+uI7D8XHPGljaSd5fc+aAOI2ocDY5YABxVPZY547FyMk70UN/jcADUDQh2xU8qID21pcD6DsBLwRvPFTqBhTJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603269697; 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=6dzWq0TU/WDjwS0VqD0rG1nw7L69JuklfWwC1zj6sAQ=; b=QqltSCCRDtiBbdCJe0VWqYVtmvGF/9EdpefRwWEPEvcmTHpjvzISt4oAJD3+8hoK9rCYFcdM+cHux0SSwHJgcEGPWUs3adFWEPRxs6pRQx9ccn5M9U6Llbqme5Y3ADTPT1tC+yCtNPE8TAj2Q3gLBIhEYOyuZnoqz25g9R9aArI= 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 1603269697696297.73443525664356; Wed, 21 Oct 2020 01:41:37 -0700 (PDT) Received: from localhost ([::1]:54448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kV9ge-0000EM-Vh for importer@patchew.org; Wed, 21 Oct 2020 04:41:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kV8dp-0002ni-2n; Wed, 21 Oct 2020 03:34:37 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5197 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-0004LO-RU; 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 166D8F0BEA3EAEAD8D1B; 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:13 +0800 From: To: Subject: [PATCH 3/4] qemu-iotest: add 310 testcase Date: Wed, 21 Oct 2020 15:33:54 +0800 Message-ID: <20201021073355.2499-4-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:16 -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 falloc image creation, size and rw Signed-off-by: likejun --- tests/qemu-iotests/310 | 104 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/310.out | 21 ++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 126 insertions(+) create mode 100755 tests/qemu-iotests/310 create mode 100644 tests/qemu-iotests/310.out diff --git a/tests/qemu-iotests/310 b/tests/qemu-iotests/310 new file mode 100755 index 0000000000..af9f03e91f --- /dev/null +++ b/tests/qemu-iotests/310 @@ -0,0 +1,104 @@ +#!/bin/bash +# +# Test falloc image creation, size and rw +# +# 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 + +_img_info_tmp() +{ + if [[ "$1" =3D=3D "--format-specific" ]]; then + local format_specific=3D1 + shift + else + local format_specific=3D0 + fi + + discard=3D0 + regex_json_spec_start=3D'^ *"format-specific": \{' + $QEMU_IMG info "$@" "$TEST_IMG" 2>&1 | \ + sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \ + -e "s#$TEST_DIR#TEST_DIR#g" \ + -e "s#$IMGFMT#IMGFMT#g" \ + -e "/actual-size/ D" | \ + while IFS=3D'' read line; do + if [[ $format_specific =3D=3D 1 ]]; then + discard=3D0 + elif [[ $line =3D=3D "Format specific information:" ]]; then + discard=3D1 + elif [[ $line =3D~ $regex_json_spec_start ]]; then + discard=3D2 + regex_json_spec_end=3D"^${line%%[^ ]*}\\},? *$" + fi + if [[ $discard =3D=3D 0 ]]; then + echo "$line" + elif [[ $discard =3D=3D 1 && ! $line ]]; then + echo + discard=3D0 + elif [[ $discard =3D=3D 2 && $line =3D~ $regex_json_spec_end ]= ]; then + discard=3D0 + fi + done +} + +IMGOPTS=3D"preallocation=3Dfalloc" + +echo "=3D=3D=3D Check qemu-img info output =3D=3D=3D" +echo +size=3D64M + +_make_test_img $size +_img_info_tmp | _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/310.out b/tests/qemu-iotests/310.out new file mode 100644 index 0000000000..dcca649360 --- /dev/null +++ b/tests/qemu-iotests/310.out @@ -0,0 +1,21 @@ +QA output created by 310 +=3D=3D=3D Check qemu-img info output =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 preallocation= =3Dfalloc +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 64 MiB (67108864 bytes) +disk size: 64.3 MiB + +=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 632a05b25e..e8b6480890 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -317,3 +317,4 @@ 307 rw quick export 308 rw auto quick 309 rw auto quick +310 rw auto quick --=20 2.19.1 From nobody Sun May 19 20:47:30 2024 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