From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zhzny-0006xr-2Y for qemu-devel@nongnu.org; Fri, 02 Oct 2015 08:51:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zhznx-0003Pa-74 for qemu-devel@nongnu.org; Fri, 02 Oct 2015 08:51:17 -0400 From: Kevin Wolf Date: Fri, 2 Oct 2015 14:50:56 +0200 Message-Id: <1443790258-23305-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1443790258-23305-1-git-send-email-kwolf@redhat.com> References: <1443790258-23305-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 3/5] iotests: Fix test 128 for password-less sudo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Max Reitz As of 934659c460d46c948cf348822fda1d38556ed9a4, $QEMU_IO is generally no longer a program name, and therefore "sudo -n $QEMU_IO" will no longer work. Fix this by copying the qemu-io invocation function from common.config, making it use $sudo for invoking $QEMU_IO_PROG, and then use that function instead of $QEMU_IO. Reported-by: Fam Zheng Signed-off-by: Max Reitz Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- tests/qemu-iotests/128 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/128 b/tests/qemu-iotests/128 index e2a0f2f..3d8107d 100755 --- a/tests/qemu-iotests/128 +++ b/tests/qemu-iotests/128 @@ -31,6 +31,11 @@ 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 +81,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" -- 1.8.3.1