On 01/03/2017 11:04 AM, Daniel P. Berrange wrote: > The tests 033, 120, 140, 145 and 157 were all broken > when run with LUKS, since they did not correctly use > the required image opts args syntax to specify the > decryption secret. > > Signed-off-by: Daniel P. Berrange <[email protected]> > ---
> +++ b/tests/qemu-iotests/120
> @@ -44,17 +44,36 @@ _supported_os Linux
>
> _make_test_img 64M
>
> +if test "$IMGOPTSSYNTAX" = "true"
> +then
> + SYSEMU_DRIVE_ARG=id=drv,if=none,$TEST_IMG
> + SYSEMU_EXTRA_ARGS=""
> + IO_DRIVE_ARG="$TEST_IMG"
> + IO_EXTRA_ARGS="--image-opts"
> + if [ -n "$IMGKEYSECRET" ]; then
> + SECRET_ARG="secret,id=keysec0,data=$IMGKEYSECRET"
> + SYSEMU_EXTRA_ARGS="$SYSEMU_EXTRA_ARGS -object $SECRET_ARG"
Should we favor the '--object' spelling rather than '-object'? But both
work (thanks to getopt_long_only()), so I'm not going to demand a respin.
> + IO_EXTRA_ARGS="$IO_EXTRA_ARGS --object $SECRET_ARG"
> + fi
> +else
> +
> SYSEMU_DRIVE_ARG=id=drv,if=none,file="$TEST_IMG",driver=raw,file.driver=$IMGFMT
> + SYSEMU_EXTRA_ARGS=""
> + IO_DRIVE_ARG="json:{'driver': 'raw', 'file': {'driver': '$IMGFMT',
> 'file': {'filename': '$TEST_IMG'}}}"
> + IO_EXTRA_ARGS=""
> +fi
> +
> +
> echo "{'execute': 'qmp_capabilities'}
> {'execute': 'human-monitor-command',
> 'arguments': {'command-line': 'qemu-io drv \"write -P 42 0 64k\"'}}
> {'execute': 'quit'}" \
> - | $QEMU -qmp stdio -nographic -nodefaults \
> - -drive
> id=drv,if=none,file="$TEST_IMG",driver=raw,file.driver=$IMGFMT \
> + | $QEMU -qmp stdio -nographic -nodefaults $SYSEMU_EXTRA_ARGS \
> + -drive $SYSEMU_DRIVE_ARG \
> | _filter_qmp | _filter_qemu_io
> $QEMU_IO -c 'read -P 42 0 64k' "$TEST_IMG" | _filter_qemu_io
>
> $QEMU_IO_PROG -c 'read -P 42 0 64k' \
> - "json:{'driver': 'raw', 'file': {'driver': '$IMGFMT', 'file':
> {'filename': '$TEST_IMG'}}}" \
> + $IO_EXTRA_ARGS "$IO_DRIVE_ARG" \
> | _filter_qemu_io
>
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
