qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH for-4.1 v2 2/2] iotests: Check that images are i


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH for-4.1 v2 2/2] iotests: Check that images are in read-only mode after block-commit
Date: Fri, 26 Apr 2019 22:57:46 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 11.04.19 14:32, Alberto Garcia wrote:
> This tests the fix from the previous patch.
> 
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
>  tests/qemu-iotests/249     | 115 
> +++++++++++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/249.out |  35 ++++++++++++++
>  tests/qemu-iotests/group   |   1 +
>  3 files changed, 151 insertions(+)
>  create mode 100755 tests/qemu-iotests/249
>  create mode 100644 tests/qemu-iotests/249.out
> 
> diff --git a/tests/qemu-iotests/249 b/tests/qemu-iotests/249
> new file mode 100755
> index 0000000000..a6ee2ef492
> --- /dev/null
> +++ b/tests/qemu-iotests/249
> @@ -0,0 +1,115 @@
> +#!/usr/bin/env bash
> +#
> +# Test that a backing image is put back in read-only mode after
> +# block-commit (both when it fails and when it succeeds).
> +#
> +# Copyright (C) 2019 Igalia, S.L.
> +#
> +# 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
> address@hidden
> +
> +seq=`basename $0`

I have been berated for not using $() here...

> +echo "QA output created by $seq"
> +
> +here=`pwd`

...and including this line here, so I suppose I'll pass that criticism
along. O:-)

Otherwise, the test looks good to me, just one thing...

[...]

> +echo
> +echo '=== Run block-commit on base using the default filter node name'
> +echo
> +_send_qemu_cmd $QEMU_HANDLE \
> +    "{ 'execute': 'block-commit',
> +       'arguments': {'job-id': 'job0', 'device': 'none1', 'top-node': 
> 'int'}}" \
> +    'return'
> +
> +# Wait for block-commit to finish
> +sleep 0.5

Why not just

_send_qemu_cmd $QEMU_HANDLE '' \
    '"status": "null"'

?

First, that would avoid timing issues.  Second, this places all the job
logs above the "=== Send a write command [...] (3)" line.

Max

> +echo
> +echo '=== Send a write command to a drive opened in read-only mode (3)'
> +echo

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]