]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: avoid dirname in tests
authorEric Blake <eblake@redhat.com>
Tue, 17 Jan 2012 19:09:51 +0000 (12:09 -0700)
committerEric Blake <eblake@redhat.com>
Tue, 17 Jan 2012 19:09:51 +0000 (12:09 -0700)
qemuxml2argvtest sanitizes PATH to just /bin, but on at least
Fedora 16, dirname lives in /usr/bin instead.  Regression
introduced in commit e7201afd.

* tests/qemuxml2argvdata/qemu.sh: Avoid forking a dirname call,
since dirname might not be in PATH after test sanitization.
* tests/qemuxml2argvdata/qemu-supported-cpus.sh: Likewise.
Diagnosed by Michal Privoznik.

tests/qemuxml2argvdata/qemu-supported-cpus.sh
tests/qemuxml2argvdata/qemu.sh

index ed3ae94423657cc54f7af53ee4a0ed4c04138d21..0204f51988ef783fba67579fdbc6254bc63d6671 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-. $(dirname $0)/qemu-lib.sh
+. ${0%/*}/qemu-lib.sh
 
 case $* in
 "-M ?")
index 38da0b3521c1b59ca07733a0cf9528f2bfc91869..5928c1b1454f0a6671de3b35602727feb4c3ad20 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-. $(dirname $0)/qemu-lib.sh
+. ${0%/*}/qemu-lib.sh
 
 case $* in
 "-M ?")