On 11.04.19 14:32, Alberto Garcia wrote: > This tests the fix from the previous patch. > > Signed-off-by: Alberto Garcia <[email protected]> > --- > 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 > [email protected] > + > +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
signature.asc
Description: OpenPGP digital signature
