On 01.09.24 17:24, Vincent Vanlaer wrote:
Signed-off-by: Vincent Vanlaer <libvirt-e6954...@volkihar.be> --- tests/qemu-iotests/315 | 95 ++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/315.out | 54 ++++++++++++++++++++++
Please place new tests in tests/qemu-iotests/tests, with human readable name, something like commit-zeroes or what you want.
2 files changed, 149 insertions(+) create mode 100755 tests/qemu-iotests/315 create mode 100644 tests/qemu-iotests/315.out diff --git a/tests/qemu-iotests/315 b/tests/qemu-iotests/315 new file mode 100755 index 0000000000..84865f8001 --- /dev/null +++ b/tests/qemu-iotests/315 @@ -0,0 +1,95 @@ +#!/usr/bin/env bash +# group: rw quick +# +# Test for commit of discarded blocks +# +# This tests committing a live snapshot where some of the blocks that +# are present in the base image are discarded in the intermediate image. +# This intends to check that these blocks are also discarded in the base +# image after the commit. +# +# Copyright (C) 2024 Vincent Vanlaer. +# +# 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 <http://www.gnu.org/licenses/>. +# +# creator +owner=libvirt-e6954...@volkihar.be + +seq=`basename $0` +echo "QA output created by $seq" + +status=1 # failure is the default! + +_cleanup() +{ + _cleanup_qemu + _rm_test_img "${TEST_IMG}.base" + _rm_test_img "${TEST_IMG}.mid" + _cleanup_test_img +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks
Example of bash test in tests is tests/qemu-iotests/tests/qemu-img-bitmaps, so you'll need "cd .." here, before ". ./common.rc" I know, this all looks not optimal, but still, human-readable names are much better than numbers. With that: Tested-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru>
+. ./common.rc +. ./common.filter +. ./common.qemu +
-- Best regards, Vladimir