summaryrefslogtreecommitdiffstats
path: root/qemu/tests/qemu-iotests/128
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/tests/qemu-iotests/128')
-rwxr-xr-xqemu/tests/qemu-iotests/12810
1 files changed, 8 insertions, 2 deletions
diff --git a/qemu/tests/qemu-iotests/128 b/qemu/tests/qemu-iotests/128
index e2a0f2f89..0976a1813 100755
--- a/qemu/tests/qemu-iotests/128
+++ b/qemu/tests/qemu-iotests/128
@@ -25,12 +25,16 @@ seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
-tmp=/tmp/$$
status=1 # failure is the default!
devname="eiodev$$"
sudo=""
+_sudo_qemu_io_wrapper()
+{
+ (exec $sudo "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@")
+}
+
_setup_eiodev()
{
# This test should either be run as root or with passwordless sudo
@@ -76,7 +80,9 @@ TEST_IMG="/dev/mapper/$devname"
echo
echo "== reading from error device =="
# Opening image should succeed but the read operation should fail
-$sudo $QEMU_IO --format "$IMGFMT" --nocache -c "read 0 65536" "$TEST_IMG" | _filter_qemu_io
+_sudo_qemu_io_wrapper --format "$IMGFMT" --nocache \
+ -c "read 0 65536" "$TEST_IMG" \
+ | _filter_qemu_io
# success, all done
echo "*** done"