diff --git a/align/test-virt-alignment-scan-guests.sh b/align/test-virt-alignment-scan-guests.sh index 3647c2994..99e2585e9 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 2b1ec37b7..293a9effe 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 76d7913db..49daae736 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 6b839bbde..f974c27fe 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 f927a96c1..f357d123c 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 < test.out </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 f2e24cf4b..2a7ba32db 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 8c8e5d7ec..fbf09eaa2 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 8ed29e40f..299995078 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 5f04c101e..af6bb9500 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 55fc1140a..5bb4b8a80 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 623e6a26a..979e6f075 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 126b88006..b485cd777 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 6be90f8f3..6a69ceab0 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 3a3a1aaf8..fa1341140 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 <> /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 44188ed7d..0fcc7d162 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 test-a.out 2>&1 +$VG guestfish -x -a test-a.img 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 test-a.out 2>&1 +$VG guestfish -x --format=qcow2 -a test-a.img test-a.out 2>&1 grep -sq 'add_drive.*format:qcow2' test-a.out -$VG ./guestfish -x --ro --format=qcow2 -a test-a.img test-a.out 2>&1 +$VG guestfish -x --ro --format=qcow2 -a test-a.img test-a.out 2>&1 grep -sq 'add_drive.*readonly:true.*format:qcow2' test-a.out -$VG ./guestfish -x --format -a test-a.img test-a.out 2>&1 +$VG guestfish -x --format -a test-a.img 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 test-a.out 2>&1 +$VG guestfish -x -a test-a.img --format=raw -a /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 a6b0e1011..608d2de6c 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 < test-add-domain.xml < EOF -$VG ./guestfish >test-add-domain.out <test-add-domain.out <test-add-domain.out <test-add-domain.out <test-add-domain.out <test-add-domain.out <test-add-uri.out 2>&1 +$VG guestfish -x -a file://$(pwd)/test-add-uri.img 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 test-add-uri.out 2>&1 +$VG guestfish -x -a ftp://user@example.com/disk.img 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 test-add-uri.out 2>&1 +$VG guestfish -x -a gluster://example.com/disk 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 test-add-uri.out 2>&1 +$VG guestfish -x -a nbd://example.com 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 test-add-uri.out 2>&1 +$VG guestfish -x -a nbd://example.com:3000 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' test-add-uri.out 2>&1 +$VG guestfish -x -a 'nbd://?socket=/sk' 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' test-add-uri.out 2>&1 +$VG guestfish -x -a 'nbd:///export?socket=/sk' 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 test-add-uri.out 2>&1 +$VG guestfish -x -a rbd://example.com:6789/pool/disk 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 test-add-uri.out 2>&1 +$VG guestfish -x -a rbd:///pool/disk 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 test-add-uri.out 2>&1 +$VG guestfish -x -a sheepdog:///volume/image 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 test-add-uri.out 2>&1 +$VG guestfish -x -a sheepdog://example.com:3000/volume/image 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 test-add-uri.out 2>&1 +$VG guestfish -x -a ssh://example.com/disk.img 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 test-add-uri.out 2>&1 +$VG guestfish -x -a ssh://user@example.com/disk.img 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 test-add-uri.out 2>&1 +$VG guestfish -x -a ssh://user@example.com:2000/disk.img 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 3f46f8b4f..98f8f4ea9 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 ecf5a4f22..f72de9ba1 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 < test-d.xml < test-d.xml < 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 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 9d7ab9d7b..92426170c 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 <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 18e503fea..3f65164a0 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 78bd817a1..55d602cee 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 < test.out < test-glob.out < test-glob.out <test-mount-local.errors <test-mount-local.errors < 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 a3a13b14e..c05f072ab 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 442d9277c..28df68291 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 a6b52892f..d8966d49c 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 ec6e0d390..a66ad9ca3 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 416c09251..ab23cb965 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 a2bf1faba..ca4af737a 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 6e3f00900..0bacd755d 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 71cc8026b..2383c71cd 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 008e980c3..e7891225f 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 f46c29c5a..13d1bd3c8 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 < "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 a05ef9fd4..2ed3ce91d 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 2f66c7cfa..f4d28d10f 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 c3f5d9113..f79e4f83c 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 29c1e4c2e..9a1c24ff8 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 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 8193af0e5..10ba1d1f5 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 5d1b714d2..7ec96d0ad 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 620660963..9e396a419 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 < 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 5d8e8b23a..2f6575032 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 < 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 04ee9d16d..f31ec2e5c 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 9f54182e9..2bfa6f353 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 < list-fs.output +guestfish < 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 511f6beee..5a9cbe814 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 < 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 b248b01eb..3b81fd09f 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 test.output +guestfish -a test.qcow2 -i <<'EOF' > test.output inspect-get-roots | head -1 > root.tmp qemu-force-tcg.out diff --git a/tests/qemu/qemu-liveness.sh b/tests/qemu/qemu-liveness.sh index fe8396a31..4db71bd58 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 82b3892f8..daa210f2d 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 < 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 f7f49df94..344479d6d 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 <> rhbz557655.out 2>> rhbz557655.err <> rhbz557655.out 2>> rhbz557655.err <> rhbz557655.out 2>> rhbz557655.err <> rhbz557655.out 2>> rhbz557655.err < test.out < test.out < test.out < test.out </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 5ab8e19fe..218dd961a 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 2231fe79f..d48693b22 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 < test.output < test.output < test.output < 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 ac66c4a78..056b7ed00 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 < test.out < rhbz895904.out +guestfish -N rhbz895904.img=fs -m /dev/sda1 < rhbz895904.out mkdir /test touch /test/file1 mkdir /test/subdir diff --git a/tests/regressions/rhbz909624.sh b/tests/regressions/rhbz909624.sh index a2e93e4ea..ad419b93a 100755 --- a/tests/regressions/rhbz909624.sh +++ b/tests/regressions/rhbz909624.sh @@ -26,7 +26,7 @@ set -e export LANG=C -../../fish/guestfish </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 < 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 d7b774990..5974dcb9b 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 a7b97d0b0..35177c947 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 4960f695d..121177fd5 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 60f53c0d3..77b38e090 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 8b2c612f8..9ed581b74 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 6dcbb1a05..6d2132080 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 dac17f388..8747d8a85 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 07e7e633d..27441cfbc 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 0591e91c8..e3edb675d 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 9cd96d62d..a3baca76e 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 9c1c28112..e4e4a6741 100755 --- a/v2v/test-v2v-real-conversions.sh +++ b/v2v/test-v2v-real-conversions.sh @@ -58,7 +58,7 @@ for file in *.img; do 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 7525251ce..7e8e62840 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 <