Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1596927 - qemu-iotests: Failed to use the installed qemu binaries for testing as before
Summary: qemu-iotests: Failed to use the installed qemu binaries for testing as before
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.6
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: Tingting Mao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-30 08:54 UTC by Ping Li
Modified: 2018-08-03 13:35 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-03 13:35:20 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Ping Li 2018-06-30 08:54:04 UTC
Description of problem:
Prior to RHEL-7.6, Tester didn't need to specify the path of qemu binaries(such as qemu-img, qemu-io, and qemu-nbd) when the installed binaries on the host were used for testing. 
Since qemu-2.12, things were changed. qemu-iotests wouldn't use the installed binaries. If the qemu binaries are not found in the directory of source code($build_root) and qemu-iotests($PWD), Tester must specify the binaries path. 
Or qemu-iotests will give a warning that "check: qemu-img not found".
This change was mostly caused by the commit cceaf1db6fb, which removed the below codes. I don't think these code must be moved back. But I think it will be convenient if we still have these code. When we just wonder to run tests for the installed qemu binaries without specifying them.

-# $1 = prog to look for, $2* = default pathnames if not found in $PATH
-set_prog_path()
-{
-    p=`command -v $1 2> /dev/null`
-    if [ -n "$p" -a -x "$p" ]; then
-        echo $p
-        return 0
-    fi
-    p=$1
-
-    shift
-    for f; do
-        if [ -x $f ]; then
-            echo $f
-            return 0
-        fi
-    done
-
-    echo ""
-    return 1
-}

-if [ -z "$QEMU_PROG" ]; then
-    export QEMU_PROG="`set_prog_path qemu`"
-fi
-
-if [ -z "$QEMU_IMG_PROG" ]; then
-    export QEMU_IMG_PROG="`set_prog_path qemu-img`"
-fi
-
-if [ -z "$QEMU_IO_PROG" ]; then
-    export QEMU_IO_PROG="`set_prog_path qemu-io`"
-fi
-
-if [ -z "$QEMU_NBD_PROG" ]; then
-    export QEMU_NBD_PROG="`set_prog_path qemu-nbd`"
-fi

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.12.0-5.el7

How reproducible:
100%

Steps to Reproduce:
# rpm -ivhf qemu-kvm-rhev-2.12.0-5.el7.src.rpm
# rpmbuild -bp /root/rpmbuild/SPECS/qemu-kvm.spec --nodeps
# cd /root/rpmbuild/BUILD/qemu-2.12.0/
# ./configure
# export QEMU_PROG=/usr/libexec/qemu-kvm
# cd tests/qemu-iotests
# ./check -qcow2
check: qemu-img not found

Actual results:
qemu-img not found

Expected results:
qemu-iotests locates the installed qemu binaries for testing

Additional info:

Comment 2 Kevin Wolf 2018-07-24 11:42:49 UTC
I think it is actually better not to use installed binaries automatically because you can easily test the wrong binaries accidentally if they are used.

In my experience, the most convenient way is to create symlinks (qemu-img, qemu-io, qemu and qemu-nbd) in the qemu-iotests directory. It will pick those up without having to set environment variables.

Comment 4 Ademar Reis 2018-08-03 13:35:20 UTC
(In reply to Kevin Wolf from comment #2)
> I think it is actually better not to use installed binaries automatically
> because you can easily test the wrong binaries accidentally if they are used.
> 
> In my experience, the most convenient way is to create symlinks (qemu-img,
> qemu-io, qemu and qemu-nbd) in the qemu-iotests directory. It will pick
> those up without having to set environment variables.

Closing, please reopen if you disagree or if the above doesn't work.


Note You need to log in before you can comment on or make changes to this bug.