[Libguestfs] [PATCH 1/3] tests: Don't use relative paths to binaries in tests.

Richard W.M. Jones rjones at redhat.com
Tue Sep 16 14:05:56 UTC 2014


All tests run under the ./run binary.  For a long time the ./run
binary has set the $PATH environment variable to contain all of the
directories with binaries in them.

Therefore there is no reason to use ../fish/guestfish instead of just
plain guestfish (and the same applies to other built binaries).
---
 align/test-virt-alignment-scan-guests.sh           |  2 +-
 align/test-virt-alignment-scan.sh                  |  2 +-
 builder/test-virt-builder-list.sh                  |  6 ++--
 builder/test-virt-builder-planner.sh               |  6 ++--
 builder/test-virt-builder.sh                       |  6 ++--
 builder/test-virt-index-validate.sh                |  6 ++--
 builder/website/test-guest.sh                      |  6 ++--
 builder/website/validate.sh                        |  6 ++--
 cat/test-virt-cat.sh                               |  4 +--
 cat/test-virt-filesystems.sh                       |  4 +--
 cat/test-virt-log.sh                               |  2 +-
 cat/test-virt-ls.sh                                |  8 ++---
 customize/test-virt-customize.sh                   |  2 +-
 df/test-virt-df-guests.sh                          |  2 +-
 df/test-virt-df.sh                                 |  2 +-
 diff/test-virt-diff.sh                             |  8 ++---
 edit/test-virt-edit.sh                             | 14 ++++----
 fish/test-a.sh                                     | 14 ++++----
 fish/test-add-domain.sh                            | 14 ++++----
 fish/test-add-uri.sh                               | 30 ++++++++--------
 fish/test-alloc.sh                                 |  4 +--
 fish/test-copy.sh                                  |  4 +--
 fish/test-d.sh                                     | 10 +++---
 fish/test-edit.sh                                  |  2 +-
 fish/test-escapes.sh                               |  2 +-
 fish/test-events.sh                                |  2 +-
 fish/test-file-attrs.sh                            |  2 +-
 fish/test-find0.sh                                 |  2 +-
 fish/test-glob.sh                                  |  2 +-
 fish/test-inspect.sh                               |  2 +-
 fish/test-invalid-params.sh                        |  6 ++--
 fish/test-mount-local.sh                           |  2 +-
 fish/test-prep.sh                                  |  2 +-
 fish/test-read-file.sh                             |  2 +-
 fish/test-remote-events.sh                         | 10 +++---
 fish/test-remote.sh                                | 16 ++++-----
 fish/test-reopen.sh                                |  2 +-
 fish/test-run.sh                                   |  2 +-
 fish/test-stringlist.sh                            | 10 +++---
 fish/test-tilde.sh                                 | 12 +++----
 fish/test-upload-to-dir.sh                         |  2 +-
 format/test-virt-format.sh                         |  6 ++--
 fuse/test-fuse-umount-race.sh                      |  6 ++--
 fuse/test-fuse.sh                                  | 13 +++----
 inspector/test-virt-inspector.sh                   |  4 +--
 make-fs/test-virt-make-fs.sh                       |  4 +--
 p2v/test-virt-p2v.sh                               |  4 +--
 rescue/test-virt-rescue-suggest.sh                 |  2 +-
 resize/test-virt-resize.sh                         | 14 ++++----
 sparsify/test-virt-sparsify-in-place.sh            |  6 ++--
 sparsify/test-virt-sparsify.sh                     |  6 ++--
 sysprep/test-virt-sysprep-passwords.sh             |  6 ++--
 sysprep/test-virt-sysprep-script.sh                |  8 ++---
 sysprep/test-virt-sysprep.sh                       |  6 ++--
 tests/9p/test-9p.sh                                |  4 +--
 tests/btrfs/test-btrfs-devices.sh                  |  6 ++--
 tests/create/test-disk-create.sh                   |  4 +--
 tests/disks/test-qemu-drive-libvirt.sh             |  3 +-
 tests/disks/test-qemu-drive.sh                     | 20 +++++------
 tests/guests/guest-aux/make-debian-img.sh          |  2 +-
 tests/guests/guest-aux/make-ubuntu-img.sh          |  2 +-
 tests/guests/guest-aux/make-windows-img.sh         |  4 +--
 tests/luks/test-luks-list.sh                       |  4 +--
 tests/luks/test-luks.sh                            |  4 +--
 tests/lvm/test-lvm-filtering.sh                    |  2 +-
 tests/md/test-inspect-fstab-md.sh                  |  8 ++---
 tests/md/test-inspect-fstab.sh                     | 17 +++++----
 tests/md/test-list-filesystems.sh                  |  2 +-
 tests/md/test-list-md-devices.sh                   |  4 +--
 tests/md/test-mdadm.sh                             | 40 +++++++++++-----------
 tests/mountable/test-mountable-inspect.sh          | 11 +++---
 tests/network/test-network.sh                      |  4 +--
 tests/ntfsclone/test-ntfsclone.sh                  |  8 ++---
 tests/protocol/test-both-ends-cancel.sh            |  2 +-
 .../test-cancellation-download-librarycancels.sh   |  2 +-
 .../test-cancellation-upload-daemoncancels.sh      |  2 +-
 tests/protocol/test-qemudie-killsub.sh             |  4 +--
 tests/protocol/test-qemudie-midcommand.sh          |  4 +--
 tests/protocol/test-qemudie-synch.sh               |  4 +--
 tests/qemu/qemu-force-tcg.sh                       |  4 +--
 tests/qemu/qemu-liveness.sh                        |  4 +--
 tests/qemu/qemu-snapshot-isolation.sh              | 12 +++----
 tests/regressions/rhbz1001875.sh                   |  2 +-
 tests/regressions/rhbz1044014.sh                   |  4 +--
 tests/regressions/rhbz1054761.sh                   |  4 +--
 tests/regressions/rhbz1091803.sh                   |  2 +-
 tests/regressions/rhbz503169c13.sh                 |  2 +-
 tests/regressions/rhbz557655.sh                    |  4 +--
 tests/regressions/rhbz563450.sh                    |  2 +-
 tests/regressions/rhbz563450b.sh                   |  2 +-
 tests/regressions/rhbz576879.sh                    |  2 +-
 tests/regressions/rhbz578407.sh                    | 14 ++++----
 tests/regressions/rhbz580246.sh                    |  2 +-
 tests/regressions/rhbz602997.sh                    |  6 ++--
 tests/regressions/rhbz690819.sh                    |  6 ++--
 tests/regressions/rhbz727178.sh                    |  9 +++--
 tests/regressions/rhbz789960.sh                    |  2 +-
 tests/regressions/rhbz811649.sh                    |  4 +--
 tests/regressions/rhbz895904.sh                    |  2 +-
 tests/regressions/rhbz909624.sh                    |  2 +-
 tests/regressions/rhbz957772.sh                    |  2 +-
 tests/regressions/rhbz975797.sh                    | 10 +++---
 tests/relative-paths/test-relative-paths.sh        |  4 +--
 tests/rsync/test-rsync.sh                          |  8 ++---
 v2v/test-v2v-i-disk.sh                             |  4 +--
 v2v/test-v2v-i-ova.sh                              |  4 +--
 v2v/test-v2v-machine-readable.sh                   |  2 +-
 v2v/test-v2v-networks-and-bridges.sh               |  4 +--
 v2v/test-v2v-no-copy.sh                            |  6 ++--
 v2v/test-v2v-o-glance.sh                           |  4 +--
 v2v/test-v2v-o-libvirt.sh                          |  4 +--
 v2v/test-v2v-o-null.sh                             |  4 +--
 v2v/test-v2v-o-rhev.sh                             |  4 +--
 v2v/test-v2v-o-vdsm-options.sh                     |  4 +--
 v2v/test-v2v-of-option.sh                          |  6 ++--
 v2v/test-v2v-on-option.sh                          |  4 +--
 v2v/test-v2v-print-source.sh                       |  2 +-
 v2v/test-v2v-real-conversions.sh                   |  2 +-
 v2v/test-v2v-windows-conversion.sh                 |  6 ++--
 119 files changed, 323 insertions(+), 346 deletions(-)

diff --git a/align/test-virt-alignment-scan-guests.sh b/align/test-virt-alignment-scan-guests.sh
index 3647c29..99e2585 100755
--- a/align/test-virt-alignment-scan-guests.sh
+++ b/align/test-virt-alignment-scan-guests.sh
@@ -26,7 +26,7 @@ fi
 guestsdir="$(cd ../tests/guests && pwd)"
 libvirt_uri="test://$guestsdir/guests-all-good.xml"
 
-$VG ./virt-alignment-scan -c "$libvirt_uri"
+$VG virt-alignment-scan -c "$libvirt_uri"
 r=$?
 
 # 0, 2 and 3 are reasonable non-error exit codes.  Others are errors.
diff --git a/align/test-virt-alignment-scan.sh b/align/test-virt-alignment-scan.sh
index 2b1ec37..293a9ef 100755
--- a/align/test-virt-alignment-scan.sh
+++ b/align/test-virt-alignment-scan.sh
@@ -18,7 +18,7 @@
 
 export LANG=C
 
-$VG ./virt-alignment-scan -a ../tests/guests/fedora.img
+$VG virt-alignment-scan -a ../tests/guests/fedora.img
 r=$?
 
 # 0, 2 and 3 are reasonable non-error exit codes.  Others are errors.
diff --git a/builder/test-virt-builder-list.sh b/builder/test-virt-builder-list.sh
index 76d7913..49daae7 100755
--- a/builder/test-virt-builder-list.sh
+++ b/builder/test-virt-builder-list.sh
@@ -26,7 +26,7 @@ abs_builddir=$(pwd)
 export XDG_CONFIG_HOME=
 export XDG_CONFIG_DIRS="$abs_builddir/test-config"
 
-short_list=$($VG ./virt-builder --no-check-signature --no-cache --list)
+short_list=$($VG virt-builder --no-check-signature --no-cache --list)
 
 if [ "$short_list" != "phony-debian             x86_64     Phony Debian
 phony-fedora             x86_64     Phony Fedora
@@ -40,7 +40,7 @@ phony-windows            x86_64     Phony Windows" ]; then
     exit 1
 fi
 
-long_list=$(./virt-builder --no-check-signature --no-cache --list --long)
+long_list=$(virt-builder --no-check-signature --no-cache --list --long)
 
 if [ "$long_list" != "Source URI: file://$abs_builddir/test-index
 
@@ -111,7 +111,7 @@ Phony Windows look-alike used for testing." ]; then
     exit 1
 fi
 
-json_list=$(./virt-builder --no-check-signature --no-cache --list --list-format json)
+json_list=$(virt-builder --no-check-signature --no-cache --list --list-format json)
 
 if [ "$json_list" != "{
   \"version\": 1,
diff --git a/builder/test-virt-builder-planner.sh b/builder/test-virt-builder-planner.sh
index 6b839bb..f974c27 100755
--- a/builder/test-virt-builder-planner.sh
+++ b/builder/test-virt-builder-planner.sh
@@ -29,7 +29,7 @@ if [ ! -f fedora.xz -o ! -f fedora.qcow2 -o ! -f fedora.qcow2.xz ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because backend is UML"
     exit 77
 fi
@@ -43,8 +43,8 @@ for input in phony-fedora phony-fedora-qcow2 phony-fedora-qcow2-uncompressed pho
             if [ "$size" != "none" ]; then args="$args --size $size"; fi
             if [ "$format" != "none" ]; then args="$args --format $format"; fi
 
-            echo $VG ./virt-builder $input $args
-            $VG ./virt-builder $input $args
+            echo $VG virt-builder $input $args
+            $VG virt-builder $input $args
         done
     done
 done
diff --git a/builder/test-virt-builder.sh b/builder/test-virt-builder.sh
index f927a96..f357d12 100755
--- a/builder/test-virt-builder.sh
+++ b/builder/test-virt-builder.sh
@@ -37,7 +37,7 @@ fi
 output=phony-fedora.img
 
 format=qcow2
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     format=raw
 
     # XXX We specifically want virt-builder to work with the UML
@@ -55,7 +55,7 @@ rm -f $output
 # Note we cannot test --install, --run since the phony Fedora doesn't
 # have a real OS inside just some configuration files.  Just about
 # every other option is fair game.
-$VG ./virt-builder phony-fedora \
+$VG virt-builder phony-fedora \
     -v --no-cache --no-check-signature $no_network \
     -o $output --size 2G --format $format \
     --arch x86_64 \
@@ -74,7 +74,7 @@ $VG ./virt-builder phony-fedora \
     --firstboot-install "minicom,inkscape"
 
 # Check that some modifications were made.
-$VG ../fish/guestfish --ro -i -a $output > test.out <<EOF
+$VG guestfish --ro -i -a $output > test.out <<EOF
 # Uploaded files
 is-file /etc/foo/bar/baz/Makefile
 cat /etc/foo/bar/baz/foo
diff --git a/builder/test-virt-index-validate.sh b/builder/test-virt-index-validate.sh
index 37e7339..c66929d 100755
--- a/builder/test-virt-index-validate.sh
+++ b/builder/test-virt-index-validate.sh
@@ -19,6 +19,6 @@
 export LANG=C
 set -e
 
-! $VG ./virt-index-validate test-virt-index-validate-bad-1
-$VG ./virt-index-validate test-virt-index-validate-good-1
-$VG ./virt-index-validate test-virt-index-validate-good-2
+! $VG virt-index-validate test-virt-index-validate-bad-1
+$VG virt-index-validate test-virt-index-validate-good-1
+$VG virt-index-validate test-virt-index-validate-good-2
diff --git a/builder/website/test-guest.sh b/builder/website/test-guest.sh
index 9372425..7854aeb 100755
--- a/builder/website/test-guest.sh
+++ b/builder/website/test-guest.sh
@@ -27,14 +27,14 @@
 export LANG=C
 set -e
 
-if [ ! -x builder/virt-builder ]; then
+if ! virt-builder --help >/dev/null 2>&1 || [ ! -f builder/virt-builder.pod ]; then
     echo "$0: running the test from the wrong directory, or libguestfs has not been built"
     exit 1
 fi
 
 if [ $# -lt 1 ]; then
     echo "$0: missing os-version"
-    echo "try: ./run builder/virt-builder -l"
+    echo "try: ./run virt-builder -l"
     exit 1
 fi
 
@@ -42,7 +42,7 @@ osversion="$1"
 shift
 output="$osversion.img"
 
-builder/virt-builder "$osversion" \
+virt-builder "$osversion" \
     --no-cache -v \
     --size 10G \
     --root-password password:123456 \
diff --git a/builder/website/validate.sh b/builder/website/validate.sh
index f2e24cf..2a7ba32 100755
--- a/builder/website/validate.sh
+++ b/builder/website/validate.sh
@@ -24,8 +24,8 @@ fn=test-filename-for-index-validate
 rm -f $fn
 touch $fn
 
-$VG ../virt-index-validate $srcdir/index
-$VG ../virt-index-validate $srcdir/index.asc
-$VG ../virt-index-validate $fn
+$VG virt-index-validate $srcdir/index
+$VG virt-index-validate $srcdir/index.asc
+$VG virt-index-validate $fn
 
 rm $fn
diff --git a/cat/test-virt-cat.sh b/cat/test-virt-cat.sh
index 8c8e5d7..fbf09ea 100755
--- a/cat/test-virt-cat.sh
+++ b/cat/test-virt-cat.sh
@@ -20,11 +20,11 @@ export LANG=C
 set -e
 
 # Read out the test files from the image using virt-cat.
-if [ "$($VG ./virt-cat ../tests/guests/fedora.img /etc/test1)" != "abcdefg" ]; then
+if [ "$($VG virt-cat ../tests/guests/fedora.img /etc/test1)" != "abcdefg" ]; then
     echo "$0: error: mismatch in file test1"
     exit 1
 fi
-if [ "$($VG ./virt-cat ../tests/guests/fedora.img /etc/test2)" != "" ]; then
+if [ "$($VG virt-cat ../tests/guests/fedora.img /etc/test2)" != "" ]; then
     echo "$0: error: mismatch in file test2"
     exit 1
 fi
diff --git a/cat/test-virt-filesystems.sh b/cat/test-virt-filesystems.sh
index 8ed29e4..2999950 100755
--- a/cat/test-virt-filesystems.sh
+++ b/cat/test-virt-filesystems.sh
@@ -19,7 +19,7 @@
 export LANG=C
 set -e
 
-output="$($VG ./virt-filesystems -a ../tests/guests/fedora.img | sort)"
+output="$($VG virt-filesystems -a ../tests/guests/fedora.img | sort)"
 expected="/dev/VG/LV1
 /dev/VG/LV2
 /dev/VG/LV3
@@ -32,7 +32,7 @@ if [ "$output" != "$expected" ]; then
     exit 1
 fi
 
-output="$($VG ./virt-filesystems -a ../tests/guests/fedora.img --all --long --uuid -h --no-title | awk '{print $1}' | sort -u)"
+output="$($VG virt-filesystems -a ../tests/guests/fedora.img --all --long --uuid -h --no-title | awk '{print $1}' | sort -u)"
 expected="/dev/VG
 /dev/VG/LV1
 /dev/VG/LV2
diff --git a/cat/test-virt-log.sh b/cat/test-virt-log.sh
index 5f04c10..af6bb95 100755
--- a/cat/test-virt-log.sh
+++ b/cat/test-virt-log.sh
@@ -21,5 +21,5 @@ set -e
 
 # Read out the log files from the image using virt-log.
 for f in ../tests/guests/{fedora,debian,ubuntu}.img; do
-    if [ -s "$f" ]; then $VG ./virt-log -a "$f"; fi
+    if [ -s "$f" ]; then $VG virt-log -a "$f"; fi
 done
diff --git a/cat/test-virt-ls.sh b/cat/test-virt-ls.sh
index 55fc114..5bb4b8a 100755
--- a/cat/test-virt-ls.sh
+++ b/cat/test-virt-ls.sh
@@ -20,7 +20,7 @@ export LANG=C
 set -e
 
 # Read out the test directory using virt-ls.
-if [ "$($VG ./virt-ls ../tests/guests/fedora.img /bin)" != "ls
+if [ "$($VG virt-ls ../tests/guests/fedora.img /bin)" != "ls
 test1
 test2
 test3
@@ -33,7 +33,7 @@ test7" ]; then
 fi
 
 # Try the -lR option.
-output="$($VG ./virt-ls -lR ../tests/guests/fedora.img /boot | awk '{print $1 $2 $4}')"
+output="$($VG virt-ls -lR ../tests/guests/fedora.img /boot | awk '{print $1 $2 $4}')"
 expected="d0755/boot
 d0755/boot/grub
 -0644/boot/grub/grub.conf
@@ -49,5 +49,5 @@ if [ "$output" != "$expected" ]; then
 fi
 
 # Try the -l and -R options.   XXX Should check the output.
-$VG ./virt-ls -l ../tests/guests/fedora.img /
-$VG ./virt-ls -R ../tests/guests/fedora.img /
+$VG virt-ls -l ../tests/guests/fedora.img /
+$VG virt-ls -R ../tests/guests/fedora.img /
diff --git a/customize/test-virt-customize.sh b/customize/test-virt-customize.sh
index 623e6a2..979e6f0 100755
--- a/customize/test-virt-customize.sh
+++ b/customize/test-virt-customize.sh
@@ -26,7 +26,7 @@ for f in ../tests/guests/{debian,fedora,ubuntu}.img; do
     # Ignore zero-sized windows.img if ntfs-3g is not installed.
     if [ -s "$f" ]; then
         # Add --no-network so UML works.
-	$VG ./virt-customize -n -a $f \
+	$VG virt-customize -n -a $f \
             --no-network \
             --write /etc/motd:HELLO \
             --chmod 0600:/etc/motd \
diff --git a/df/test-virt-df-guests.sh b/df/test-virt-df-guests.sh
index 126b880..b485cd7 100755
--- a/df/test-virt-df-guests.sh
+++ b/df/test-virt-df-guests.sh
@@ -29,4 +29,4 @@ fi
 guestsdir="$(cd ../tests/guests && pwd)"
 libvirt_uri="test://$guestsdir/guests.xml"
 
-$VG ./virt-df -c "$libvirt_uri"
+$VG virt-df -c "$libvirt_uri"
diff --git a/df/test-virt-df.sh b/df/test-virt-df.sh
index 6be90f8..6a69cea 100755
--- a/df/test-virt-df.sh
+++ b/df/test-virt-df.sh
@@ -20,7 +20,7 @@ export LANG=C
 set -e
 
 # Run virt-df.
-output=$($VG ./virt-df ../tests/guests/fedora.img)
+output=$($VG virt-df ../tests/guests/fedora.img)
 
 # Check title is the first line.
 if [[ ! $output =~ ^Filesystem.* ]]; then
diff --git a/diff/test-virt-diff.sh b/diff/test-virt-diff.sh
index 3a3a1aa..fa13411 100755
--- a/diff/test-virt-diff.sh
+++ b/diff/test-virt-diff.sh
@@ -24,7 +24,7 @@ if [ ! -f ../tests/guests/fedora.img ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because backend is UML"
     exit 77
 fi
@@ -32,16 +32,16 @@ fi
 rm -f fedora.qcow2
 
 # Modify a copy of the image.
-../fish/guestfish -- \
+guestfish -- \
   disk-create fedora.qcow2 qcow2 -1 \
     backingfile:../tests/guests/fedora.img backingformat:raw
 
-../fish/guestfish -a fedora.qcow2 -i <<EOF
+guestfish -a fedora.qcow2 -i <<EOF
 touch /diff
 write-append /etc/motd "Testing virt-diff\n"
 EOF
 
-output="$($VG ./virt-diff -a ../tests/guests/fedora.img -A fedora.qcow2)"
+output="$($VG virt-diff -a ../tests/guests/fedora.img -A fedora.qcow2)"
 
 expected="\
 + - 0644          0 /diff
diff --git a/edit/test-virt-edit.sh b/edit/test-virt-edit.sh
index 99c2e7c..33c0603 100755
--- a/edit/test-virt-edit.sh
+++ b/edit/test-virt-edit.sh
@@ -19,7 +19,7 @@
 export LANG=C
 set -e
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: skipping test because uml backend does not support qcow2"
     exit 77
 fi
@@ -28,15 +28,15 @@ rm -f test.qcow2
 
 # Make a copy of the Fedora image so we can write to it then
 # discard it.
-../fish/guestfish -- \
+guestfish -- \
   disk-create test.qcow2 qcow2 -1 \
     backingfile:../tests/guests/fedora.img backingformat:raw
 
 # Edit interactively.  We have to simulate this by setting $EDITOR.
 # The command will be: echo newline >> /tmp/file
 export EDITOR='echo newline >>'
-./virt-edit -a test.qcow2 /etc/test3
-if [ "$(../cat/virt-cat -a test.qcow2 /etc/test3)" != "a
+virt-edit -a test.qcow2 /etc/test3
+if [ "$(virt-cat -a test.qcow2 /etc/test3)" != "a
 b
 c
 d
@@ -50,8 +50,8 @@ unset EDITOR
 
 # Edit non-interactively, only if we have 'perl' binary.
 if perl --version >/dev/null 2>&1; then
-    ./virt-edit -a test.qcow2 /etc/test3 -e 's/^[a-f]/$lineno/'
-    if [ "$(../cat/virt-cat -a test.qcow2 /etc/test3)" != "1
+    virt-edit -a test.qcow2 /etc/test3 -e 's/^[a-f]/$lineno/'
+    if [ "$(virt-cat -a test.qcow2 /etc/test3)" != "1
 2
 3
 4
@@ -65,7 +65,7 @@ fi
 
 # Verify the mode of /etc/test3 is still 0600 and the UID:GID is 10:11.
 # See tests/guests/guest-aux/make-fedora-img.pl and RHBZ#788641.
-if [ "$(../fish/guestfish -i -a test.qcow2 --ro lstat /etc/test3 | grep -E '^(mode|uid|gid):' | sort)" != "gid: 11
+if [ "$(guestfish -i -a test.qcow2 --ro lstat /etc/test3 | grep -E '^(mode|uid|gid):' | sort)" != "gid: 11
 mode: 33152
 uid: 10" ]; then
     echo "$0: error: editing /etc/test3 did not preserve permissions or ownership"
diff --git a/fish/test-a.sh b/fish/test-a.sh
index 44188ed..0fcc7d1 100755
--- a/fish/test-a.sh
+++ b/fish/test-a.sh
@@ -23,28 +23,28 @@ set -e
 rm -f test-a.out
 rm -f test-a.img
 
-$VG ./guestfish sparse test-a.img 100M
+$VG guestfish sparse test-a.img 100M
 
-$VG ./guestfish -x -a test-a.img </dev/null >test-a.out 2>&1
+$VG guestfish -x -a test-a.img </dev/null >test-a.out 2>&1
 
 ! grep -sq 'add_drive.*format' test-a.out
 
 rm test-a.img
-$VG ./guestfish disk-create test-a.img qcow2 100M
+$VG guestfish disk-create test-a.img qcow2 100M
 
-$VG ./guestfish -x --format=qcow2 -a test-a.img </dev/null >test-a.out 2>&1
+$VG guestfish -x --format=qcow2 -a test-a.img </dev/null >test-a.out 2>&1
 
 grep -sq 'add_drive.*format:qcow2' test-a.out
 
-$VG ./guestfish -x --ro --format=qcow2 -a test-a.img </dev/null >test-a.out 2>&1
+$VG guestfish -x --ro --format=qcow2 -a test-a.img </dev/null >test-a.out 2>&1
 
 grep -sq 'add_drive.*readonly:true.*format:qcow2' test-a.out
 
-$VG ./guestfish -x --format -a test-a.img </dev/null >test-a.out 2>&1
+$VG guestfish -x --format -a test-a.img </dev/null >test-a.out 2>&1
 
 ! grep -sq 'add_drive.*format' test-a.out
 
-$VG ./guestfish -x -a test-a.img --format=raw -a /dev/null </dev/null >test-a.out 2>&1
+$VG guestfish -x -a test-a.img --format=raw -a /dev/null </dev/null >test-a.out 2>&1
 
 ! grep -sq 'add_drive.*test-a.img.*format' test-a.out
 
diff --git a/fish/test-add-domain.sh b/fish/test-add-domain.sh
index a6b0e10..608d2de 100755
--- a/fish/test-add-domain.sh
+++ b/fish/test-add-domain.sh
@@ -25,10 +25,10 @@ rm -f test-add-domain.xml test-add-domain.out
 
 cwd="$(pwd)"
 
-$VG ./guestfish sparse test-add-domain-1.img 1M
-$VG ./guestfish sparse test-add-domain-2.img 1M
-$VG ./guestfish disk-create test-add-domain-3.img qcow2 1M
-$VG ./guestfish sparse test-add-domain-4.img 1M
+$VG guestfish sparse test-add-domain-1.img 1M
+$VG guestfish sparse test-add-domain-2.img 1M
+$VG guestfish disk-create test-add-domain-3.img qcow2 1M
+$VG guestfish sparse test-add-domain-4.img 1M
 
 # Libvirt test XML, see libvirt.git/examples/xml/test/testnode.xml
 cat > test-add-domain.xml <<EOF
@@ -66,7 +66,7 @@ cat > test-add-domain.xml <<EOF
 </node>
 EOF
 
-$VG ./guestfish >test-add-domain.out <<EOF
+$VG guestfish >test-add-domain.out <<EOF
   domain guest libvirturi:test://$cwd/test-add-domain.xml readonly:true
   debug-drives
 EOF
@@ -76,7 +76,7 @@ grep -sq "test-add-domain-2.img readonly format=raw" test-add-domain.out
 grep -sq "test-add-domain-3.img readonly format=qcow2" test-add-domain.out
 
 # Test readonlydisk = "ignore".
-$VG ./guestfish >test-add-domain.out <<EOF
+$VG guestfish >test-add-domain.out <<EOF
   -domain guest libvirturi:test://$cwd/test-add-domain.xml readonly:true readonlydisk:ignore
   debug-drives
 EOF
@@ -88,7 +88,7 @@ grep -sq "test-add-domain-3.img" test-add-domain.out
 # Test atomicity.
 rm test-add-domain-3.img
 
-$VG ./guestfish >test-add-domain.out <<EOF
+$VG guestfish >test-add-domain.out <<EOF
   -domain guest libvirturi:test://$cwd/test-add-domain.xml readonly:true
   debug-drives
 EOF
diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh
index 1a5b067..2f83754 100755
--- a/fish/test-add-uri.sh
+++ b/fish/test-add-uri.sh
@@ -24,7 +24,7 @@ set -x
 rm -f test-add-uri.out
 rm -f test-add-uri.img
 
-$VG ./guestfish sparse test-add-uri.img 10M
+$VG guestfish sparse test-add-uri.img 10M
 
 function fail ()
 {
@@ -34,51 +34,51 @@ function fail ()
 }
 
 # file:// URI should be handled exactly like a regular file.
-$VG ./guestfish -x -a file://$(pwd)/test-add-uri.img </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a file://$(pwd)/test-add-uri.img </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail
 
 # curl
-$VG ./guestfish -x -a ftp://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a ftp://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "/disk.img" "protocol:ftp" "server:tcp:example.com" "username:user"' test-add-uri.out || fail
 
 # gluster
-$VG ./guestfish -x -a gluster://example.com/disk </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a gluster://example.com/disk </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "disk" "protocol:gluster" "server:tcp:example.com"' test-add-uri.out || fail
 
 # NBD
-$VG ./guestfish -x -a nbd://example.com </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a nbd://example.com </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "" "protocol:nbd" "server:tcp:example.com"' test-add-uri.out || fail
 
-$VG ./guestfish -x -a nbd://example.com:3000 </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a nbd://example.com:3000 </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "" "protocol:nbd" "server:tcp:example.com:3000"' test-add-uri.out || fail
 
-$VG ./guestfish -x -a 'nbd://?socket=/sk' </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a 'nbd://?socket=/sk' </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "" "protocol:nbd" "server:unix:/sk"' test-add-uri.out || fail
 
-$VG ./guestfish -x -a 'nbd:///export?socket=/sk' </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a 'nbd:///export?socket=/sk' </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "/export" "protocol:nbd" "server:unix:/sk"' test-add-uri.out || fail
 
 # rbd
-$VG ./guestfish -x -a rbd://example.com:6789/pool/disk </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a rbd://example.com:6789/pool/disk </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "pool/disk" "protocol:rbd" "server:tcp:example.com:6789"' test-add-uri.out || fail
-$VG ./guestfish -x -a rbd:///pool/disk </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a rbd:///pool/disk </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail
 
 # sheepdog
-$VG ./guestfish -x -a sheepdog:///volume/image </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a sheepdog:///volume/image </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "volume/image" "protocol:sheepdog"' test-add-uri.out || fail
 
-$VG ./guestfish -x -a sheepdog://example.com:3000/volume/image </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a sheepdog://example.com:3000/volume/image </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "volume/image" "protocol:sheepdog" "server:tcp:example.com:3000"' test-add-uri.out || fail
 
 # ssh
-$VG ./guestfish -x -a ssh://example.com/disk.img </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a ssh://example.com/disk.img </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail
 
-$VG ./guestfish -x -a ssh://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a ssh://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com" "username:user"' test-add-uri.out || fail
 
-$VG ./guestfish -x -a ssh://user@example.com:2000/disk.img </dev/null >test-add-uri.out 2>&1
+$VG guestfish -x -a ssh://user@example.com:2000/disk.img </dev/null >test-add-uri.out 2>&1
 grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com:2000" "username:user"' test-add-uri.out || fail
 
 rm test-add-uri.out
diff --git a/fish/test-alloc.sh b/fish/test-alloc.sh
index 3f46f8b..98f8f4e 100755
--- a/fish/test-alloc.sh
+++ b/fish/test-alloc.sh
@@ -22,7 +22,7 @@ set -e
 
 rm -f test-alloc.img
 
-$VG ./guestfish alloc test-alloc.img 200000
+$VG guestfish alloc test-alloc.img 200000
 if [ "$(stat -c '%s' test-alloc.img)" -ne 200000 ]; then
     echo "$0: alloc command failed to create file of the correct size"
     exit 1
@@ -33,7 +33,7 @@ if [ "$(stat -c '%b' test-alloc.img)" -eq 0 ]; then
     exit 1
 fi
 
-$VG ./guestfish sparse test-alloc.img 100000
+$VG guestfish sparse test-alloc.img 100000
 if [ "$(stat -c '%s' test-alloc.img)" -ne 100000 ]; then
     echo "$0: sparse command failed to create file of the correct size"
     exit 1
diff --git a/fish/test-copy.sh b/fish/test-copy.sh
index ecf5a4f..f72de9b 100755
--- a/fish/test-copy.sh
+++ b/fish/test-copy.sh
@@ -36,7 +36,7 @@ cp $srcdir/../tests/data/known* test-copy-original
 cp -P ../tests/data/abssymlink* test-copy-original
 
 output=$(
-$VG ./guestfish -N test-copy.img=fs -m /dev/sda1 <<EOF
+$VG guestfish -N test-copy.img=fs -m /dev/sda1 <<EOF
 mkdir /data
 # This creates a directory /data/data/
 copy-in test-copy-original /data
@@ -63,7 +63,7 @@ fi
 
 mkdir test-copy-copy
 
-$VG ./guestfish --ro -a test-copy.img -m /dev/sda1 <<EOF
+$VG guestfish --ro -a test-copy.img -m /dev/sda1 <<EOF
 copy-out /data/test-copy-original test-copy-copy
 EOF
 
diff --git a/fish/test-d.sh b/fish/test-d.sh
index 1e16bdc..4c41ce0 100755
--- a/fish/test-d.sh
+++ b/fish/test-d.sh
@@ -25,10 +25,10 @@ rm -f test-d.xml test-d.out
 
 cwd="$(pwd)"
 
-$VG ./guestfish sparse test-d-1.img 1M
-$VG ./guestfish sparse test-d-2.img 1M
-$VG ./guestfish disk-create test-d-3.img qcow2 1M
-$VG ./guestfish sparse test-d-4.img 1M
+$VG guestfish sparse test-d-1.img 1M
+$VG guestfish sparse test-d-2.img 1M
+$VG guestfish disk-create test-d-3.img qcow2 1M
+$VG guestfish sparse test-d-4.img 1M
 
 # Libvirt test XML, see libvirt.git/examples/xml/test/testnode.xml
 cat > test-d.xml <<EOF
@@ -66,7 +66,7 @@ cat > test-d.xml <<EOF
 </node>
 EOF
 
-$VG ./guestfish -c "test://$cwd/test-d.xml" --ro -d guest \
+$VG guestfish -c "test://$cwd/test-d.xml" --ro -d guest \
   debug-drives </dev/null >test-d.out
 grep -sq "test-d-1.img readonly" test-d.out
 ! grep -sq "test-d-1.img.*format" test-d.out
diff --git a/fish/test-edit.sh b/fish/test-edit.sh
index 9d7ab9d..9242617 100755
--- a/fish/test-edit.sh
+++ b/fish/test-edit.sh
@@ -34,7 +34,7 @@ rm -f test-edit.img
 export EDITOR="echo second line of text >>"
 
 output=$(
-$VG ./guestfish -N test-edit.img=fs -m /dev/sda1 <<EOF
+$VG guestfish -N test-edit.img=fs -m /dev/sda1 <<EOF
 write /file.txt "this is a test\n"
 chmod 0600 /file.txt
 chown 10 11 /file.txt
diff --git a/fish/test-escapes.sh b/fish/test-escapes.sh
index 9a9fe7c..18c6e03 100755
--- a/fish/test-escapes.sh
+++ b/fish/test-escapes.sh
@@ -22,7 +22,7 @@ set -e
 
 rm -f test.output test.error test.error.old
 
-$VG ./guestfish <<'EOF' 2>test.error | od -b > test.output
+$VG guestfish <<'EOF' 2>test.error | od -b > test.output
 echo ""
 echo " "
 echo "  "
diff --git a/fish/test-events.sh b/fish/test-events.sh
index 18e503f..3f65164 100755
--- a/fish/test-events.sh
+++ b/fish/test-events.sh
@@ -22,7 +22,7 @@ set -e
 
 rm -f test.out
 
-$VG ./guestfish -a /dev/null <<'EOF' | grep -v get_verbose | grep -v get_trace | grep -v 'library .*0x' | grep -v 'library command' | grep -v 'get_path' > test.out
+$VG guestfish -a /dev/null <<'EOF' | grep -v get_verbose | grep -v get_trace | grep -v 'library .*0x' | grep -v 'library command' | grep -v 'get_path' > test.out
 trace true
 
 event ev1 * "echo $EVENT $@"
diff --git a/fish/test-file-attrs.sh b/fish/test-file-attrs.sh
index 78bd817..55d602c 100755
--- a/fish/test-file-attrs.sh
+++ b/fish/test-file-attrs.sh
@@ -23,7 +23,7 @@ export LANG=C
 
 rm -f test.out
 
-$VG ./guestfish > test.out <<EOF
+$VG guestfish > test.out <<EOF
 scratch 50MB
 run
 part-disk /dev/sda mbr
diff --git a/fish/test-find0.sh b/fish/test-find0.sh
index 9ca6a31..07daab3 100755
--- a/fish/test-find0.sh
+++ b/fish/test-find0.sh
@@ -22,7 +22,7 @@ set -e
 
 rm -f test.out
 
-$VG ./guestfish <<'EOF'
+$VG guestfish <<'EOF'
 add-ro ../tests/data/test.iso
 run
 mount-ro /dev/sda /
diff --git a/fish/test-glob.sh b/fish/test-glob.sh
index 0f41893..c520319 100755
--- a/fish/test-glob.sh
+++ b/fish/test-glob.sh
@@ -22,7 +22,7 @@ set -e
 
 rm -f test-glob.img test-glob.out
 
-$VG ./guestfish -N test-glob.img=disk:1G > test-glob.out <<EOF
+$VG guestfish -N test-glob.img=disk:1G > test-glob.out <<EOF
 
 pvcreate /dev/sda
 # Because glob doesn't do device name translation, we cannot test
diff --git a/fish/test-inspect.sh b/fish/test-inspect.sh
index 8f8abe6..126740d 100755
--- a/fish/test-inspect.sh
+++ b/fish/test-inspect.sh
@@ -18,4 +18,4 @@
 
 set -e
 
-$VG ./guestfish -a ../tests/guests/fedora.img -i exit
+$VG guestfish -a ../tests/guests/fedora.img -i exit
diff --git a/fish/test-invalid-params.sh b/fish/test-invalid-params.sh
index 60da094..7d02c65 100755
--- a/fish/test-invalid-params.sh
+++ b/fish/test-invalid-params.sh
@@ -23,7 +23,7 @@ set -e
 
 # Memory size
 output=$(
-$VG ./guestfish <<EOF
+$VG guestfish <<EOF
 set-memsize 400
 -set-memsize 0
 -set-memsize 100
@@ -42,7 +42,7 @@ fi
 
 # smp
 output=$(
-$VG ./guestfish <<EOF
+$VG guestfish <<EOF
 set-smp 2
 -set-smp 0
 -set-smp 300
@@ -58,7 +58,7 @@ fi
 
 # Backend
 output=$(
-$VG ./guestfish <<EOF
+$VG guestfish <<EOF
 set-backend direct
 -set-backend backend-which-does-not-exist
 get-backend
diff --git a/fish/test-mount-local.sh b/fish/test-mount-local.sh
index de308d3..845f707 100755
--- a/fish/test-mount-local.sh
+++ b/fish/test-mount-local.sh
@@ -61,7 +61,7 @@ rm -rf test-mount-local-mp
 
 mkdir test-mount-local-mp
 
-if ! ./guestfish -N test-mount-local.img=fs -m /dev/sda1 2>test-mount-local.errors <<EOF; then
+if ! guestfish -N test-mount-local.img=fs -m /dev/sda1 2>test-mount-local.errors <<EOF; then
 mount-local test-mount-local-mp
 ! $0 --run-test &
 mount-local-run
diff --git a/fish/test-prep.sh b/fish/test-prep.sh
index e52fca8..e2b972a 100755
--- a/fish/test-prep.sh
+++ b/fish/test-prep.sh
@@ -22,7 +22,7 @@ rm -f prep*.img
 
 # It would be nice if we could keep this automatically in sync
 # with the prepared disk types.  XXX
-$VG ./guestfish \
+$VG guestfish \
     -N prep1.img=disk \
     -N prep2.img=part \
     -N prep3.img=fs \
diff --git a/fish/test-read-file.sh b/fish/test-read-file.sh
index f1e28f1..8f35efb 100755
--- a/fish/test-read-file.sh
+++ b/fish/test-read-file.sh
@@ -22,7 +22,7 @@ set -e
 
 rm -f test.out
 
-$VG ./guestfish <<'EOF' > test.out
+$VG guestfish <<'EOF' > test.out
 add-ro ../tests/data/test.iso
 run
 mount-ro /dev/sda /
diff --git a/fish/test-remote-events.sh b/fish/test-remote-events.sh
index a3a13b1..c05f072 100755
--- a/fish/test-remote-events.sh
+++ b/fish/test-remote-events.sh
@@ -20,20 +20,20 @@
 
 set -e
 
-eval "$(./guestfish --listen)"
+eval "$(guestfish --listen)"
 
-$VG ./guestfish --remote event close_event close "echo closed"
+$VG guestfish --remote event close_event close "echo closed"
 
-output="$($VG ./guestfish --remote list-events)"
+output="$($VG guestfish --remote list-events)"
 if [ "$output" != '"close_event" (0): close: echo closed' ]; then
     echo "$0: list-events failed:"
     echo "$output"
-    ./guestfish --remote exit
+    guestfish --remote exit
     exit 1
 fi
 
 # Test close event (RHBZ#802389).
-output="$($VG ./guestfish --remote quit)"
+output="$($VG guestfish --remote quit)"
 
 if [ "$output" != "closed" ]; then
     echo "$0: close event failed:"
diff --git a/fish/test-remote.sh b/fish/test-remote.sh
index 442d927..28df682 100755
--- a/fish/test-remote.sh
+++ b/fish/test-remote.sh
@@ -22,24 +22,24 @@ set -e
 
 rm -f test-remote.img
 
-eval `./guestfish --listen`
+eval `guestfish --listen`
 
-$VG ./guestfish --remote alloc test-remote.img 10M
-$VG ./guestfish --remote run
-$VG ./guestfish --remote part-disk /dev/sda mbr
-$VG ./guestfish --remote mkfs ext2 /dev/sda1
-$VG ./guestfish --remote mount /dev/sda1 /
+$VG guestfish --remote alloc test-remote.img 10M
+$VG guestfish --remote run
+$VG guestfish --remote part-disk /dev/sda mbr
+$VG guestfish --remote mkfs ext2 /dev/sda1
+$VG guestfish --remote mount /dev/sda1 /
 
 # Failure of the above commands will cause the guestfish listener to exit.
 # Incorrect return from echo_daemon will not, so need to ensure the listener
 # exits in any case, while still reporting an error.
 error=0
-echo=$($VG ./guestfish --remote echo_daemon "This is a test")
+echo=$($VG guestfish --remote echo_daemon "This is a test")
 if [ "$echo" != "This is a test" ]; then
     error=1;
 fi
 
-$VG ./guestfish --remote exit
+$VG guestfish --remote exit
 
 rm test-remote.img
 
diff --git a/fish/test-reopen.sh b/fish/test-reopen.sh
index a6b5289..d8966d4 100755
--- a/fish/test-reopen.sh
+++ b/fish/test-reopen.sh
@@ -23,7 +23,7 @@ set -e
 
 rm -f test-reopen.img
 
-$VG ./guestfish <<'EOF'
+$VG guestfish <<'EOF'
 reopen
 reopen
 reopen
diff --git a/fish/test-run.sh b/fish/test-run.sh
index ec6e0d3..a66ad9c 100755
--- a/fish/test-run.sh
+++ b/fish/test-run.sh
@@ -18,4 +18,4 @@
 
 set -e
 
-$VG ./guestfish -a ../tests/guests/fedora.img run
+$VG guestfish -a ../tests/guests/fedora.img run
diff --git a/fish/test-stringlist.sh b/fish/test-stringlist.sh
index 416c092..ab23cb9 100755
--- a/fish/test-stringlist.sh
+++ b/fish/test-stringlist.sh
@@ -22,7 +22,7 @@ set -e
 
 rm -f test-stringlist.img
 
-eval `./guestfish --listen`
+eval `guestfish --listen`
 
 error=0
 
@@ -32,15 +32,15 @@ function check_echo {
 
     local echo
 
-    echo=$($VG ./guestfish --remote echo_daemon "$test")
+    echo=$($VG guestfish --remote echo_daemon "$test")
     if [ "$echo" != "$expected" ]; then
         echo "Expected \"$expected\", got \"$echo\""
         error=1
     fi
 }
 
-$VG ./guestfish --remote alloc test-stringlist.img 10M
-$VG ./guestfish --remote run
+$VG guestfish --remote alloc test-stringlist.img 10M
+$VG guestfish --remote run
 
 check_echo "' '"            " "
 check_echo "\'"             "'"
@@ -53,7 +53,7 @@ check_echo "'foo' 'bar'"    "foo bar"
 check_echo "'foo' "         "foo"
 check_echo " 'foo'"         "foo"
 
-$VG ./guestfish --remote exit
+$VG guestfish --remote exit
 
 rm test-stringlist.img
 
diff --git a/fish/test-tilde.sh b/fish/test-tilde.sh
index a2bf1fa..ca4af73 100755
--- a/fish/test-tilde.sh
+++ b/fish/test-tilde.sh
@@ -27,12 +27,12 @@ set -e
 HOME=$(pwd)
 export HOME
 
-if [ `echo 'echo ~' | $VG ./guestfish` != "$HOME" ]; then
+if [ `echo 'echo ~' | $VG guestfish` != "$HOME" ]; then
     echo "$0: failed: did not expand ~ correctly"
     exit 1
 fi
 
-if [ `echo 'echo ~/foo' | $VG ./guestfish` != "$HOME/foo" ]; then
+if [ `echo 'echo ~/foo' | $VG guestfish` != "$HOME/foo" ]; then
     echo "$0: failed: did not expand ~/foo correctly"
     exit 1
 fi
@@ -41,12 +41,12 @@ fi
 # should have a home directory.
 root="$(echo ~root)"
 
-if [ `echo 'echo ~root' | $VG ./guestfish` != "$root" ]; then
+if [ `echo 'echo ~root' | $VG guestfish` != "$root" ]; then
     echo "$0: failed: did not expand ~root correctly"
     exit 1
 fi
 
-if [ `echo 'echo ~root/foo' | $VG ./guestfish` != "$root/foo" ]; then
+if [ `echo 'echo ~root/foo' | $VG guestfish` != "$root/foo" ]; then
     echo "$0: failed: did not expand ~root/foo correctly"
     exit 1
 fi
@@ -55,12 +55,12 @@ fi
 unset HOME
 home="$(echo ~)"
 
-if [ `echo 'echo ~' | $VG ./guestfish` != "$home" ]; then
+if [ `echo 'echo ~' | $VG guestfish` != "$home" ]; then
     echo "$0: failed: did not expand ~ correctly when \$HOME unset"
     exit 1
 fi
 
-if [ `echo 'echo ~/foo' | $VG ./guestfish` != "$home/foo" ]; then
+if [ `echo 'echo ~/foo' | $VG guestfish` != "$home/foo" ]; then
     echo "$0: failed: did not expand ~/foo correctly when \$HOME unset"
     exit 1
 fi
diff --git a/fish/test-upload-to-dir.sh b/fish/test-upload-to-dir.sh
index 6e3f009..0bacd75 100755
--- a/fish/test-upload-to-dir.sh
+++ b/fish/test-upload-to-dir.sh
@@ -24,7 +24,7 @@ set -e
 
 rm -f test-upload-to-dir.img test-upload-to-dir.out
 
-if $VG ./guestfish -N test-upload-to-dir.img=fs -m /dev/sda1 upload ../tests/data/test.iso / 2>test-upload-to-dir.out
+if $VG guestfish -N test-upload-to-dir.img=fs -m /dev/sda1 upload ../tests/data/test.iso / 2>test-upload-to-dir.out
 then
   echo "$0: expecting guestfish to return an error"
   exit 1
diff --git a/format/test-virt-format.sh b/format/test-virt-format.sh
index 71cc802..2383c71 100755
--- a/format/test-virt-format.sh
+++ b/format/test-virt-format.sh
@@ -27,11 +27,11 @@ fi
 
 rm -f test-virt-format.img
 
-$VG ../fish/guestfish -N test-virt-format.img=bootrootlv exit
+$VG guestfish -N test-virt-format.img=bootrootlv exit
 
-$VG ./virt-format --filesystem=ext3 -a test-virt-format.img
+$VG virt-format --filesystem=ext3 -a test-virt-format.img
 
-if [ "$($VG ../cat/virt-filesystems -a test-virt-format.img)" != "/dev/sda1" ]; then
+if [ "$($VG virt-filesystems -a test-virt-format.img)" != "/dev/sda1" ]; then
     echo "$0: unexpected output after using virt-format"
     exit 1
 fi
diff --git a/fuse/test-fuse-umount-race.sh b/fuse/test-fuse-umount-race.sh
index 008e980..e789122 100755
--- a/fuse/test-fuse-umount-race.sh
+++ b/fuse/test-fuse-umount-race.sh
@@ -38,7 +38,7 @@ if [ ! -f ../tests/guests/fedora.img ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because uml backend does not support qcow2"
     exit 77
 fi
@@ -47,7 +47,7 @@ rm -f test.qcow2 test-copy.qcow2 test.pid
 rm -rf mp
 
 # Make a copy of the Fedora image so we can write to it then discard it.
-../fish/guestfish -- \
+guestfish -- \
     disk-create test.qcow2 qcow2 -1 \
       backingfile:../tests/guests/fedora.img backingformat:raw
 
@@ -77,7 +77,7 @@ fi
 # It should now be safe to copy and read the disk image.
 cp test.qcow2 test-copy.qcow2
 
-if [ "$(../fish/guestfish -a test-copy.qcow2 --ro -i is-file /test-umount)" != "true" ]; then
+if [ "$(guestfish -a test-copy.qcow2 --ro -i is-file /test-umount)" != "true" ]; then
     echo "$0: test failed"
     exit 1
 fi
diff --git a/fuse/test-fuse.sh b/fuse/test-fuse.sh
index f46c29c..13d1bd3 100755
--- a/fuse/test-fuse.sh
+++ b/fuse/test-fuse.sh
@@ -46,14 +46,11 @@ nr_stages=$(grep "^stage " $0 | wc -l)
 # and move to that directory for the initial phase of the script.
 top_builddir=$(cd "$top_builddir" > /dev/null; pwd)
 
-# Paths to the other programs and files.  NB: Must be absolute paths.
-guestfish="$top_builddir/fish/guestfish"
-guestmount="$top_builddir/fuse/guestmount"
-guestunmount="$top_builddir/fuse/guestunmount"
+# Paths to the other files.  NB: Must be absolute paths.
 image="$top_builddir/fuse/test-fuse.img"
 mp="$top_builddir/fuse/test-fuse-mp"
 
-if [ ! -x "$guestfish" -o ! -x "$guestmount" -o ! -x "$guestunmount" ]
+if ! guestfish --help >/dev/null 2>&1 || ! guestmount --help >/dev/null 2>&1 || ! guestunmount --help >/dev/null 2>&1
 then
     echo "$0: error: guestfish, guestmount or guestunmount are not available"
     exit 1
@@ -82,7 +79,7 @@ function cleanup ()
     if [ -x /sbin/fuser ]; then /sbin/fuser "$mp"; fi
 
     if [ -n "$mounted" ]; then
-        $guestunmount "$mp"
+        guestunmount "$mp"
     fi
 
     rm -f "$image"
@@ -99,7 +96,7 @@ function stage ()
 }
 
 stage Create filesystem with some initial content
-$guestfish <<EOF
+guestfish <<EOF
   sparse "$image" 10M
   run
   part-disk /dev/sda mbr
@@ -116,7 +113,7 @@ $guestfish <<EOF
 EOF
 
 stage Mounting the filesystem
-$guestmount \
+guestmount \
     -a "$image" -m /dev/sda1:/:acl,user_xattr \
     -o uid="$(id -u)" -o gid="$(id -g)" "$mp"
 # To debug guestmount, add this to the end of the preceding command:
diff --git a/inspector/test-virt-inspector.sh b/inspector/test-virt-inspector.sh
index b400e20..6fab253 100755
--- a/inspector/test-virt-inspector.sh
+++ b/inspector/test-virt-inspector.sh
@@ -33,7 +33,7 @@ for f in ../tests/guests/{debian,fedora,ubuntu,windows}.img; do
     # Ignore zero-sized windows.img if ntfs-3g is not installed.
     if [ -s "$f" ]; then
         b=$(basename "$f" .xml)
-	$VG ./virt-inspector -a "$f" > "actual-$b.xml"
+	$VG virt-inspector -a "$f" > "actual-$b.xml"
         # This 'diff' command will fail (because of -e option) if there
         # are any differences.
         diff -ur $diff_ignore "expected-$b.xml" "actual-$b.xml"
@@ -42,6 +42,6 @@ done
 
 # We could also test this image, but mdadm is problematic for
 # many users.
-# $VG ./virt-inspector \
+# $VG virt-inspector \
 #   -a ../tests/guests/fedora-md1.img \
 #   -a ../tests/guests/fedora-md2.img
diff --git a/make-fs/test-virt-make-fs.sh b/make-fs/test-virt-make-fs.sh
index a05ef9f..2ed3ce9 100755
--- a/make-fs/test-virt-make-fs.sh
+++ b/make-fs/test-virt-make-fs.sh
@@ -40,7 +40,7 @@ if [ -n "$SKIP_TEST_VIRT_MAKE_FS_BTRFS" ]; then
 fi
 
 # UML backend doesn't support qcow2.
-if [ "$(../fish/guestfish get-backend)" != "uml" ]; then
+if [ "$(guestfish get-backend)" != "uml" ]; then
     qcow2_supported=yes
 fi
 
@@ -94,6 +94,6 @@ dd if=/dev/zero of=test.file bs=1024 count=$tarsize
 tar -c -f test.tar test.file
 rm test.file
 
-$VG ./virt-make-fs $params -- test.tar output.img
+$VG virt-make-fs $params -- test.tar output.img
 
 rm test.tar output.img
diff --git a/p2v/test-virt-p2v.sh b/p2v/test-virt-p2v.sh
index 2f66c7c..f4d28d1 100755
--- a/p2v/test-virt-p2v.sh
+++ b/p2v/test-virt-p2v.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_VIRT_P2V_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -61,7 +61,7 @@ export PATH=$d:$PATH
 # The Linux kernel command line.
 cmdline="p2v.server=localhost p2v.name=windows p2v.debug p2v.disks=$f p2v.o=local p2v.os=$d p2v.network=em1:wired,other"
 
-./virt-p2v --cmdline="$cmdline"
+virt-p2v --cmdline="$cmdline"
 
 # Test the libvirt XML metadata and a disk was created.
 test -f $d/windows.xml
diff --git a/rescue/test-virt-rescue-suggest.sh b/rescue/test-virt-rescue-suggest.sh
index c3f5d91..f79e4f8 100755
--- a/rescue/test-virt-rescue-suggest.sh
+++ b/rescue/test-virt-rescue-suggest.sh
@@ -28,7 +28,7 @@ fi
 
 rm -f virt-rescue-suggest.out
 
-$VG ./virt-rescue --suggest "$guest" |
+$VG virt-rescue --suggest "$guest" |
   grep '^mount ' |
   sed -r 's,/dev/[abce-ln-z]+d,/dev/sd,' > virt-rescue-suggest.out
 
diff --git a/resize/test-virt-resize.sh b/resize/test-virt-resize.sh
index 29c1e4c..9a1c24f 100755
--- a/resize/test-virt-resize.sh
+++ b/resize/test-virt-resize.sh
@@ -19,7 +19,7 @@
 export LANG=C
 set -e
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: skipping test because uml backend does not support qcow2"
     exit 77
 fi
@@ -29,13 +29,13 @@ fi
 # This exercises a number of interesting codepaths including resizing
 # LV content, handling GPT, and using qcow2 as a target.
 
-$VG ../fish/guestfish \
+$VG guestfish \
     -N test-virt-resize-1.img=bootrootlv:/dev/VG/LV:ext2:ext4:400M:32M:gpt </dev/null
 
-$VG ../fish/guestfish \
+$VG guestfish \
     disk-create test-virt-resize-2.img qcow2 500M preallocation:metadata
 
-$VG ./virt-resize -d --debug-gc \
+$VG virt-resize -d --debug-gc \
     --expand /dev/sda2 \
     --lv-expand /dev/VG/LV \
     --format raw --output-format qcow2 \
@@ -45,7 +45,7 @@ $VG ./virt-resize -d --debug-gc \
 # image created above contains no data, we will nevertheless use
 # similar operations to ones that might be used by a real admin.
 
-../fish/guestfish -a test-virt-resize-1.img <<EOF
+guestfish -a test-virt-resize-1.img <<EOF
 run
 resize2fs-size /dev/VG/LV 190M
 lvresize /dev/VG/LV 190
@@ -53,8 +53,8 @@ pvresize-size /dev/sda2 200M
 fsck ext4 /dev/VG/LV
 EOF
 
-rm -f test-virt-resize-2.img; ../fish/guestfish sparse test-virt-resize-2.img 300M
-$VG ./virt-resize -d --debug-gc \
+rm -f test-virt-resize-2.img; guestfish sparse test-virt-resize-2.img 300M
+$VG virt-resize -d --debug-gc \
     --shrink /dev/sda2 \
     --format raw --output-format raw \
     test-virt-resize-1.img test-virt-resize-2.img
diff --git a/sparsify/test-virt-sparsify-in-place.sh b/sparsify/test-virt-sparsify-in-place.sh
index e454e79..d085032 100755
--- a/sparsify/test-virt-sparsify-in-place.sh
+++ b/sparsify/test-virt-sparsify-in-place.sh
@@ -24,7 +24,7 @@ if [ -n "$SKIP_TEST_VIRT_SPARSIFY_IN_PLACE_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: skipping test because uml backend does not support discard"
     exit 77
 fi
@@ -34,7 +34,7 @@ rm -f test-virt-sparsify-in-place.img
 # Create a filesystem, fill it with data, then delete the data.  Then
 # prove that sparsifying it reduces the size of the final filesystem.
 
-$VG ../fish/guestfish \
+$VG guestfish \
     -N test-virt-sparsify-in-place.img=bootrootlv:/dev/VG/LV:ext4:ext4:400M:32M:gpt <<EOF
 mount /dev/VG/LV /
 mkdir /boot
@@ -49,7 +49,7 @@ EOF
 
 size_before=$(du -s test-virt-sparsify-in-place.img | awk '{print $1}')
 
-$VG ./virt-sparsify --debug-gc --in-place test-virt-sparsify-in-place.img || {
+$VG virt-sparsify --debug-gc --in-place test-virt-sparsify-in-place.img || {
     if [ "$?" -eq 3 ]; then
         rm test-virt-sparsify-in-place.img
         echo "$0: discard not supported in virt-sparsify"
diff --git a/sparsify/test-virt-sparsify.sh b/sparsify/test-virt-sparsify.sh
index fae5bee..0404424 100755
--- a/sparsify/test-virt-sparsify.sh
+++ b/sparsify/test-virt-sparsify.sh
@@ -19,7 +19,7 @@
 export LANG=C
 set -e
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: skipping test because uml backend does not support qcow2"
     exit 77
 fi
@@ -29,7 +29,7 @@ rm -f test-virt-sparsify-1.img test-virt-sparsify-2.img
 # Create a filesystem, fill it with data, then delete the data.  Then
 # prove that sparsifying it reduces the size of the final filesystem.
 
-$VG ../fish/guestfish \
+$VG guestfish \
     -N test-virt-sparsify-1.img=bootrootlv:/dev/VG/LV:ext2:ext4:400M:32M:gpt <<EOF
 mount /dev/VG/LV /
 mkdir /boot
@@ -42,7 +42,7 @@ rm /boot/big
 umount-all
 EOF
 
-$VG ./virt-sparsify --debug-gc test-virt-sparsify-1.img --convert qcow2 test-virt-sparsify-2.img
+$VG virt-sparsify --debug-gc test-virt-sparsify-1.img --convert qcow2 test-virt-sparsify-2.img
 
 size_before=$(du -s test-virt-sparsify-1.img | awk '{print $1}')
 size_after=$(du -s test-virt-sparsify-2.img | awk '{print $1}')
diff --git a/sysprep/test-virt-sysprep-passwords.sh b/sysprep/test-virt-sysprep-passwords.sh
index d56758a..b5189c8 100755
--- a/sysprep/test-virt-sysprep-passwords.sh
+++ b/sysprep/test-virt-sysprep-passwords.sh
@@ -35,11 +35,11 @@ fi
 # so we fake that now.
 
 rm -f passwords.qcow2 password
-../fish/guestfish -- \
+guestfish -- \
     disk-create passwords.qcow2 qcow2 -1 \
       backingfile:../tests/guests/fedora.img backingformat:raw
 
-../fish/guestfish -a passwords.qcow2 -i <<'EOF'
+guestfish -a passwords.qcow2 -i <<'EOF'
 write-append /etc/shadow "test01::15677:0:99999:7:::\n"
 write-append /etc/shadow "test02::15677:0:99999:7:::\n"
 write-append /etc/shadow "test03::15677:0:99999:7:::\n"
@@ -57,7 +57,7 @@ echo 123456 > password
 
 # Run virt-sysprep password operation.
 
-./virt-sysprep \
+virt-sysprep \
     -a passwords.qcow2 \
     --enable customize \
     --password test01:password:123456 \
diff --git a/sysprep/test-virt-sysprep-script.sh b/sysprep/test-virt-sysprep-script.sh
index 8193af0..10ba1d1 100755
--- a/sysprep/test-virt-sysprep-script.sh
+++ b/sysprep/test-virt-sysprep-script.sh
@@ -32,7 +32,7 @@ fi
 
 # Check that multiple scripts can run.
 rm -f stamp-script1.sh stamp-script2.sh stamp-script4.sh
-if ! ./virt-sysprep -q -n -a ../tests/guests/fedora.img --enable script \
+if ! virt-sysprep -q -n -a ../tests/guests/fedora.img --enable script \
         --script $abs_srcdir/script1.sh --script $abs_srcdir/script2.sh; then
     echo "$0: virt-sysprep wasn't expected to exit with error."
     exit 1
@@ -43,19 +43,19 @@ if [ ! -f stamp-script1.sh -o ! -f stamp-script2.sh ]; then
 fi
 
 # Check that if a script fails, virt-sysprep exits with an error.
-if ./virt-sysprep -q -n -a ../tests/guests/fedora.img --enable script \
+if virt-sysprep -q -n -a ../tests/guests/fedora.img --enable script \
         --script $abs_srcdir/script3.sh; then
     echo "$0: virt-sysprep didn't exit with an error."
     exit 1
 fi
 
 # Check that virt-sysprep uses a new temporary directory every time.
-if ! ./virt-sysprep -q -n -a ../tests/guests/fedora.img --enable script \
+if ! virt-sysprep -q -n -a ../tests/guests/fedora.img --enable script \
         --script $abs_srcdir/script4.sh; then
     echo "$0: virt-sysprep (script4.sh, try #1) wasn't expected to exit with error."
     exit 1
 fi
-if ! ./virt-sysprep -q -n -a ../tests/guests/fedora.img --enable script \
+if ! virt-sysprep -q -n -a ../tests/guests/fedora.img --enable script \
         --script $abs_srcdir/script4.sh; then
     echo "$0: virt-sysprep (script4.sh, try #2) wasn't expected to exit with error."
     exit 1
diff --git a/sysprep/test-virt-sysprep.sh b/sysprep/test-virt-sysprep.sh
index 5d1b714..7ec96d0 100755
--- a/sysprep/test-virt-sysprep.sh
+++ b/sysprep/test-virt-sysprep.sh
@@ -21,7 +21,7 @@ set -e
 
 # Get a comma-separated list of the enabled-by-default operations.
 operations=$(
-  ./virt-sysprep --list-operations |
+  virt-sysprep --list-operations |
     fgrep '*' |
     awk '{printf ("%s,",$1)}' |
     sed 's/,$//'
@@ -36,13 +36,13 @@ for f in ../tests/guests/{debian,fedora,ubuntu,windows}.img; do
     # Ignore zero-sized windows.img if ntfs-3g is not installed.
     if [ -s "$f" ]; then
 	echo "Running virt-sysprep on $f ..."
-	$VG ./virt-sysprep -q -n --enable "$operations" -a $f
+	$VG virt-sysprep -q -n --enable "$operations" -a $f
 	echo
     fi
 done
 
 # We could also test this image, but mdadm is problematic for
 # many users.
-# $VG ./virt-sysprep -q -n \
+# $VG virt-sysprep -q -n \
 #   -a ../tests/guests/fedora-md1.img \
 #   -a ../tests/guests/fedora-md2.img
diff --git a/tests/9p/test-9p.sh b/tests/9p/test-9p.sh
index 6206609..9e396a4 100755
--- a/tests/9p/test-9p.sh
+++ b/tests/9p/test-9p.sh
@@ -26,7 +26,7 @@ if [ -n "$SKIP_TEST_9P_SH" ]; then
     exit 77
 fi
 
-backend="$(../../fish/guestfish get-backend)"
+backend="$(guestfish get-backend)"
 if [[ "$backend" != "direct" ]]; then
     echo "$0: test skipped because backend ($backend) is not 'direct'."
     exit 77
@@ -45,7 +45,7 @@ fi
 
 rm -f test-9p.img test-9p.out
 
-../../fish/guestfish <<EOF
+guestfish <<EOF
 # This dummy disk is not actually used, but libguestfs requires one.
 sparse test-9p.img 1M
 
diff --git a/tests/btrfs/test-btrfs-devices.sh b/tests/btrfs/test-btrfs-devices.sh
index 7ef7008..3935c60 100755
--- a/tests/btrfs/test-btrfs-devices.sh
+++ b/tests/btrfs/test-btrfs-devices.sh
@@ -24,8 +24,6 @@
 
 set -e
 
-guestfish=../../fish/guestfish
-
 # Allow the test to be skipped since btrfs is often broken.
 if [ -n "$SKIP_TEST_BTRFS_DEVICES_SH" ]; then
     echo "$0: skipping test because environment variable is set."
@@ -33,14 +31,14 @@ if [ -n "$SKIP_TEST_BTRFS_DEVICES_SH" ]; then
 fi
 
 # If btrfs is not available, bail.
-if ! $guestfish -a /dev/null run : available btrfs; then
+if ! guestfish -a /dev/null run : available btrfs; then
     echo "$0: skipping test because btrfs is not available"
     exit 77
 fi
 
 rm -f test-btrfs-devices-{1,2,3,4}.img
 
-$guestfish <<EOF
+guestfish <<EOF
 # Add four empty disks
 sparse test-btrfs-devices-1.img 1G
 sparse test-btrfs-devices-2.img 1G
diff --git a/tests/create/test-disk-create.sh b/tests/create/test-disk-create.sh
index 967ceba..93dc706 100755
--- a/tests/create/test-disk-create.sh
+++ b/tests/create/test-disk-create.sh
@@ -25,7 +25,7 @@ rm -f disk*.img file:*.img
 
 # XXX We should also test failure paths.
 
-../../fish/guestfish <<EOF
+guestfish <<EOF
   disk-create disk1.img  raw   256K
   disk-create disk2.img  raw   256K preallocation:sparse
   disk-create disk3.img  raw   256K preallocation:full
@@ -45,7 +45,7 @@ rm -f disk*.img file:*.img
   disk-create disk,,0.img qcow2 256K
 EOF
 
-output="$(../../fish/guestfish <<EOF
+output="$(guestfish <<EOF
   disk-format disk1.img
   disk-format disk2.img
   disk-format disk3.img
diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh
index 1ba014b..9930865 100755
--- a/tests/disks/test-qemu-drive-libvirt.sh
+++ b/tests/disks/test-qemu-drive-libvirt.sh
@@ -41,8 +41,7 @@ if ! ../../src/libvirt-is-version 1 1 3; then
     exit 77
 fi
 
-guestfish="\
-  ../../fish/guestfish -c test://$abs_builddir/test-qemu-drive-libvirt.xml"
+guestfish="guestfish -c test://$abs_builddir/test-qemu-drive-libvirt.xml"
 
 export LIBGUESTFS_BACKEND=direct
 export LIBGUESTFS_HV="${abs_srcdir}/debug-qemu.sh"
diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh
index 91677bd..b530e7d 100755
--- a/tests/disks/test-qemu-drive.sh
+++ b/tests/disks/test-qemu-drive.sh
@@ -21,8 +21,6 @@ export LANG=C
 
 set -e
 
-guestfish=../../fish/guestfish
-
 export LIBGUESTFS_BACKEND=direct
 export LIBGUESTFS_HV="${abs_srcdir}/debug-qemu.sh"
 export DEBUG_QEMU_FILE="${abs_builddir}/test-qemu-drive.out"
@@ -46,7 +44,7 @@ rm -f "$DEBUG_QEMU_FILE"
 
 # Ceph (RBD).
 
-$guestfish <<EOF ||:
+guestfish <<EOF ||:
   add "abc-def/ghi-jkl" "format:raw" "protocol:rbd" \
     "server:1.2.3.4:1234 1.2.3.5:1235 1.2.3.6:1236"
   run
@@ -55,7 +53,7 @@ check_output
 grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:mon_host=1.2.3.4\\:1234\\;1.2.3.5\\:1235\\;1.2.3.6\\:1236:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail
 rm "$DEBUG_QEMU_FILE"
 
-$guestfish <<EOF ||:
+guestfish <<EOF ||:
   add "abc-def/ghi-jkl" "format:raw" "protocol:rbd"
   run
 EOF
@@ -65,7 +63,7 @@ rm "$DEBUG_QEMU_FILE"
 
 # HTTP.
 
-$guestfish <<EOF ||:
+guestfish <<EOF ||:
   add "/disk.img" "format:raw" "protocol:http" "server:www.example.com"
   run
 EOF
@@ -75,7 +73,7 @@ rm "$DEBUG_QEMU_FILE"
 
 # Gluster.
 
-$guestfish <<EOF ||:
+guestfish <<EOF ||:
   add "volname/image" "format:raw" "protocol:gluster" "server:www.example.com:24007"
   run
 EOF
@@ -85,7 +83,7 @@ rm "$DEBUG_QEMU_FILE"
 
 # iSCSI.
 
-$guestfish <<EOF ||:
+guestfish <<EOF ||:
   add "target-iqn-name/lun" "format:raw" "protocol:iscsi" "server:www.example.com:3000"
   run
 EOF
@@ -95,7 +93,7 @@ rm "$DEBUG_QEMU_FILE"
 
 # NBD.
 
-$guestfish <<EOF ||:
+guestfish <<EOF ||:
   add "" "format:raw" "protocol:nbd" "server:1.2.3.4:1234"
   run
 EOF
@@ -103,7 +101,7 @@ check_output
 grep -sq -- '-drive file=nbd:1.2.3.4:1234,' "$DEBUG_QEMU_FILE" || fail
 rm "$DEBUG_QEMU_FILE"
 
-$guestfish <<EOF ||:
+guestfish <<EOF ||:
   add "" "format:raw" "protocol:nbd" "server:unix:/socket"
   run
 EOF
@@ -113,7 +111,7 @@ rm "$DEBUG_QEMU_FILE"
 
 # Sheepdog.
 
-$guestfish <<EOF ||:
+guestfish <<EOF ||:
   add "volume" "format:raw" "protocol:sheepdog"
   run
 EOF
@@ -123,7 +121,7 @@ rm "$DEBUG_QEMU_FILE"
 
 # SSH.
 
-$guestfish <<EOF ||:
+guestfish <<EOF ||:
   add "/disk.img" "format:raw" "protocol:ssh" "server:example.com" \
     "username:rich"
   run
diff --git a/tests/guests/guest-aux/make-debian-img.sh b/tests/guests/guest-aux/make-debian-img.sh
index c3db56e..95228ab 100755
--- a/tests/guests/guest-aux/make-debian-img.sh
+++ b/tests/guests/guest-aux/make-debian-img.sh
@@ -31,7 +31,7 @@ LABEL=BOOT /boot ext2 default 0 0
 EOF
 
 # Create a disk image.
-../../fish/guestfish <<EOF
+guestfish <<EOF
 sparse debian.img.tmp.$$ 512M
 run
 
diff --git a/tests/guests/guest-aux/make-ubuntu-img.sh b/tests/guests/guest-aux/make-ubuntu-img.sh
index 445141f..183985b 100755
--- a/tests/guests/guest-aux/make-ubuntu-img.sh
+++ b/tests/guests/guest-aux/make-ubuntu-img.sh
@@ -39,7 +39,7 @@ DISTRIB_DESCRIPTION="Ubuntu 10.10 (Phony Pharaoh)"
 EOF
 
 # Create a disk image.
-../../fish/guestfish <<EOF
+guestfish <<EOF
 sparse ubuntu.img.tmp.$$ 512M
 run
 
diff --git a/tests/guests/guest-aux/make-windows-img.sh b/tests/guests/guest-aux/make-windows-img.sh
index 860ec06..9d477fa 100755
--- a/tests/guests/guest-aux/make-windows-img.sh
+++ b/tests/guests/guest-aux/make-windows-img.sh
@@ -25,7 +25,7 @@ set -e
 # ntfs-3g/ntfsprogs then we cannot create a Windows phony image.
 # Nothing actually uses windows.img in the standard build so we can
 # just 'touch' it and emit a warning.
-if ! ../../fish/guestfish -a /dev/null run : available "ntfs3g ntfsprogs"; then
+if ! guestfish -a /dev/null run : available "ntfs3g ntfsprogs"; then
   echo "***"
   echo "Warning: cannot create windows.img because there is no NTFS"
   echo "support in this build of libguestfs.  Just touching the output"
@@ -36,7 +36,7 @@ if ! ../../fish/guestfish -a /dev/null run : available "ntfs3g ntfsprogs"; then
 fi
 
 # Create a disk image.
-../../fish/guestfish <<EOF
+guestfish <<EOF
 sparse windows.img.tmp.$$ 512M
 run
 
diff --git a/tests/luks/test-luks-list.sh b/tests/luks/test-luks-list.sh
index bb8389c..be22e8b 100755
--- a/tests/luks/test-luks-list.sh
+++ b/tests/luks/test-luks-list.sh
@@ -26,14 +26,14 @@ set -e
 }
 
 # If luks is not available, bail.
-if ! ../../fish/guestfish -a /dev/null run : available luks; then
+if ! guestfish -a /dev/null run : available luks; then
     echo "$0: skipping test because luks is not available"
     exit 77
 fi
 
 rm -f test-luks-list.img test-luks-list.out
 
-../../fish/guestfish --keys-from-stdin > test-luks-list.out <<'EOF'
+guestfish --keys-from-stdin > test-luks-list.out <<'EOF'
 sparse test-luks-list.img 1G
 run
 part-init /dev/sda mbr
diff --git a/tests/luks/test-luks.sh b/tests/luks/test-luks.sh
index 5d8e8b2..2f65750 100755
--- a/tests/luks/test-luks.sh
+++ b/tests/luks/test-luks.sh
@@ -26,14 +26,14 @@ set -e
 }
 
 # If luks is not available, bail.
-if ! ../../fish/guestfish -a /dev/null run : available luks; then
+if ! guestfish -a /dev/null run : available luks; then
     echo "$0: skipping test because luks is not available"
     exit 77
 fi
 
 rm -f test-luks.img
 
-../../fish/guestfish --keys-from-stdin <<EOF
+guestfish --keys-from-stdin <<EOF
 sparse test-luks.img 1G
 run
 part-disk /dev/sda mbr
diff --git a/tests/lvm/test-lvm-filtering.sh b/tests/lvm/test-lvm-filtering.sh
index 3744021..f00d712 100755
--- a/tests/lvm/test-lvm-filtering.sh
+++ b/tests/lvm/test-lvm-filtering.sh
@@ -27,7 +27,7 @@ fi
 
 rm -f test-lvm-filtering-1.img test-lvm-filtering-2.img
 
-actual=$(../../fish/guestfish <<'EOF'
+actual=$(guestfish <<'EOF'
 sparse test-lvm-filtering-1.img 1G
 sparse test-lvm-filtering-2.img 1G
 
diff --git a/tests/md/test-inspect-fstab-md.sh b/tests/md/test-inspect-fstab-md.sh
index ac2e0a9..43e1d3a 100755
--- a/tests/md/test-inspect-fstab-md.sh
+++ b/tests/md/test-inspect-fstab-md.sh
@@ -26,15 +26,13 @@ if [ -n "$SKIP_TEST_INSPECT_FSTAB_MD_SH" ]; then
     exit 77
 fi
 
-guestfish=../../fish/guestfish
-
 rm -f inspect-fstab-md-{1,2}.img inspect-fstab-md.fstab inspect-fstab-md.output
 
 # First, test the regular fedora image, which specifies /boot as /dev/md0
 cp ../guests/fedora-md1.img inspect-fstab-md-1.img
 cp ../guests/fedora-md2.img inspect-fstab-md-2.img
 
-$guestfish -i inspect-fstab-md-[12].img <<'EOF' | sort > inspect-fstab-md.output
+guestfish -i inspect-fstab-md-[12].img <<'EOF' | sort > inspect-fstab-md.output
   exists /boot/grub/grub.conf
 EOF
 
@@ -49,13 +47,13 @@ cat <<'EOF' > inspect-fstab-md.fstab
 /dev/md/boot /boot ext2 default 0 0
 EOF
 
-$guestfish -a inspect-fstab-md-1.img -a inspect-fstab-md-2.img <<'EOF'
+guestfish -a inspect-fstab-md-1.img -a inspect-fstab-md-2.img <<'EOF'
   run
   mount /dev/VG/Root /
   upload inspect-fstab-md.fstab /etc/fstab
 EOF
 
-$guestfish -i inspect-fstab-md-[12].img <<'EOF' | sort > inspect-fstab-md.output
+guestfish -i inspect-fstab-md-[12].img <<'EOF' | sort > inspect-fstab-md.output
   exists /boot/grub/grub.conf
 EOF
 
diff --git a/tests/md/test-inspect-fstab.sh b/tests/md/test-inspect-fstab.sh
index 04ee9d1..f31ec2e 100755
--- a/tests/md/test-inspect-fstab.sh
+++ b/tests/md/test-inspect-fstab.sh
@@ -22,10 +22,9 @@
 set -e
 export LANG=C
 
-guestfish=../../fish/guestfish
 canonical="sed -r s,/dev/[abce-ln-z]+d,/dev/sd,g"
 
-if [ "$($guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: skipping test because uml backend does not support qcow2"
     exit 77
 fi
@@ -34,7 +33,7 @@ rm -f inspect-fstab-1.qcow2 inspect-fstab.fstab inspect-fstab.output
 
 # Start with the regular (good) fedora image, modify /etc/fstab
 # and then inspect it.
-$guestfish -- \
+guestfish -- \
   disk-create inspect-fstab-1.qcow2 qcow2 -1 \
     backingfile:../guests/fedora.img backingformat:raw
 
@@ -56,14 +55,14 @@ cat <<'EOF' > inspect-fstab.fstab
 /dev/disk/by-id/ata-QEMU_HARDDISK_QM00001-part3 /id3 ext2 default 0 0
 EOF
 
-$guestfish -a inspect-fstab-1.qcow2 <<'EOF'
+guestfish -a inspect-fstab-1.qcow2 <<'EOF'
   run
   mount /dev/VG/Root /
   upload inspect-fstab.fstab /etc/fstab
 EOF
 
 # This will give a warning, but should not fail.
-$guestfish -a inspect-fstab-1.qcow2 -i <<'EOF' | sort | $canonical > inspect-fstab.output
+guestfish -a inspect-fstab-1.qcow2 -i <<'EOF' | sort | $canonical > inspect-fstab.output
   inspect-get-mountpoints /dev/VG/Root
 EOF
 
@@ -88,13 +87,13 @@ cat <<'EOF' > inspect-fstab.fstab
 /dev/xvdg1 /boot ext2 default 0 0
 EOF
 
-$guestfish -a inspect-fstab-1.qcow2 <<'EOF'
+guestfish -a inspect-fstab-1.qcow2 <<'EOF'
   run
   mount /dev/VG/Root /
   upload inspect-fstab.fstab /etc/fstab
 EOF
 
-$guestfish <<'EOF' | $canonical > inspect-fstab.output
+guestfish <<'EOF' | $canonical > inspect-fstab.output
   add inspect-fstab-1.qcow2 readonly:true name:xvdg
   run
   inspect-os
@@ -119,13 +118,13 @@ cat <<'EOF' > inspect-fstab.fstab
 /dev/cciss/c1d3 /var ext2 default 0 0
 EOF
 
-$guestfish -a inspect-fstab-1.qcow2 <<'EOF'
+guestfish -a inspect-fstab-1.qcow2 <<'EOF'
   run
   mount /dev/VG/Root /
   upload inspect-fstab.fstab /etc/fstab
 EOF
 
-$guestfish <<'EOF' | $canonical > inspect-fstab.output
+guestfish <<'EOF' | $canonical > inspect-fstab.output
   add inspect-fstab-1.qcow2 readonly:true name:cciss/c1d3
   run
   inspect-os
diff --git a/tests/md/test-list-filesystems.sh b/tests/md/test-list-filesystems.sh
index 9f54182..2bfa6f3 100755
--- a/tests/md/test-list-filesystems.sh
+++ b/tests/md/test-list-filesystems.sh
@@ -37,7 +37,7 @@ rm -f list-fs.output
 # md127 : 20M ext4
 # vg0 : 16M LV (lv0)
 # lv0 : 16M vfat
-../../fish/guestfish <<EOF | sed -r s,/dev/[abce-ln-z]+d,/dev/sd,g > list-fs.output
+guestfish <<EOF | sed -r s,/dev/[abce-ln-z]+d,/dev/sd,g > list-fs.output
 # Add 2 empty disks
 scratch 50M
 scratch 50M
diff --git a/tests/md/test-list-md-devices.sh b/tests/md/test-list-md-devices.sh
index 511f6be..5a9cbe8 100755
--- a/tests/md/test-list-md-devices.sh
+++ b/tests/md/test-list-md-devices.sh
@@ -26,7 +26,7 @@ if [ -n "$SKIP_TEST_LIST_MD_DEVICES_SH" ]; then
 fi
 
 output=$(
-../../fish/guestfish <<EOF
+guestfish <<EOF
 # Add 2 empty disks
 sparse list-md-devices-1.img 100M
 sparse list-md-devices-2.img 100M
@@ -49,7 +49,7 @@ fi
 
 # Ensure list-md-devices now returns the newly created md device
 output=$(
-../../fish/guestfish -a list-md-devices-1.img -a list-md-devices-2.img <<EOF
+guestfish -a list-md-devices-1.img -a list-md-devices-2.img <<EOF
 run
 list-md-devices
 EOF
diff --git a/tests/md/test-mdadm.sh b/tests/md/test-mdadm.sh
index 0e1de05..05b2432 100755
--- a/tests/md/test-mdadm.sh
+++ b/tests/md/test-mdadm.sh
@@ -27,7 +27,7 @@ fi
 
 rm -f mdadm-{1,2,3,4}.img
 
-../../fish/guestfish <<EOF
+guestfish <<EOF
 # Add four empty disks
 sparse mdadm-1.img 100M
 sparse mdadm-2.img 100M
@@ -97,15 +97,15 @@ write /r5t3/baz "testing"
 
 EOF
 
-eval `../../fish/guestfish --listen`
-../../fish/guestfish --remote add-ro mdadm-1.img
-../../fish/guestfish --remote add-ro mdadm-2.img
-../../fish/guestfish --remote add-ro mdadm-3.img
-../../fish/guestfish --remote add-ro mdadm-4.img
-../../fish/guestfish --remote run
+eval `guestfish --listen`
+guestfish --remote add-ro mdadm-1.img
+guestfish --remote add-ro mdadm-2.img
+guestfish --remote add-ro mdadm-3.img
+guestfish --remote add-ro mdadm-4.img
+guestfish --remote run
 
-for md in `../../fish/guestfish --remote list-md-devices`; do
-  ../../fish/guestfish --remote md-detail "$md" > md-detail.out
+for md in `guestfish --remote list-md-devices`; do
+  guestfish --remote md-detail "$md" > md-detail.out
 
   sed 's/:\s*/=/' md-detail.out > md-detail.out.sh
   . md-detail.out.sh
@@ -148,24 +148,24 @@ for md in `../../fish/guestfish --remote list-md-devices`; do
   if [ "$error" -eq 1 ]; then
     echo "$0: Unexpected output from md-detail for device $md"
     cat md-detail.out
-    ../../fish/guestfish --remote exit
+    guestfish --remote exit
     exit 1
   fi
 done
 
-../../fish/guestfish --remote exit
+guestfish --remote exit
 
-eval `../../fish/guestfish --listen`
-../../fish/guestfish --remote add-ro mdadm-1.img
-../../fish/guestfish --remote add-ro mdadm-2.img
-../../fish/guestfish --remote add-ro mdadm-3.img
-../../fish/guestfish --remote add-ro mdadm-4.img
-../../fish/guestfish --remote run
+eval `guestfish --listen`
+guestfish --remote add-ro mdadm-1.img
+guestfish --remote add-ro mdadm-2.img
+guestfish --remote add-ro mdadm-3.img
+guestfish --remote add-ro mdadm-4.img
+guestfish --remote run
 
-for md in `../../fish/guestfish --remote list-md-devices`; do
-  ../../fish/guestfish --remote md-stop "$md"
+for md in `guestfish --remote list-md-devices`; do
+  guestfish --remote md-stop "$md"
 done
 
-../../fish/guestfish --remote exit
+guestfish --remote exit
 
 rm md-detail.out mdadm-1.img mdadm-2.img mdadm-3.img mdadm-4.img
diff --git a/tests/mountable/test-mountable-inspect.sh b/tests/mountable/test-mountable-inspect.sh
index b248b01..3b81fd0 100755
--- a/tests/mountable/test-mountable-inspect.sh
+++ b/tests/mountable/test-mountable-inspect.sh
@@ -19,7 +19,6 @@
 set -e
 export LANG=C
 
-guestfish=../../fish/guestfish
 canonical="sed s,/dev/vd,/dev/sd,g"
 
 # Allow the test to be skipped since btrfs is often broken.
@@ -28,13 +27,13 @@ if [ -n "$SKIP_TEST_MOUNTABLE_INSPECT_SH" ]; then
     exit 77
 fi
 
-if [ "$($guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: skipping test because uml backend does not support qcow2"
     exit 77
 fi
 
 # Bail if btrfs is not available.
-if ! $guestfish -a /dev/null run : available btrfs; then
+if ! guestfish -a /dev/null run : available btrfs; then
     echo "$0: skipping test because btrfs is not available"
     exit 77
 fi
@@ -43,13 +42,13 @@ rm -f root.tmp test.qcow2 test.output
 
 # Start with the regular (good) fedora image, modify /etc/fstab
 # and then inspect it.
-$guestfish -- \
+guestfish -- \
   disk-create test.qcow2 qcow2 -1 \
     backingfile:../guests/fedora-btrfs.img backingformat:raw
 
 # Test that basic inspection works and the expected filesystems are
 # found
-$guestfish -a test.qcow2 -i <<'EOF' | sort | $canonical > test.output
+guestfish -a test.qcow2 -i <<'EOF' | sort | $canonical > test.output
   inspect-get-roots | head -1 > root.tmp
   <! echo inspect-get-mountpoints "`cat root.tmp`"
 EOF
@@ -63,7 +62,7 @@ if [ "$(cat test.output)" != "/: btrfsvol:/dev/sda2/root
 fi
 
 # Additional sanity check: did we get the release name right?
-$guestfish -a test.qcow2 -i <<'EOF' > test.output
+guestfish -a test.qcow2 -i <<'EOF' > test.output
   inspect-get-roots | head -1 > root.tmp
   <! echo inspect-get-product-name "`cat root.tmp`"
 EOF
diff --git a/tests/network/test-network.sh b/tests/network/test-network.sh
index be260a8..f24ef2e 100755
--- a/tests/network/test-network.sh
+++ b/tests/network/test-network.sh
@@ -28,10 +28,10 @@ if [ -n "$SKIP_TEST_RHBZ690819_SH" ]; then
     exit 77
 fi
 
-backend="$(../../fish/guestfish get-backend)"
+backend="$(guestfish get-backend)"
 if [[ "$backend" =~ ^uml ]]; then
     echo "$0: test skipped because backend ($backend) is 'uml'."
     exit 77
 fi
 
-../../fish/guestfish --network -a /dev/null run
+guestfish --network -a /dev/null run
diff --git a/tests/ntfsclone/test-ntfsclone.sh b/tests/ntfsclone/test-ntfsclone.sh
index 985ea72..30c21bf 100755
--- a/tests/ntfsclone/test-ntfsclone.sh
+++ b/tests/ntfsclone/test-ntfsclone.sh
@@ -27,10 +27,8 @@ fi
 
 rm -f test-ntfsclone.img ntfsclone-backup1 ntfsclone-backup2
 
-guestfish=../../fish/guestfish
-
 # Skip if ntfs-3g is not supported by the appliance.
-if ! $guestfish add /dev/null : run : available "ntfs3g"; then
+if ! guestfish add /dev/null : run : available "ntfs3g"; then
     echo "$0: skipped because ntfs-3g is not supported by the appliance"
     exit 77
 fi
@@ -41,14 +39,14 @@ if [ ! -s ../guests/windows.img ]; then
 fi
 
 # Export the filesystems to the backup file.
-$guestfish --ro -a ../guests/windows.img <<EOF
+guestfish --ro -a ../guests/windows.img <<EOF
 run
 ntfsclone-out /dev/sda1 ntfsclone-backup1 preservetimestamps:true force:true
 ntfsclone-out /dev/sda2 ntfsclone-backup2 metadataonly:true ignorefscheck:true
 EOF
 
 # Restore to another disk image.
-output=$($guestfish -N test-ntfsclone.img=part:300M <<EOF
+output=$(guestfish -N test-ntfsclone.img=part:300M <<EOF
 ntfsclone-in ntfsclone-backup1 /dev/sda1
 vfs-type /dev/sda1
 EOF
diff --git a/tests/protocol/test-both-ends-cancel.sh b/tests/protocol/test-both-ends-cancel.sh
index 7c489ca..6301186 100755
--- a/tests/protocol/test-both-ends-cancel.sh
+++ b/tests/protocol/test-both-ends-cancel.sh
@@ -22,7 +22,7 @@
 
 set -e
 
-../../fish/guestfish <<EOF
+guestfish <<EOF
 scratch 100M
 run
 -tar-in /tmp/nosuchfile /blah
diff --git a/tests/protocol/test-cancellation-download-librarycancels.sh b/tests/protocol/test-cancellation-download-librarycancels.sh
index 9b255ad..ddaa87d 100755
--- a/tests/protocol/test-cancellation-download-librarycancels.sh
+++ b/tests/protocol/test-cancellation-download-librarycancels.sh
@@ -31,7 +31,7 @@ tmpfile=`mktemp`
 size=$(awk 'BEGIN{ srand(); print int(16*1024*rand()) }')
 echo "$0: test size $size (bytes)"
 
-../../fish/guestfish <<EOF
+guestfish <<EOF
 # We want the file to be fully allocated.
 alloc $tmpfile 10M
 run
diff --git a/tests/protocol/test-cancellation-upload-daemoncancels.sh b/tests/protocol/test-cancellation-upload-daemoncancels.sh
index a5364c7..f6de479 100755
--- a/tests/protocol/test-cancellation-upload-daemoncancels.sh
+++ b/tests/protocol/test-cancellation-upload-daemoncancels.sh
@@ -22,7 +22,7 @@
 
 set -e
 
-../../fish/guestfish \
+guestfish \
     -N test-cancellation-upload-daemoncancels.img=fs:ext2:10M \
     -m /dev/sda1 <<'EOF'
 # Upload image, daemon should cancel because the image is too large
diff --git a/tests/protocol/test-qemudie-killsub.sh b/tests/protocol/test-qemudie-killsub.sh
index 928cbef..45e8b2d 100755
--- a/tests/protocol/test-qemudie-killsub.sh
+++ b/tests/protocol/test-qemudie-killsub.sh
@@ -20,12 +20,12 @@
 
 set -e
 
-if [ "$(../../fish/guestfish get-backend)" != "direct" ]; then
+if [ "$(guestfish get-backend)" != "direct" ]; then
     echo "$0: test skipped because default backend is not 'direct'"
     exit 77
 fi
 
-../../fish/guestfish <<'EOF'
+guestfish <<'EOF'
 scratch 100M
 run
 # Kill the subprocess.
diff --git a/tests/protocol/test-qemudie-midcommand.sh b/tests/protocol/test-qemudie-midcommand.sh
index ac41fb2..058df2c 100755
--- a/tests/protocol/test-qemudie-midcommand.sh
+++ b/tests/protocol/test-qemudie-midcommand.sh
@@ -20,14 +20,14 @@
 
 set -e
 
-if [ "$(../../fish/guestfish get-backend)" != "direct" ]; then
+if [ "$(guestfish get-backend)" != "direct" ]; then
     echo "$0: test skipped because default backend is not 'direct'"
     exit 77
 fi
 
 rm -f qemudie-midcommand.pid
 
-../../fish/guestfish <<'EOF'
+guestfish <<'EOF'
 scratch 100M
 run
 # Kill the subprocess after a short wait.
diff --git a/tests/protocol/test-qemudie-synch.sh b/tests/protocol/test-qemudie-synch.sh
index e9431a3..a7066ed 100755
--- a/tests/protocol/test-qemudie-synch.sh
+++ b/tests/protocol/test-qemudie-synch.sh
@@ -20,14 +20,14 @@
 
 set -e
 
-if [ "$(../../fish/guestfish get-backend)" != "direct" ]; then
+if [ "$(guestfish get-backend)" != "direct" ]; then
     echo "$0: test skipped because default backend is not 'direct'"
     exit 77
 fi
 
 rm -f qemudie-synch.pid
 
-../../fish/guestfish <<'EOF'
+guestfish <<'EOF'
 scratch 100M
 run
 # Kill subprocess.
diff --git a/tests/qemu/qemu-force-tcg.sh b/tests/qemu/qemu-force-tcg.sh
index 90d7683..79b32b7 100755
--- a/tests/qemu/qemu-force-tcg.sh
+++ b/tests/qemu/qemu-force-tcg.sh
@@ -24,7 +24,7 @@ if [ -n "$SKIP_QEMU_FORCE_TCG_SH" ]; then
 fi
 
 # Only applicable to the direct and libvirt backends:
-if [ "$(../../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: skipping test because it is only applicable when qemu is being used."
     exit 77
 fi
@@ -33,7 +33,7 @@ set -e
 
 rm -f qemu-force-tcg.out
 
-../../fish/guestfish -a /dev/null <<EOF
+guestfish -a /dev/null <<EOF
 set-backend-setting force_tcg 1
 run
 debug sh "cat /sys/devices/system/clocksource/clocksource0/current_clocksource" | cat > qemu-force-tcg.out
diff --git a/tests/qemu/qemu-liveness.sh b/tests/qemu/qemu-liveness.sh
index fe8396a..4db71bd 100755
--- a/tests/qemu/qemu-liveness.sh
+++ b/tests/qemu/qemu-liveness.sh
@@ -24,10 +24,10 @@ set -e
 
 rm -f liveness1.img
 
-../../fish/guestfish sparse liveness1.img 100M
+guestfish sparse liveness1.img 100M
 liveness1_md5sum="$(md5sum liveness1.img | awk '{print $1}')"
 
-../../fish/guestfish <<'EOF'
+guestfish <<'EOF'
 add liveness1.img format:raw
 run
 
diff --git a/tests/qemu/qemu-snapshot-isolation.sh b/tests/qemu/qemu-snapshot-isolation.sh
index 82b3892..daa210f 100755
--- a/tests/qemu/qemu-snapshot-isolation.sh
+++ b/tests/qemu/qemu-snapshot-isolation.sh
@@ -22,23 +22,21 @@
 
 set -e
 
-guestfish=../../fish/guestfish
-
 # UML backend doesn't support qcow2 format.
 supports_qcow2=yes
-if [ "$($guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     supports_qcow2=no
 fi
 
 rm -f isolation1.img isolation2.img isolation3.img
 
-../../fish/guestfish sparse isolation1.img 100M
+guestfish sparse isolation1.img 100M
 isolation1_md5sum="$(md5sum isolation1.img | awk '{print $1}')"
-../../fish/guestfish sparse isolation2.img 100M
+guestfish sparse isolation2.img 100M
 isolation2_md5sum="$(md5sum isolation2.img | awk '{print $1}')"
 
 if [ "$supports_qcow2" = "yes" ]; then
-    ../../fish/guestfish \
+    guestfish \
         disk-create isolation3.img qcow2 100M preallocation:metadata
     isolation3_md5sum="$(md5sum isolation3.img | awk '{print $1}')"
     add3="add-drive-opts isolation3.img format:qcow2 readonly:true"
@@ -53,7 +51,7 @@ fi
 
 # The vitally important calls are 'add-drive-ro' and
 # 'add-drive-opts ... readonly:true'.
-../../fish/guestfish <<EOF
+guestfish <<EOF
 add-drive-ro isolation1.img
 add-drive-opts isolation2.img format:raw readonly:true
 $add3
diff --git a/tests/regressions/rhbz1001875.sh b/tests/regressions/rhbz1001875.sh
index 1d16873..885fd8c 100755
--- a/tests/regressions/rhbz1001875.sh
+++ b/tests/regressions/rhbz1001875.sh
@@ -30,7 +30,7 @@ fi
 
 rm -f rhbz1001875.img rhbz1001875-[123].tar
 
-../../fish/guestfish -N rhbz1001875.img=fs -m /dev/sda1 <<EOF
+guestfish -N rhbz1001875.img=fs -m /dev/sda1 <<EOF
 touch /hello
 touch /world
 touch /helloworld
diff --git a/tests/regressions/rhbz1044014.sh b/tests/regressions/rhbz1044014.sh
index ce1be76..8e0df2a 100755
--- a/tests/regressions/rhbz1044014.sh
+++ b/tests/regressions/rhbz1044014.sh
@@ -28,7 +28,7 @@ if [ -n "$SKIP_TEST_RHBZ1044014_SH" ]; then
 fi
 
 # Check we are running against the libvirt backend.
-backend="$(../../fish/guestfish get-backend)"
+backend="$(guestfish get-backend)"
 if [[ ! ( "$backend" =~ ^libvirt ) ]]; then
     echo "$0: test skipped because backend ($backend) is not libvirt."
     exit 77
@@ -49,7 +49,7 @@ export LIBGUESTFS_BACKEND="libvirt:test://$(pwd)/$srcdir/rhbz1044014.xml"
 
 rm -f rhbz1044014.out
 
-../../fish/guestfish -- -run < $srcdir/rhbz1044014.in > rhbz1044014.out 2>&1 || {
+guestfish -- -run < $srcdir/rhbz1044014.in > rhbz1044014.out 2>&1 || {
     r=$?
     if [ $r -ne 0 ]; then
         cat rhbz1044014.out
diff --git a/tests/regressions/rhbz1054761.sh b/tests/regressions/rhbz1054761.sh
index f7f49df..344479d 100755
--- a/tests/regressions/rhbz1054761.sh
+++ b/tests/regressions/rhbz1054761.sh
@@ -30,14 +30,14 @@ fi
 
 rm -f rhbz1054761-[ab].img
 
-../../fish/guestfish -N rhbz1054761-a.img=disk -N rhbz1054761-b.img=disk <<EOF
+guestfish -N rhbz1054761-a.img=disk -N rhbz1054761-b.img=disk <<EOF
 pvcreate /dev/sda
 pvcreate /dev/sdb
 vgcreate VG "/dev/sda /dev/sdb"
 EOF
 
 output="$(
-    ../../fish/guestfish -a rhbz1054761-a.img run : pvs |
+    guestfish -a rhbz1054761-a.img run : pvs |
         sed -r 's,^/dev/[abce-ln-z]+d,/dev/sd,'
 )"
 if [ "$output" != "/dev/sda" ]; then
diff --git a/tests/regressions/rhbz1091803.sh b/tests/regressions/rhbz1091803.sh
index e9be95d..6851a1c 100755
--- a/tests/regressions/rhbz1091803.sh
+++ b/tests/regressions/rhbz1091803.sh
@@ -28,7 +28,7 @@ if [ -n "$SKIP_TEST_RHBZ1091803_SH" ]; then
     exit 77
 fi
 
-../../fish/guestfish <<EOF
+guestfish <<EOF
 scratch 100M
 run
 mkfs ext2 /dev/sda
diff --git a/tests/regressions/rhbz503169c13.sh b/tests/regressions/rhbz503169c13.sh
index 44ff2d9..b0ee77b 100755
--- a/tests/regressions/rhbz503169c13.sh
+++ b/tests/regressions/rhbz503169c13.sh
@@ -26,7 +26,7 @@
 
 set -e
 
-../../fish/guestfish -N rhbz503169c13.img=fs -m /dev/sda1 <<EOF
+guestfish -N rhbz503169c13.img=fs -m /dev/sda1 <<EOF
 mkdir /dev
 -command /ignore-this-error
 unmount-all
diff --git a/tests/regressions/rhbz557655.sh b/tests/regressions/rhbz557655.sh
index 87eb279..fd723bf 100755
--- a/tests/regressions/rhbz557655.sh
+++ b/tests/regressions/rhbz557655.sh
@@ -24,7 +24,7 @@ set -e
 rm -f rhbz557655.out rhbz557655.err
 export LANG=C
 
-../../fish/guestfish >> rhbz557655.out 2>> rhbz557655.err <<EOF
+guestfish >> rhbz557655.out 2>> rhbz557655.err <<EOF
 # set-memsize is just a convenient non-daemon function that
 # takes a single integer argument.
 set-memsize 500
@@ -46,7 +46,7 @@ get-memsize
 -set-memsize 123L
 EOF
 
-../../fish/guestfish -N rhbz557655.img=fs -m /dev/sda1 >> rhbz557655.out 2>> rhbz557655.err <<EOF
+guestfish -N rhbz557655.img=fs -m /dev/sda1 >> rhbz557655.out 2>> rhbz557655.err <<EOF
 touch /test
 
 # truncate-size takes an Int64 argument
diff --git a/tests/regressions/rhbz563450.sh b/tests/regressions/rhbz563450.sh
index 96fca8c..d7cf751 100755
--- a/tests/regressions/rhbz563450.sh
+++ b/tests/regressions/rhbz563450.sh
@@ -29,7 +29,7 @@ fi
 
 rm -f test.out
 
-../../fish/guestfish --ro > test.out <<EOF
+guestfish --ro > test.out <<EOF
 add-drive-ro ../guests/fedora.img
 add-cdrom ../data/test.iso
 add-drive-ro ../guests/debian.img
diff --git a/tests/regressions/rhbz563450b.sh b/tests/regressions/rhbz563450b.sh
index 7b890b1..26aaf6f 100755
--- a/tests/regressions/rhbz563450b.sh
+++ b/tests/regressions/rhbz563450b.sh
@@ -29,7 +29,7 @@ fi
 
 rm -f test.out
 
-../../fish/guestfish --ro > test.out <<EOF
+guestfish --ro > test.out <<EOF
 add-cdrom ../data/test.iso
 
 run
diff --git a/tests/regressions/rhbz576879.sh b/tests/regressions/rhbz576879.sh
index 2e803af..fece6b4 100755
--- a/tests/regressions/rhbz576879.sh
+++ b/tests/regressions/rhbz576879.sh
@@ -22,7 +22,7 @@
 
 set -e
 
-../../fish/guestfish <<EOF
+guestfish <<EOF
 scratch 100M
 run
 -upload $srcdir/rhbz576879.sh /test.sh
diff --git a/tests/regressions/rhbz578407.sh b/tests/regressions/rhbz578407.sh
index 5fe2cc1..fb7ba93 100755
--- a/tests/regressions/rhbz578407.sh
+++ b/tests/regressions/rhbz578407.sh
@@ -23,21 +23,19 @@
 
 set -e
 
-guestfish=../../fish/guestfish
-
 # Start remote guestfish.
-eval `$guestfish --listen 2>/dev/null`
+eval `guestfish --listen 2>/dev/null`
 
 # This should succeed.
-$guestfish --remote version > /dev/null
+guestfish --remote version > /dev/null
 
 # This command will fail (because appliance not launched), but
 # prefixing with '-' should make remote guestfish ignore the failure.
-$guestfish --remote -- -lvs
+guestfish --remote -- -lvs
 
 # Remote guestfish should still be running.
-$guestfish --remote version > /dev/null
-$guestfish --remote exit
+guestfish --remote version > /dev/null
+guestfish --remote exit
 
 # Try some other command line argument tests which are related the fix.
-$guestfish -- version : -lvs : version > /dev/null 2>&1
+guestfish -- version : -lvs : version > /dev/null 2>&1
diff --git a/tests/regressions/rhbz580246.sh b/tests/regressions/rhbz580246.sh
index 5ab8e19..218dd96 100755
--- a/tests/regressions/rhbz580246.sh
+++ b/tests/regressions/rhbz580246.sh
@@ -29,7 +29,7 @@ dd if=/dev/zero of=rhbz580246.img bs=1M count=2
 tar cf rhbz580246.tar rhbz580246.img
 
 output=$(
-../../fish/guestfish 2>&1 <<'EOF'
+guestfish 2>&1 <<'EOF'
 add rhbz580246.img
 run
 mkfs ext2 /dev/sda
diff --git a/tests/regressions/rhbz602997.sh b/tests/regressions/rhbz602997.sh
index 2231fe7..d48693b 100755
--- a/tests/regressions/rhbz602997.sh
+++ b/tests/regressions/rhbz602997.sh
@@ -22,11 +22,9 @@
 set -e
 export LANG=C
 
-guestfish=../../fish/guestfish
-
 rm -f test.output
 
-$guestfish > test.output <<EOF
+guestfish > test.output <<EOF
 scratch 100M
 run
 part-init /dev/sda mbr
@@ -48,7 +46,7 @@ false" ]; then
     exit 1
 fi
 
-$guestfish > test.output <<EOF
+guestfish > test.output <<EOF
 scratch 100M
 run
 part-init /dev/sda mbr
diff --git a/tests/regressions/rhbz690819.sh b/tests/regressions/rhbz690819.sh
index 5b29813..0af0b64 100755
--- a/tests/regressions/rhbz690819.sh
+++ b/tests/regressions/rhbz690819.sh
@@ -38,7 +38,7 @@ if [[ "$arch" =~ ^ppc ]]; then
     exit 77
 fi
 
-backend="$(../../fish/guestfish get-backend)"
+backend="$(guestfish get-backend)"
 if [[ "$backend" =~ ^libvirt ]]; then
     echo "$0: test skipped because backend ($backend) is 'libvirt'."
     exit 77
@@ -51,9 +51,9 @@ fi
 
 rm -f rhbz690819.img
 
-../../fish/guestfish sparse rhbz690819.img 100M
+guestfish sparse rhbz690819.img 100M
 
-../../fish/guestfish <<EOF
+guestfish <<EOF
 add-drive-with-if rhbz690819.img ide
 run
 mkfs ext3 /dev/sda
diff --git a/tests/regressions/rhbz727178.sh b/tests/regressions/rhbz727178.sh
index 90b5994..639fc32 100755
--- a/tests/regressions/rhbz727178.sh
+++ b/tests/regressions/rhbz727178.sh
@@ -23,20 +23,19 @@
 set -e
 export LANG=C
 
-guestfish=../../fish/guestfish
 output=rhbz727178.output
 
 rm -f binaries.tmp $output
 
-eval `$guestfish -a /dev/null --listen`
+eval `guestfish -a /dev/null --listen`
 
-$guestfish --remote -- run
-$guestfish --remote -- debug binaries "" |
+guestfish --remote -- run
+guestfish --remote -- debug binaries "" |
     grep -E '^/(bin|sbin|usr/bin|usr/sbin|usr/libexec)/' > binaries.tmp
 
 while read ex; do
     echo ldd $ex
-    $guestfish --remote -- -debug ldd $ex
+    guestfish --remote -- -debug ldd $ex
 done < binaries.tmp > $output
 
 if grep -E '\bnot found\b|undefined symbol' $output; then
diff --git a/tests/regressions/rhbz789960.sh b/tests/regressions/rhbz789960.sh
index ac66c4a..056b7ed 100755
--- a/tests/regressions/rhbz789960.sh
+++ b/tests/regressions/rhbz789960.sh
@@ -24,7 +24,7 @@ export LANG=C
 
 rm -f test.out
 
-../../fish/guestfish -a ../guests/fedora.img --ro > test.out <<EOF
+guestfish -a ../guests/fedora.img --ro > test.out <<EOF
 run
 
 # Not a device at all, should fail.
diff --git a/tests/regressions/rhbz811649.sh b/tests/regressions/rhbz811649.sh
index cfc7298..d48d2bf 100755
--- a/tests/regressions/rhbz811649.sh
+++ b/tests/regressions/rhbz811649.sh
@@ -36,11 +36,11 @@ filenames[9]='raw:'
 
 rm -f -- rhbz811649.img "${filenames[@]}"
 
-../../fish/guestfish sparse rhbz811649.img 10M
+guestfish sparse rhbz811649.img 10M
 
 for f in "${filenames[@]}"; do
     ln -- rhbz811649.img "$f"
-    ../../fish/guestfish <<EOF
+    guestfish <<EOF
 add "$f"
 run
 EOF
diff --git a/tests/regressions/rhbz895904.sh b/tests/regressions/rhbz895904.sh
index f239986..fb7dae9 100755
--- a/tests/regressions/rhbz895904.sh
+++ b/tests/regressions/rhbz895904.sh
@@ -25,7 +25,7 @@ export LANG=C
 
 rm -f rhbz895904.img rhbz895904.out
 
-../../fish/guestfish -N rhbz895904.img=fs -m /dev/sda1 <<EOF | sort -k 3 > rhbz895904.out
+guestfish -N rhbz895904.img=fs -m /dev/sda1 <<EOF | sort -k 3 > rhbz895904.out
 mkdir /test
 touch /test/file1
 mkdir /test/subdir
diff --git a/tests/regressions/rhbz909624.sh b/tests/regressions/rhbz909624.sh
index a2e93e4..ad419b9 100755
--- a/tests/regressions/rhbz909624.sh
+++ b/tests/regressions/rhbz909624.sh
@@ -26,7 +26,7 @@
 set -e
 export LANG=C
 
-../../fish/guestfish <<EOF
+guestfish <<EOF
 
 add-ro /dev/null
 run
diff --git a/tests/regressions/rhbz957772.sh b/tests/regressions/rhbz957772.sh
index d06d47e..553cab8 100755
--- a/tests/regressions/rhbz957772.sh
+++ b/tests/regressions/rhbz957772.sh
@@ -23,7 +23,7 @@
 set -e
 export LANG=C
 
-../../fish/guestfish -N rhbz957772.img=fs -m /dev/sda1 <<EOF
+guestfish -N rhbz957772.img=fs -m /dev/sda1 <<EOF
 mkdir "/test 1"
 touch "/test 2"
 tar-out "/test 1" /dev/null
diff --git a/tests/regressions/rhbz975797.sh b/tests/regressions/rhbz975797.sh
index cc66438..ebd23ea 100755
--- a/tests/regressions/rhbz975797.sh
+++ b/tests/regressions/rhbz975797.sh
@@ -38,7 +38,7 @@ if [[ "$arch" =~ ^ppc ]]; then
     exit 77
 fi
 
-backend="$(../../fish/guestfish get-backend)"
+backend="$(guestfish get-backend)"
 if [[ "$backend" =~ ^libvirt ]]; then
     echo "$0: test skipped because backend ($backend) is 'libvirt'."
     exit 77
@@ -58,11 +58,11 @@ fi
 
 # Use real disk images here since the code for adding /dev/null may
 # take shortcuts.
-../../fish/guestfish sparse rhbz975797-1.img 1G
-../../fish/guestfish sparse rhbz975797-2.img 1G
-../../fish/guestfish sparse rhbz975797-3.img 1G
+guestfish sparse rhbz975797-1.img 1G
+guestfish sparse rhbz975797-2.img 1G
+guestfish sparse rhbz975797-3.img 1G
 
-$timeout ../../fish/guestfish <<EOF
+$timeout guestfish <<EOF
 add-drive rhbz975797-1.img iface:virtio
 add-drive rhbz975797-2.img iface:ide
 add-drive rhbz975797-3.img
diff --git a/tests/relative-paths/test-relative-paths.sh b/tests/relative-paths/test-relative-paths.sh
index 67d3181..4924cc3 100755
--- a/tests/relative-paths/test-relative-paths.sh
+++ b/tests/relative-paths/test-relative-paths.sh
@@ -25,7 +25,7 @@ fi
 
 # UML doesn't support qcow2.  Conceivably there might be a similar
 # problem with UML COW images which would require a separate test.
-if [ "$(../../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: skipping test because uml backend does not support qcow2"
     exit 77
 fi
@@ -115,7 +115,7 @@ popd
 # codepaths in most backends, so we should test each separately.
 for ro in readonly:true readonly:false; do
     for prefix in "./" "" "$(pwd)/"; do
-        $VG ../../fish/guestfish <<EOF
+        $VG guestfish <<EOF
             add-drive ${prefix}overlay1            $ro format:qcow2
             add-drive ${prefix}overlay2            $ro format:qcow2
             add-drive ${prefix}overlay3            $ro format:qcow2
diff --git a/tests/rsync/test-rsync.sh b/tests/rsync/test-rsync.sh
index 6e792e4..793d59d 100755
--- a/tests/rsync/test-rsync.sh
+++ b/tests/rsync/test-rsync.sh
@@ -22,8 +22,6 @@
 unset CDPATH
 set -e
 
-guestfish=../../fish/guestfish
-
 if [ -n "$SKIP_TEST_RSYNC_SH" ]; then
     echo "$0: test skipped because environment variable is set."
     exit 77
@@ -35,13 +33,13 @@ if ! rsync --help >/dev/null 2>&1; then
     exit 77
 fi
 
-if [ "$($guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: skipping test because networking is not available in the UML backend"
     exit 77
 fi
 
 # If rsync is not available, bail.
-if ! $guestfish -a /dev/null run : available rsync; then
+if ! guestfish -a /dev/null run : available rsync; then
     echo "$0: skipping test because rsync is not available in the appliance"
     exit 77
 fi
@@ -86,7 +84,7 @@ trap cleanup INT TERM QUIT EXIT
 ip=169.254.2.2
 user="$(id -un)"
 
-$guestfish --network -N test-rsync.img=fs -m /dev/sda1 <<EOF
+guestfish --network -N test-rsync.img=fs -m /dev/sda1 <<EOF
 mkdir /dir1
 rsync-in "rsync://$user@$ip:$port/src/" /dir1/ archive:true
 mkdir /dir2
diff --git a/v2v/test-v2v-i-disk.sh b/v2v/test-v2v-i-disk.sh
index dbf6f94..b15e0d0 100755
--- a/v2v/test-v2v-i-disk.sh
+++ b/v2v/test-v2v-i-disk.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_I_DISK_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -48,7 +48,7 @@ d=test-v2v-i-disk.d
 rm -rf $d
 mkdir $d
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i disk $f \
     -o local -os $d
 
diff --git a/v2v/test-v2v-i-ova.sh b/v2v/test-v2v-i-ova.sh
index 59fd77b..a0e35a3 100755
--- a/v2v/test-v2v-i-ova.sh
+++ b/v2v/test-v2v-i-ova.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_I_OVA_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -68,7 +68,7 @@ tar -cf $ova $ovf $mf $vmdk
 rm -rf $ovf $mf $vmdk
 popd
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i ova $d/$ova \
     -o local -of raw -os $d
 
diff --git a/v2v/test-v2v-machine-readable.sh b/v2v/test-v2v-machine-readable.sh
index 5771d9e..3e94ae5 100755
--- a/v2v/test-v2v-machine-readable.sh
+++ b/v2v/test-v2v-machine-readable.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_MACHINE_READABLE_SH" ]; then
     exit 77
 fi
 
-$VG ./virt-v2v --debug-gc --machine-readable > test-v2v-machine-readable.out
+$VG virt-v2v --debug-gc --machine-readable > test-v2v-machine-readable.out
 grep virt-v2v test-v2v-machine-readable.out
 grep libguestfs-rewrite test-v2v-machine-readable.out
 
diff --git a/v2v/test-v2v-networks-and-bridges.sh b/v2v/test-v2v-networks-and-bridges.sh
index d7b7749..5974dcb 100755
--- a/v2v/test-v2v-networks-and-bridges.sh
+++ b/v2v/test-v2v-networks-and-bridges.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_NETWORKS_AND_BRIDGES_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -52,7 +52,7 @@ rm -rf $d
 mkdir $d
 
 # Use --no-copy because we only care about metadata for this test.
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i libvirt -ic "$libvirt_uri" windows \
     -o local -os $d --no-copy \
     --bridge "VM Network:bridge1" \
diff --git a/v2v/test-v2v-no-copy.sh b/v2v/test-v2v-no-copy.sh
index a7b97d0..35177c9 100755
--- a/v2v/test-v2v-no-copy.sh
+++ b/v2v/test-v2v-no-copy.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_NO_COPY_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -52,7 +52,7 @@ rm -rf $d
 mkdir $d
 
 # No copy with -o local.
-$VG ./virt-v2v --debug-gc --no-copy \
+$VG virt-v2v --debug-gc --no-copy \
     -i libvirt -ic "$libvirt_uri" windows \
     -o local -os $d
 
@@ -68,7 +68,7 @@ mkdir $d/12345678-1234-1234-1234-123456789abc/images
 mkdir $d/12345678-1234-1234-1234-123456789abc/master
 mkdir $d/12345678-1234-1234-1234-123456789abc/master/vms
 
-$VG ./virt-v2v --debug-gc --no-copy \
+$VG virt-v2v --debug-gc --no-copy \
     -i libvirt -ic "$libvirt_uri" windows \
     -o rhev -os $d
 
diff --git a/v2v/test-v2v-o-glance.sh b/v2v/test-v2v-o-glance.sh
index 4960f69..121177f 100755
--- a/v2v/test-v2v-o-glance.sh
+++ b/v2v/test-v2v-o-glance.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_O_GLANCE_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -51,7 +51,7 @@ fi
 # glance binary.
 ln -sf "$(which echo)" glance
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i libvirt -ic "$libvirt_uri" windows \
     -o glance -on test
 
diff --git a/v2v/test-v2v-o-libvirt.sh b/v2v/test-v2v-o-libvirt.sh
index 60f53c0..77b38e0 100755
--- a/v2v/test-v2v-o-libvirt.sh
+++ b/v2v/test-v2v-o-libvirt.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_O_LIBVIRT_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -66,7 +66,7 @@ mkdir $d
 virsh pool-destroy test-v2v-libvirt ||:
 virsh pool-create-as test-v2v-libvirt dir - - - - $(pwd)/$d
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i libvirt -ic "$libvirt_uri" windows \
     -o libvirt -os test-v2v-libvirt -on $guestname
 
diff --git a/v2v/test-v2v-o-null.sh b/v2v/test-v2v-o-null.sh
index 8b2c612..9ed581b 100755
--- a/v2v/test-v2v-o-null.sh
+++ b/v2v/test-v2v-o-null.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_O_NULL_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -47,6 +47,6 @@ if ! test -r $virt_tools_data_dir/rhsrvany.exe; then
     exit 77
 fi
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i libvirt -ic "$libvirt_uri" windows \
     -o null
diff --git a/v2v/test-v2v-o-rhev.sh b/v2v/test-v2v-o-rhev.sh
index 6dcbb1a..6d21320 100755
--- a/v2v/test-v2v-o-rhev.sh
+++ b/v2v/test-v2v-o-rhev.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_O_RHEV_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -57,7 +57,7 @@ mkdir $d/12345678-1234-1234-1234-123456789abc/images
 mkdir $d/12345678-1234-1234-1234-123456789abc/master
 mkdir $d/12345678-1234-1234-1234-123456789abc/master/vms
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i libvirt -ic "$libvirt_uri" windows \
     -o rhev -os $d
 
diff --git a/v2v/test-v2v-o-vdsm-options.sh b/v2v/test-v2v-o-vdsm-options.sh
index e5bf764..cf8fe06 100755
--- a/v2v/test-v2v-o-vdsm-options.sh
+++ b/v2v/test-v2v-o-vdsm-options.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_O_VDSM_OPTIONS_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -62,7 +62,7 @@ mkdir $d/12345678-1234-1234-1234-123456789abc/master/vms/VM
 # The --vdsm-*-uuid options don't actually check that the
 # parameter is a UUID, which is useful here.
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i libvirt -ic "$libvirt_uri" windows \
     -o vdsm -os $d \
     --vmtype desktop \
diff --git a/v2v/test-v2v-of-option.sh b/v2v/test-v2v-of-option.sh
index 07e7e63..27441cf 100755
--- a/v2v/test-v2v-of-option.sh
+++ b/v2v/test-v2v-of-option.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_OF_OPTION_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network or qcow2"
     exit 77
 fi
@@ -51,12 +51,12 @@ d=test-v2v-windows-conversion.d
 rm -rf $d
 mkdir $d
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i libvirt -ic "$libvirt_uri" windows \
     -o local -os $d -of qcow2
 
 # Test the disk is qcow2 format.
-if [ "$(../fish/guestfish disk-format $d/windows-sda)" != qcow2 ]; then
+if [ "$(guestfish disk-format $d/windows-sda)" != qcow2 ]; then
     echo "$0: test failed: output is not qcow2"
     exit 1
 fi
diff --git a/v2v/test-v2v-on-option.sh b/v2v/test-v2v-on-option.sh
index 0591e91..e3edb67 100755
--- a/v2v/test-v2v-on-option.sh
+++ b/v2v/test-v2v-on-option.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_ON_OPTION_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -51,7 +51,7 @@ d=test-v2v-windows-conversion.d
 rm -rf $d
 mkdir $d
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i libvirt -ic "$libvirt_uri" windows \
     -o local -os $d -on this-is-not-windows
 
diff --git a/v2v/test-v2v-print-source.sh b/v2v/test-v2v-print-source.sh
index 9cd96d6..a3baca7 100755
--- a/v2v/test-v2v-print-source.sh
+++ b/v2v/test-v2v-print-source.sh
@@ -40,7 +40,7 @@ d=test-v2v-print-source.d
 rm -rf $d
 mkdir $d
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i libvirt -ic "$libvirt_uri" windows \
     -o local -os $d \
     --print-source > $d/output
diff --git a/v2v/test-v2v-real-conversions.sh b/v2v/test-v2v-real-conversions.sh
index 9c1c281..e4e4a67 100755
--- a/v2v/test-v2v-real-conversions.sh
+++ b/v2v/test-v2v-real-conversions.sh
@@ -58,7 +58,7 @@ for file in *.img; do
 </domain>
 EOF
 
-      ./virt-v2v --debug-gc \
+      virt-v2v --debug-gc \
           -i libvirtxml $d/$n-input.xml \
           -o local -os $d
 
diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh
index 7525251..7e8e628 100755
--- a/v2v/test-v2v-windows-conversion.sh
+++ b/v2v/test-v2v-windows-conversion.sh
@@ -27,7 +27,7 @@ if [ -n "$SKIP_TEST_V2V_WINDOWS_CONVERSION_SH" ]; then
     exit 77
 fi
 
-if [ "$(../fish/guestfish get-backend)" = "uml" ]; then
+if [ "$(guestfish get-backend)" = "uml" ]; then
     echo "$0: test skipped because UML backend does not support network"
     exit 77
 fi
@@ -61,7 +61,7 @@ d=test-v2v-windows-conversion.d
 rm -rf $d
 mkdir $d
 
-$VG ./virt-v2v --debug-gc \
+$VG virt-v2v --debug-gc \
     -i libvirt -ic "$libvirt_uri" windows \
     -o local -os $d \
     --root $root
@@ -71,7 +71,7 @@ test -f $d/windows.xml
 test -f $d/windows-sda
 
 # Test some aspects of the target disk image.
-../fish/guestfish --ro -a $d/windows-sda -i <<EOF
+guestfish --ro -a $d/windows-sda -i <<EOF
   is-dir "/Program Files/Red Hat/Firstboot"
   is-file "/Program Files/Red Hat/Firstboot/firstboot.bat"
   is-dir "/Program Files/Red Hat/Firstboot/scripts"
-- 
2.0.4




More information about the Libguestfs mailing list