qemu-block
[Top][All Lists]
Advanced

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

[Qemu-block] [PULL 02/25] qemu-iotests: Fix 128 if sudo required


From: Kevin Wolf
Subject: [Qemu-block] [PULL 02/25] qemu-iotests: Fix 128 if sudo required
Date: Fri, 12 Jun 2015 18:23:11 +0200

From: Fam Zheng <address@hidden>

If passwordless "sudo" works, use it in the qemu-io cmd.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 tests/qemu-iotests/128 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/128 b/tests/qemu-iotests/128
index 249a865..e2a0f2f 100755
--- a/tests/qemu-iotests/128
+++ b/tests/qemu-iotests/128
@@ -29,6 +29,7 @@ tmp=/tmp/$$
 status=1       # failure is the default!
 
 devname="eiodev$$"
+sudo=""
 
 _setup_eiodev()
 {
@@ -37,6 +38,7 @@ _setup_eiodev()
                echo "0 $((1024 * 1024 * 1024 / 512)) error" | \
                        $cmd dmsetup create "$devname" 2>/dev/null
                if [ "$?" -eq 0 ]; then
+                       sudo="$cmd"
                        return
                fi
        done
@@ -74,7 +76,7 @@ TEST_IMG="/dev/mapper/$devname"
 echo
 echo "== reading from error device =="
 # Opening image should succeed but the read operation should fail
-$QEMU_IO --format "$IMGFMT" --nocache -c "read 0 65536" "$TEST_IMG" | 
_filter_qemu_io
+$sudo $QEMU_IO --format "$IMGFMT" --nocache -c "read 0 65536" "$TEST_IMG" | 
_filter_qemu_io
 
 # success, all done
 echo "*** done"
-- 
1.8.3.1




reply via email to

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