diff --git a/.gitignore b/.gitignore index 8f3ecff98..27f4a585d 100644 --- a/.gitignore +++ b/.gitignore @@ -544,42 +544,9 @@ Makefile.in /tests/c-api/test*.tmp /tests/c-api/test-user-cancel /tests/charsets/test-charset-fidelity -/tests/data/100kallnewlines -/tests/data/100kallspaces -/tests/data/100kallzeroes -/tests/data/100krandom -/tests/data/10klines -/tests/data/abssymlink -/tests/data/bin-x86_64-dynamic.gz -/tests/data/blank-disk-* -/tests/data/blank-disk-* -/tests/data/hello.b64 -/tests/data/initrd -/tests/data/initrd-x86_64.img -/tests/data/initrd-x86_64.img.gz -/tests/data/lib-i586.so.xz -/tests/data/test-grep.txt.gz -/tests/data/test.iso /tests/daemon/captive-daemon.pm /tests/disks/test-qemu-drive-libvirt.xml /tests/events/test-libvirt-auth-callbacks -/tests/guests/blank-*.img -/tests/guests/debian.img -/tests/guests/fedora.img -/tests/guests/fedora-btrfs.img -/tests/guests/fedora-md1.img -/tests/guests/fedora-md2.img -/tests/guests/guests.xml -/tests/guests/guests-all-good.xml -/tests/guests/guest-aux/fedora-name.db -/tests/guests/guest-aux/fedora-packages.db -/tests/guests/guest-aux/windows-software -/tests/guests/guest-aux/windows-system -/tests/guests/stamp-fedora-md.img -/tests/guests/ubuntu.img -/tests/guests/archlinux.img -/tests/guests/coreos.img -/tests/guests/windows.img /tests/mount-local/test-parallel-mount-local /tests/mountable/test-internal-parse-mountable /tests/parallel/test-parallel @@ -595,6 +562,38 @@ Makefile.in /tests/rsync/rsyncd.pid /tests/syslinux/extlinux-guest.img /tests/syslinux/syslinux-guest.img +/test-data/test.iso +/test-data/blank-disks/blank-disk-* +/test-data/files/100kallnewlines +/test-data/files/100kallspaces +/test-data/files/100kallzeroes +/test-data/files/100krandom +/test-data/files/10klines +/test-data/files/abssymlink +/test-data/files/bin-x86_64-dynamic.gz +/test-data/files/hello.b64 +/test-data/files/initrd +/test-data/files/initrd-x86_64.img +/test-data/files/initrd-x86_64.img.gz +/test-data/files/lib-i586.so.xz +/test-data/files/test-grep.txt.gz +/test-data/phony-guests/archlinux.img +/test-data/phony-guests/blank-*.img +/test-data/phony-guests/coreos.img +/test-data/phony-guests/debian.img +/test-data/phony-guests/fedora.img +/test-data/phony-guests/fedora-btrfs.img +/test-data/phony-guests/fedora-md1.img +/test-data/phony-guests/fedora-md2.img +/test-data/phony-guests/fedora-name.db +/test-data/phony-guests/fedora-packages.db +/test-data/phony-guests/guests.xml +/test-data/phony-guests/guests-all-good.xml +/test-data/phony-guests/stamp-fedora-md.img +/test-data/phony-guests/ubuntu.img +/test-data/phony-guests/windows.img +/test-data/phony-guests/windows-software +/test-data/phony-guests/windows-system /test-tool/libguestfs-test-tool /test-tool/libguestfs-test-tool.1 /test-tool/libguestfs-test-tool-helper diff --git a/.x-sc_TAB_in_indentation b/.x-sc_TAB_in_indentation index 5e36276e0..cc2644e89 100644 --- a/.x-sc_TAB_in_indentation +++ b/.x-sc_TAB_in_indentation @@ -1,4 +1,4 @@ -^tests/data/ +^test-data/ ^COPYING(.LIB)?$ ^\.gitmodules$ (^|\/)ChangeLog[^/]*$ diff --git a/.x-sc_trailing_blank b/.x-sc_trailing_blank index 148e6aa2d..806e3f172 100644 --- a/.x-sc_trailing_blank +++ b/.x-sc_trailing_blank @@ -1,2 +1,2 @@ -tests/data/bin-win64.exe +test-data/binaries/bin-win64.exe *.pod diff --git a/Makefile.am b/Makefile.am index 4b3cab334..089dfcb70 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,7 +26,7 @@ SUBDIRS += gnulib/tests endif # Basic source for the library. -SUBDIRS += tests/data generator src docs examples po +SUBDIRS += generator src docs examples po if ENABLE_DAEMON SUBDIRS += daemon @@ -39,7 +39,6 @@ endif # Tests - order is important. if ENABLE_APPLIANCE SUBDIRS += tests/qemu -SUBDIRS += tests/guests SUBDIRS += tests/c-api SUBDIRS += tests/tmpdirs SUBDIRS += tests/protocol @@ -150,6 +149,9 @@ if HAVE_TOOLS SUBDIRS += tools endif +# Files and other test data used by the tests (must come after fish, perl). +SUBDIRS += test-data + # guestmount if HAVE_FUSE SUBDIRS += fuse @@ -350,7 +352,7 @@ dist-hook: all-local: cd $(srcdir); \ find $(DIST_SUBDIRS) -name '*.c' -o -name '*.pl' -o -name '*.pm' | \ - grep -v -E '^(examples|gnulib|perl/(blib|examples)|po-docs|tests)/' | \ + grep -v -E '^(examples|gnulib|perl/(blib|examples)|po-docs|tests|test-data)/' | \ grep -v -E '/((guestfs|rc)_protocol\.c)$$' | \ grep -v -E '^python/utils.c$$' | \ LC_ALL=C sort > po/POTFILES @@ -522,7 +524,7 @@ check-slow: build-test-guests exit $$(( $$errors ? 1 : 0 )) build-test-guests: - $(MAKE) -C tests/guests check + $(MAKE) -C test-data/phony-guests check # Print subdirs. # diff --git a/align/test-virt-alignment-scan-guests.sh b/align/test-virt-alignment-scan-guests.sh index 99e2585e9..3481752f2 100755 --- a/align/test-virt-alignment-scan-guests.sh +++ b/align/test-virt-alignment-scan-guests.sh @@ -23,7 +23,7 @@ if [ -n "$SKIP_TEST_VIRT_ALIGNMENT_SCAN_GUESTS_SH" ]; then exit 77 fi -guestsdir="$(cd ../tests/guests && pwd)" +guestsdir="$(cd ../test-data/phony-guests && pwd)" libvirt_uri="test://$guestsdir/guests-all-good.xml" $VG virt-alignment-scan -c "$libvirt_uri" diff --git a/align/test-virt-alignment-scan.sh b/align/test-virt-alignment-scan.sh index 293a9effe..7568f2326 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 ../test-data/phony-guests/fedora.img r=$? # 0, 2 and 3 are reasonable non-error exit codes. Others are errors. diff --git a/builder/Makefile.am b/builder/Makefile.am index 8ab5b9ded..1591150fe 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -226,14 +226,14 @@ CLEANFILES += stamp-virt-builder.pod TESTS_ENVIRONMENT = $(top_builddir)/run --test disk_images := \ - $(shell for f in debian fedora ubuntu windows; do if [ -s "../tests/guests/$$f.img" ]; then echo $$f.xz; fi; done) \ - $(shell if [ -s "../tests/guests/fedora.img" ]; then echo fedora.qcow2 fedora.qcow2.xz; fi) + $(shell for f in debian fedora ubuntu windows; do if [ -s "../test-data/phony-guests/$$f.img" ]; then echo $$f.xz; fi; done) \ + $(shell if [ -s "../test-data/phony-guests/fedora.img" ]; then echo fedora.qcow2 fedora.qcow2.xz; fi) CLEANFILES += *.qcow2 *.xz check_DATA = $(disk_images) -fedora.qcow2: ../tests/guests/fedora.img +fedora.qcow2: ../test-data/phony-guests/fedora.img rm -f $@ $@-t qemu-img convert -f raw -O qcow2 $< $@-t mv $@-t $@ @@ -243,7 +243,7 @@ fedora.qcow2.xz: fedora.qcow2 xz --best -c $< > $@-t mv $@-t $@ -%.xz: ../tests/guests/%.img +%.xz: ../test-data/phony-guests/%.img rm -f $@ $@-t xz --best -c $< > $@-t mv $@-t $@ diff --git a/cat/test-virt-cat.sh b/cat/test-virt-cat.sh index 0fcd98db3..08ab31c27 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 ../test-data/phony-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 ../test-data/phony-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 b2f3b482f..ff9a0fabc 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 ../test-data/phony-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 ../test-data/phony-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 aff994aea..04c3e4103 100755 --- a/cat/test-virt-log.sh +++ b/cat/test-virt-log.sh @@ -35,7 +35,7 @@ can_handle () tmpfile=`mktemp` # Read out the log files from the image using virt-log. -for f in ../tests/guests/{fedora,debian,ubuntu}.img; do +for f in ../test-data/phony-guests/{fedora,debian,ubuntu}.img; do echo "Trying $f ..." if [ ! -s "$f" ]; then echo "SKIP: empty file" diff --git a/cat/test-virt-ls.sh b/cat/test-virt-ls.sh index 5bb4b8a80..4ea800864 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 ../test-data/phony-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 ../test-data/phony-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 ../test-data/phony-guests/fedora.img / +$VG virt-ls -R ../test-data/phony-guests/fedora.img / diff --git a/cfg.mk b/cfg.mk index 8d40aa25d..4cb307abb 100644 --- a/cfg.mk +++ b/cfg.mk @@ -29,7 +29,7 @@ exclude_file_name_regexp--sc_bindtextdomain = ^(daemon|erlang|examples|tests)/|/ exclude_file_name_regexp--sc_error_message_period = ^(generator|php|po-docs)/ exclude_file_name_regexp--sc_prohibit_always-defined_macros = ^examples/|^tests/xml/fake-libvirt-xml\.c|^daemon/guestfsd\.c exclude_file_name_regexp--sc_prohibit_doubled_word = ^po/ -exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/data/|\.patch$|\.png$|^tests/guests/guest-aux/debian-packages|^tests/guests/guest-aux/minimal-hive +exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^test-data/|\.patch$|\.png$ exclude_file_name_regexp--sc_prohibit_magic_number_exit = ^(po|po-docs)/|\.pod$|^fuse/guestunmount\.c exclude_file_name_regexp--sc_prohibit_strcmp = ^(examples|po-docs)/|\.pod$ exclude_file_name_regexp--sc_prohibit_strcmp_and_strncmp = ^(examples|po-docs)/|\.pod$ diff --git a/configure.ac b/configure.ac index 2a5d5a142..a79965297 100644 --- a/configure.ac +++ b/configure.ac @@ -155,8 +155,7 @@ mkdir -p \ appliance/supermin.d \ java/t \ ocaml/html \ - ocaml/t \ - tests/guests/guest-aux + ocaml/t dnl http://www.mail-archive.com/automake@gnu.org/msg10204.html AC_CONFIG_FILES([appliance/libguestfs-make-fixed-appliance], @@ -248,6 +247,12 @@ AC_CONFIG_FILES([Makefile src/Makefile src/libguestfs.pc sysprep/Makefile + test-data/Makefile + test-data/binaries/Makefile + test-data/blank-disks/Makefile + test-data/files/Makefile + test-data/phony-guests/Makefile + test-data/phony-guests/guests.xml test-tool/Makefile tests/9p/Makefile tests/bigdirs/Makefile @@ -255,7 +260,6 @@ AC_CONFIG_FILES([Makefile tests/c-api/Makefile tests/charsets/Makefile tests/create/Makefile - tests/data/Makefile tests/daemon/Makefile tests/daemon/captive-daemon.pm tests/discard/Makefile @@ -264,8 +268,6 @@ AC_CONFIG_FILES([Makefile tests/disk-labels/Makefile tests/events/Makefile tests/fuzz/Makefile - tests/guests/Makefile - tests/guests/guests.xml tests/hotplug/Makefile tests/http/Makefile tests/journal/Makefile diff --git a/customize/test-virt-customize.sh b/customize/test-virt-customize.sh index 979e6f075..00d1978b3 100755 --- a/customize/test-virt-customize.sh +++ b/customize/test-virt-customize.sh @@ -22,7 +22,7 @@ set -e # virt-customize with the -n option doesn't modify the guest. It ought # to be able to customize any of our Linux-like test guests. -for f in ../tests/guests/{debian,fedora,ubuntu}.img; do +for f in ../test-data/phony-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. diff --git a/df/test-virt-df-guests.sh b/df/test-virt-df-guests.sh index b485cd777..68c381eb3 100755 --- a/df/test-virt-df-guests.sh +++ b/df/test-virt-df-guests.sh @@ -26,7 +26,7 @@ if [ -n "$SKIP_TEST_VIRT_DF_GUESTS_SH" ]; then exit 77 fi -guestsdir="$(cd ../tests/guests && pwd)" +guestsdir="$(cd ../test-data/phony-guests && pwd)" libvirt_uri="test://$guestsdir/guests.xml" $VG virt-df -c "$libvirt_uri" diff --git a/df/test-virt-df.sh b/df/test-virt-df.sh index a776c4cf0..ef80651a6 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 ../test-data/phony-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 fa1341140..d15804377 100755 --- a/diff/test-virt-diff.sh +++ b/diff/test-virt-diff.sh @@ -19,7 +19,7 @@ export LANG=C set -e -if [ ! -f ../tests/guests/fedora.img ]; then +if [ ! -f ../test-data/phony-guests/fedora.img ]; then echo "$0: test skipped because there is no phony fedora test image" exit 77 fi @@ -34,14 +34,14 @@ rm -f fedora.qcow2 # Modify a copy of the image. guestfish -- \ disk-create fedora.qcow2 qcow2 -1 \ - backingfile:../tests/guests/fedora.img backingformat:raw + backingfile:../test-data/phony-guests/fedora.img backingformat:raw guestfish -a fedora.qcow2 -i < test.out -add-ro ../tests/data/test.iso +add-ro ../test-data/test.iso run mount-ro /dev/sda / read-file /helloworld.tar EOF -cmp $srcdir/../tests/data/helloworld.tar test.out +cmp $srcdir/../test-data/files/helloworld.tar test.out rm -f test.out diff --git a/fish/test-run.sh b/fish/test-run.sh index a66ad9ca3..aa137fc41 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 ../test-data/phony-guests/fedora.img run diff --git a/fish/test-upload-to-dir.sh b/fish/test-upload-to-dir.sh index 0bacd755d..a62df64eb 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 ../test-data/test.iso / 2>test-upload-to-dir.out then echo "$0: expecting guestfish to return an error" exit 1 diff --git a/fuse/test-fuse-umount-race.sh b/fuse/test-fuse-umount-race.sh index a1f21ae76..e10a244af 100755 --- a/fuse/test-fuse-umount-race.sh +++ b/fuse/test-fuse-umount-race.sh @@ -38,7 +38,7 @@ if [ ! -w /dev/fuse ]; then exit 77 fi -if [ ! -f ../tests/guests/fedora.img ]; then +if [ ! -f ../test-data/phony-guests/fedora.img ]; then echo "$0: test skipped because fedora.img test guest does not exist." exit 77 fi @@ -54,7 +54,7 @@ rm -rf mp # Make a copy of the Fedora image so we can write to it then discard it. guestfish -- \ disk-create test.qcow2 qcow2 -1 \ - backingfile:../tests/guests/fedora.img backingformat:raw + backingfile:../test-data/phony-guests/fedora.img backingformat:raw mkdir mp ./guestmount -a test.qcow2 -m /dev/VG/Root --pid-file test.pid mp diff --git a/fuse/test-guestmount-fd.c b/fuse/test-guestmount-fd.c index f8fe09257..f3456d94d 100644 --- a/fuse/test-guestmount-fd.c +++ b/fuse/test-guestmount-fd.c @@ -35,7 +35,7 @@ #define GUESTMOUNT_BINARY "./guestmount" #define GUESTUNMOUNT_BINARY "./guestunmount" -#define TEST_IMAGE "../tests/guests/fedora.img" +#define TEST_IMAGE "../test-data/phony-guests/fedora.img" #define MOUNTPOINT "test-guestmount-fd.d" #define TEST_FILE MOUNTPOINT "/etc/fstab" diff --git a/generator/actions.ml b/generator/actions.ml index d8af08d6f..f185974c5 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -2779,19 +2779,19 @@ data." }; style = RString "format", [String "filename"], []; tests = [ InitEmpty, Always, TestResultString ( - [["disk_format"; "../data/blank-disk-1s.raw"]], "raw"), []; + [["disk_format"; "../../test-data/blank-disks/blank-disk-1s.raw"]], "raw"), []; InitEmpty, Always, TestResultString ( - [["disk_format"; "../data/blank-disk-1s.qcow2"]], "qcow2"), []; + [["disk_format"; "../../test-data/blank-disks/blank-disk-1s.qcow2"]], "qcow2"), []; InitEmpty, Always, TestResultString ( - [["disk_format"; "../data/blank-disk-1K.raw"]], "raw"), []; + [["disk_format"; "../../test-data/blank-disks/blank-disk-1K.raw"]], "raw"), []; InitEmpty, Always, TestResultString ( - [["disk_format"; "../data/blank-disk-1K.qcow2"]], "qcow2"), []; + [["disk_format"; "../../test-data/blank-disks/blank-disk-1K.qcow2"]], "qcow2"), []; InitEmpty, Always, TestResultString ( - [["disk_format"; "../data/blank-disk-1M.raw"]], "raw"), []; + [["disk_format"; "../../test-data/blank-disks/blank-disk-1M.raw"]], "raw"), []; InitEmpty, Always, TestResultString ( - [["disk_format"; "../data/blank-disk-1M.qcow2"]], "qcow2"), []; + [["disk_format"; "../../test-data/blank-disks/blank-disk-1M.qcow2"]], "qcow2"), []; InitEmpty, Always, TestResultString ( - [["disk_format"; "../data/blank-disk-with-backing.qcow2"]], "qcow2"), []; + [["disk_format"; "../../test-data/blank-disks/blank-disk-with-backing.qcow2"]], "qcow2"), []; ]; shortdesc = "detect the disk format of a disk image"; longdesc = "\ @@ -2809,19 +2809,19 @@ See also: L" }; style = RInt64 "size", [String "filename"], []; tests = [ InitEmpty, Always, TestResult ( - [["disk_virtual_size"; "../data/blank-disk-1s.raw"]], "ret == 512"), []; + [["disk_virtual_size"; "../../test-data/blank-disks/blank-disk-1s.raw"]], "ret == 512"), []; InitEmpty, Always, TestResult ( - [["disk_virtual_size"; "../data/blank-disk-1s.qcow2"]], "ret == 512"), []; + [["disk_virtual_size"; "../../test-data/blank-disks/blank-disk-1s.qcow2"]], "ret == 512"), []; InitEmpty, Always, TestResult ( - [["disk_virtual_size"; "../data/blank-disk-1K.raw"]], "ret == 1024"), []; + [["disk_virtual_size"; "../../test-data/blank-disks/blank-disk-1K.raw"]], "ret == 1024"), []; InitEmpty, Always, TestResult ( - [["disk_virtual_size"; "../data/blank-disk-1K.qcow2"]], "ret == 1024"), []; + [["disk_virtual_size"; "../../test-data/blank-disks/blank-disk-1K.qcow2"]], "ret == 1024"), []; InitEmpty, Always, TestResult ( - [["disk_virtual_size"; "../data/blank-disk-1M.raw"]], "ret == 1024*1024"), []; + [["disk_virtual_size"; "../../test-data/blank-disks/blank-disk-1M.raw"]], "ret == 1024*1024"), []; InitEmpty, Always, TestResult ( - [["disk_virtual_size"; "../data/blank-disk-1M.qcow2"]], "ret == 1024*1024"), []; + [["disk_virtual_size"; "../../test-data/blank-disks/blank-disk-1M.qcow2"]], "ret == 1024*1024"), []; InitEmpty, Always, TestResult ( - [["disk_virtual_size"; "../data/blank-disk-with-backing.qcow2"]], "ret == 1024*1024"), []; + [["disk_virtual_size"; "../../test-data/blank-disks/blank-disk-with-backing.qcow2"]], "ret == 1024*1024"), []; ]; shortdesc = "return virtual size of a disk"; longdesc = "\ @@ -2836,19 +2836,19 @@ circumstances. See L." }; style = RBool "backingfile", [String "filename"], []; tests = [ InitEmpty, Always, TestResultFalse ( - [["disk_has_backing_file"; "../data/blank-disk-1s.raw"]]), []; + [["disk_has_backing_file"; "../../test-data/blank-disks/blank-disk-1s.raw"]]), []; InitEmpty, Always, TestResultFalse ( - [["disk_has_backing_file"; "../data/blank-disk-1s.qcow2"]]), []; + [["disk_has_backing_file"; "../../test-data/blank-disks/blank-disk-1s.qcow2"]]), []; InitEmpty, Always, TestResultFalse ( - [["disk_has_backing_file"; "../data/blank-disk-1K.raw"]]), []; + [["disk_has_backing_file"; "../../test-data/blank-disks/blank-disk-1K.raw"]]), []; InitEmpty, Always, TestResultFalse ( - [["disk_has_backing_file"; "../data/blank-disk-1K.qcow2"]]), []; + [["disk_has_backing_file"; "../../test-data/blank-disks/blank-disk-1K.qcow2"]]), []; InitEmpty, Always, TestResultFalse ( - [["disk_has_backing_file"; "../data/blank-disk-1M.raw"]]), []; + [["disk_has_backing_file"; "../../test-data/blank-disks/blank-disk-1M.raw"]]), []; InitEmpty, Always, TestResultFalse ( - [["disk_has_backing_file"; "../data/blank-disk-1M.qcow2"]]), []; + [["disk_has_backing_file"; "../../test-data/blank-disks/blank-disk-1M.qcow2"]]), []; InitEmpty, Always, TestResultTrue ( - [["disk_has_backing_file"; "../data/blank-disk-with-backing.qcow2"]]), []; + [["disk_has_backing_file"; "../../test-data/blank-disks/blank-disk-with-backing.qcow2"]]), []; ]; shortdesc = "return whether disk has a backing file"; longdesc = "\ @@ -4856,15 +4856,15 @@ To get the checksums for many files, use C." }; tests = [ InitScratchFS, Always, TestResultString ( [["mkdir"; "/tar_in"]; - ["tar_in"; "$srcdir/../data/helloworld.tar"; "/tar_in"; "NOARG"; ""; ""; ""]; + ["tar_in"; "$srcdir/../../test-data/files/helloworld.tar"; "/tar_in"; "NOARG"; ""; ""; ""]; ["cat"; "/tar_in/hello"]], "hello\n"), []; InitScratchFS, Always, TestResultString ( [["mkdir"; "/tar_in_gz"]; - ["tar_in"; "$srcdir/../data/helloworld.tar.gz"; "/tar_in_gz"; "gzip"; ""; ""; ""]; + ["tar_in"; "$srcdir/../../test-data/files/helloworld.tar.gz"; "/tar_in_gz"; "gzip"; ""; ""; ""]; ["cat"; "/tar_in_gz/hello"]], "hello\n"), []; InitScratchFS, IfAvailable "xz", TestResultString ( [["mkdir"; "/tar_in_xz"]; - ["tar_in"; "$srcdir/../data/helloworld.tar.xz"; "/tar_in_xz"; "xz"; ""; ""; ""]; + ["tar_in"; "$srcdir/../../test-data/files/helloworld.tar.xz"; "/tar_in_xz"; "xz"; ""; ""; ""]; ["cat"; "/tar_in_xz/hello"]], "hello\n"), [] ]; shortdesc = "unpack tarfile to directory"; @@ -4951,7 +4951,7 @@ If set to true, POSIX ACLs are saved in the output tar. tests = [ InitScratchFS, Always, TestResultString ( [["mkdir"; "/tgz_in"]; - ["tgz_in"; "$srcdir/../data/helloworld.tar.gz"; "/tgz_in"]; + ["tgz_in"; "$srcdir/../../test-data/files/helloworld.tar.gz"; "/tgz_in"]; ["cat"; "/tgz_in/hello"]], "hello\n"), [] ]; shortdesc = "unpack compressed tarball to directory"; @@ -8303,7 +8303,7 @@ or growing unnecessarily." }; tests = [ InitScratchFS, Always, TestResultString ( [["mkdir"; "/txz_in"]; - ["txz_in"; "$srcdir/../data/helloworld.tar.xz"; "/txz_in"]; + ["txz_in"; "$srcdir/../../test-data/files/helloworld.tar.xz"; "/txz_in"]; ["cat"; "/txz_in/hello"]], "hello\n"), [] ]; shortdesc = "unpack compressed tarball to directory"; @@ -8415,7 +8415,7 @@ types (see C)." }; tests = [ InitISOFS, Always, TestResult ( [["checksum_device"; "md5"; "/dev/sdd"]], - "check_file_md5 (ret, \"../data/test.iso\") == 0"), [] + "check_file_md5 (ret, \"../../test-data/test.iso\") == 0"), [] ]; shortdesc = "compute MD5, SHAx or CRC checksum of the contents of a device"; longdesc = "\ @@ -8489,7 +8489,7 @@ to find out what it is for." }; cancellable = true; tests = [ InitScratchFS, Always, TestResultString ( - [["base64_in"; "../data/hello.b64"; "/base64_in"]; + [["base64_in"; "../../test-data/files/hello.b64"; "/base64_in"]; ["cat"; "/base64_in"]], "hello\n"), [] ]; shortdesc = "upload base64-encoded data to file"; @@ -10937,7 +10937,7 @@ C calls." }; optional = Some "hivex"; tests = [ InitScratchFS, Always, TestRun ( - [["upload"; "$srcdir/../data/minimal"; "/hivex_open"]; + [["upload"; "$srcdir/../../test-data/files/minimal"; "/hivex_open"]; ["hivex_open"; "/hivex_open"; ""; ""; "false"]; ["hivex_root"]; (* in this hive, it returns 0x1020 *) ["hivex_node_name"; "0x1020"]; @@ -11085,11 +11085,11 @@ See also: C." }; optional = Some "hivex"; tests = [ InitScratchFS, Always, TestRun ( - [["upload"; "$srcdir/../data/minimal"; "/hivex_commit1"]; + [["upload"; "$srcdir/../../test-data/files/minimal"; "/hivex_commit1"]; ["hivex_open"; "/hivex_commit1"; ""; ""; "true"]; ["hivex_commit"; "NULL"]]), [["hivex_close"]]; InitScratchFS, Always, TestResultTrue ( - [["upload"; "$srcdir/../data/minimal"; "/hivex_commit2"]; + [["upload"; "$srcdir/../../test-data/files/minimal"; "/hivex_commit2"]; ["hivex_open"; "/hivex_commit2"; ""; ""; "true"]; ["hivex_commit"; "/hivex_commit2_copy"]; ["is_file"; "/hivex_commit2_copy"; "false"]]), [["hivex_close"]] diff --git a/gobject/tests-misc.js b/gobject/tests-misc.js index a97da240c..b17dda655 100644 --- a/gobject/tests-misc.js +++ b/gobject/tests-misc.js @@ -39,7 +39,7 @@ g.connect('trace', function(session, params) { } }); -g.add_drive('../tests/guests/fedora.img', null); +g.add_drive('../test-data/phony-guests/fedora.img', null); g.set_trace(true); g.launch(); // Fake progress messages for a 5 second event. We do this as launch() will not diff --git a/inspector/test-virt-inspector.sh b/inspector/test-virt-inspector.sh index 02bbcad0c..92237d50f 100755 --- a/inspector/test-virt-inspector.sh +++ b/inspector/test-virt-inspector.sh @@ -29,7 +29,7 @@ fi # ntfs-3g can't set UUIDs right now, so ignore just that . diff_ignore="-I [0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]" -for f in ../tests/guests/{debian,fedora,ubuntu,archlinux,coreos,windows}.img; do +for f in ../test-data/phony-guests/{debian,fedora,ubuntu,archlinux,coreos,windows}.img; do # Ignore zero-sized windows.img if ntfs-3g is not installed. if [ -s "$f" ]; then b=$(basename "$f" .xml) @@ -43,5 +43,5 @@ done # We could also test this image, but mdadm is problematic for # many users. # $VG virt-inspector \ -# -a ../tests/guests/fedora-md1.img \ -# -a ../tests/guests/fedora-md2.img +# -a ../test-data/phony-guests/fedora-md1.img \ +# -a ../test-data/phony-guests/fedora-md2.img diff --git a/p2v/test-virt-p2v-pxe.sh b/p2v/test-virt-p2v-pxe.sh index f05cb9655..422d46f5f 100755 --- a/p2v/test-virt-p2v-pxe.sh +++ b/p2v/test-virt-p2v-pxe.sh @@ -55,7 +55,7 @@ if ! test -f $img; then exit 77 fi -guestsdir="$(cd ../tests/guests && pwd)" +guestsdir="$(cd ../test-data/phony-guests && pwd)" f="$guestsdir/windows.img" if ! test -f $f; then echo "$0: test skipped because phony Windows image was not created" diff --git a/p2v/test-virt-p2v.sh b/p2v/test-virt-p2v.sh index 540d2fd2e..fa5ccc09d 100755 --- a/p2v/test-virt-p2v.sh +++ b/p2v/test-virt-p2v.sh @@ -32,7 +32,7 @@ if [ "$(guestfish get-backend)" = "uml" ]; then exit 77 fi -guestsdir="$(cd ../tests/guests && pwd)" +guestsdir="$(cd ../test-data/phony-guests && pwd)" f1="$guestsdir/windows.img" if ! test -f $f1 || ! test -s $f1; then echo "$0: test skipped because phony Windows image was not created" diff --git a/python/run-python-tests b/python/run-python-tests index 7786e52b6..08ef4e379 100755 --- a/python/run-python-tests +++ b/python/run-python-tests @@ -18,7 +18,7 @@ errors=0 -guestsdir="$(cd ../tests/guests && pwd)" +guestsdir="$(cd ../test-data/phony-guests && pwd)" export guestsdir for f in $srcdir/t/*.py; do diff --git a/rescue/test-virt-rescue-suggest.sh b/rescue/test-virt-rescue-suggest.sh index f79e4f83c..fda14742b 100755 --- a/rescue/test-virt-rescue-suggest.sh +++ b/rescue/test-virt-rescue-suggest.sh @@ -19,7 +19,7 @@ export LANG=C set -e -guest=../tests/guests/fedora.img +guest=../test-data/phony-guests/fedora.img if [ ! -s "$guest" ]; then echo "$0: test skipped because $guest does not exist or is an empty file" diff --git a/sysprep/test-virt-sysprep-passwords.sh b/sysprep/test-virt-sysprep-passwords.sh index b5189c888..ba34b0c5d 100755 --- a/sysprep/test-virt-sysprep-passwords.sh +++ b/sysprep/test-virt-sysprep-passwords.sh @@ -26,7 +26,7 @@ if [ "$(guestfish get-backend)" = "uml" ]; then exit 77 fi -if [ ! -s ../tests/guests/fedora.img ]; then +if [ ! -s ../test-data/phony-guests/fedora.img ]; then echo "$0: skipping test because there is no phony Fedora test image" exit 77 fi @@ -37,7 +37,7 @@ fi rm -f passwords.qcow2 password guestfish -- \ disk-create passwords.qcow2 qcow2 -1 \ - backingfile:../tests/guests/fedora.img backingformat:raw + backingfile:../test-data/phony-guests/fedora.img backingformat:raw guestfish -a passwords.qcow2 -i <<'EOF' write-append /etc/shadow "test01::15677:0:99999:7:::\n" diff --git a/sysprep/test-virt-sysprep-script.sh b/sysprep/test-virt-sysprep-script.sh index 10ba1d1f5..409a9b766 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 ../test-data/phony-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 ../test-data/phony-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 ../test-data/phony-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 ../test-data/phony-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 14cd49262..e9dd9a9b3 100755 --- a/sysprep/test-virt-sysprep.sh +++ b/sysprep/test-virt-sysprep.sh @@ -37,7 +37,7 @@ echo # virt-sysprep with the -n option doesn't modify the guest. It ought # to be able to sysprep any of our test guests. -for f in ../tests/guests/{debian,fedora,ubuntu,windows}.img; do +for f in ../test-data/phony-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 ..." @@ -49,5 +49,5 @@ done # We could also test this image, but mdadm is problematic for # many users. # $VG virt-sysprep -q -n \ -# -a ../tests/guests/fedora-md1.img \ -# -a ../tests/guests/fedora-md2.img +# -a ../test-data/phony-guests/fedora-md1.img \ +# -a ../test-data/phony-guests/fedora-md2.img diff --git a/test-data/Makefile.am b/test-data/Makefile.am new file mode 100644 index 000000000..3afbd7166 --- /dev/null +++ b/test-data/Makefile.am @@ -0,0 +1,99 @@ +# libguestfs test images +# Copyright (C) 2009-2015 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +include $(top_srcdir)/subdir-rules.mk + +SUBDIRS = binaries +SUBDIRS += blank-disks +if ENABLE_APPLIANCE +SUBDIRS += phony-guests +endif +SUBDIRS += files +SUBDIRS += . + +# Build an ISO containing various files from the subdirectories, which +# is used by tests/c-api and a few guestfish tests and regression +# tests. + +image_files = \ + $(srcdir)/binaries/bin-aarch64-dynamic \ + $(srcdir)/binaries/bin-armv7-dynamic \ + $(srcdir)/binaries/bin-i586-dynamic \ + $(srcdir)/binaries/bin-ia64-dynamic \ + $(srcdir)/binaries/bin-mipsel-dynamic \ + $(srcdir)/binaries/bin-ppc64-dynamic \ + $(srcdir)/binaries/bin-ppc64le-dynamic \ + $(srcdir)/binaries/bin-sparc-dynamic \ + $(srcdir)/binaries/bin-win32.exe \ + $(srcdir)/binaries/bin-win64.exe \ + $(srcdir)/binaries/bin-x86_64-dynamic \ + $(srcdir)/binaries/lib-aarch64.so \ + $(srcdir)/binaries/lib-armv7.so \ + $(srcdir)/binaries/lib-i586.so \ + $(srcdir)/binaries/lib-ia64.so \ + $(srcdir)/binaries/lib-mipsel.so \ + $(srcdir)/binaries/lib-ppc64.so \ + $(srcdir)/binaries/lib-ppc64le.so \ + $(srcdir)/binaries/lib-sparc.so \ + $(srcdir)/binaries/lib-win32.dll \ + $(srcdir)/binaries/lib-win64.dll \ + $(srcdir)/binaries/lib-x86_64.so \ + $(srcdir)/files/helloworld.tar \ + $(srcdir)/files/helloworld.tar.gz \ + $(srcdir)/files/helloworld.tar.xz \ + $(srcdir)/files/empty \ + $(srcdir)/files/known-1 \ + $(srcdir)/files/known-2 \ + $(srcdir)/files/known-3 \ + $(srcdir)/files/known-4 \ + $(srcdir)/files/known-5 \ + $(srcdir)/files/test-grep.txt \ + $(srcdir)/files/minimal \ + blank-disks/blank-disk-1s.raw \ + blank-disks/blank-disk-1s.qcow2 \ + blank-disks/blank-disk-1K.raw \ + blank-disks/blank-disk-1K.qcow2 \ + blank-disks/blank-disk-1M.raw \ + blank-disks/blank-disk-1M.qcow2 \ + blank-disks/blank-disk-with-backing.qcow2 \ + files/100kallzeroes \ + files/100kallnewlines \ + files/100kallspaces \ + files/100krandom \ + files/10klines \ + files/bin-x86_64-dynamic.gz \ + files/hello.b64 \ + files/initrd \ + files/initrd-x86_64.img \ + files/initrd-x86_64.img.gz \ + files/lib-i586.so.xz \ + files/test-grep.txt.gz + +noinst_DATA = test.iso + +CLEANFILES = test.iso + +test.iso: $(images_files) + rm -rf d + rm -f $@ $@-t + mkdir d + cp $(image_files) d/ + mkdir -p d/directory + cd d && ln -sf /10klines abssymlink + cd d && $(GENISOIMAGE) -J -r -o ../$@-t . + rm -rf d + mv $@-t $@ diff --git a/test-data/binaries/Makefile.am b/test-data/binaries/Makefile.am new file mode 100644 index 000000000..44c3894b9 --- /dev/null +++ b/test-data/binaries/Makefile.am @@ -0,0 +1,43 @@ +# libguestfs test images +# Copyright (C) 2009-2015 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +include $(top_srcdir)/subdir-rules.mk + +EXTRA_DIST = \ + README \ + bin-aarch64-dynamic \ + bin-armv7-dynamic \ + bin-i586-dynamic \ + bin-ia64-dynamic \ + bin-mipsel-dynamic \ + bin-ppc64-dynamic \ + bin-ppc64le-dynamic \ + bin-sparc-dynamic \ + bin-win32.exe \ + bin-win64.exe \ + bin-x86_64-dynamic \ + lib-aarch64.so \ + lib-armv7.so \ + lib-i586.so \ + lib-ia64.so \ + lib-ppc64.so \ + lib-ppc64le.so \ + lib-mipsel.so \ + lib-sparc.so \ + lib-win32.dll \ + lib-win64.dll \ + lib-x86_64.so diff --git a/tests/data/README-binfiles b/test-data/binaries/README similarity index 100% rename from tests/data/README-binfiles rename to test-data/binaries/README diff --git a/tests/data/bin-aarch64-dynamic b/test-data/binaries/bin-aarch64-dynamic similarity index 100% rename from tests/data/bin-aarch64-dynamic rename to test-data/binaries/bin-aarch64-dynamic diff --git a/tests/data/bin-armv7-dynamic b/test-data/binaries/bin-armv7-dynamic similarity index 100% rename from tests/data/bin-armv7-dynamic rename to test-data/binaries/bin-armv7-dynamic diff --git a/tests/data/bin-i586-dynamic b/test-data/binaries/bin-i586-dynamic similarity index 100% rename from tests/data/bin-i586-dynamic rename to test-data/binaries/bin-i586-dynamic diff --git a/tests/data/bin-ia64-dynamic b/test-data/binaries/bin-ia64-dynamic similarity index 100% rename from tests/data/bin-ia64-dynamic rename to test-data/binaries/bin-ia64-dynamic diff --git a/tests/data/bin-mipsel-dynamic b/test-data/binaries/bin-mipsel-dynamic similarity index 100% rename from tests/data/bin-mipsel-dynamic rename to test-data/binaries/bin-mipsel-dynamic diff --git a/tests/data/bin-ppc64-dynamic b/test-data/binaries/bin-ppc64-dynamic similarity index 100% rename from tests/data/bin-ppc64-dynamic rename to test-data/binaries/bin-ppc64-dynamic diff --git a/tests/data/bin-ppc64le-dynamic b/test-data/binaries/bin-ppc64le-dynamic similarity index 100% rename from tests/data/bin-ppc64le-dynamic rename to test-data/binaries/bin-ppc64le-dynamic diff --git a/tests/data/bin-sparc-dynamic b/test-data/binaries/bin-sparc-dynamic similarity index 100% rename from tests/data/bin-sparc-dynamic rename to test-data/binaries/bin-sparc-dynamic diff --git a/tests/data/bin-win32.exe b/test-data/binaries/bin-win32.exe similarity index 100% rename from tests/data/bin-win32.exe rename to test-data/binaries/bin-win32.exe diff --git a/tests/data/bin-win64.exe b/test-data/binaries/bin-win64.exe similarity index 100% rename from tests/data/bin-win64.exe rename to test-data/binaries/bin-win64.exe diff --git a/tests/data/bin-x86_64-dynamic b/test-data/binaries/bin-x86_64-dynamic similarity index 100% rename from tests/data/bin-x86_64-dynamic rename to test-data/binaries/bin-x86_64-dynamic diff --git a/tests/data/lib-aarch64.so b/test-data/binaries/lib-aarch64.so similarity index 100% rename from tests/data/lib-aarch64.so rename to test-data/binaries/lib-aarch64.so diff --git a/tests/data/lib-armv7.so b/test-data/binaries/lib-armv7.so similarity index 100% rename from tests/data/lib-armv7.so rename to test-data/binaries/lib-armv7.so diff --git a/tests/data/lib-i586.so b/test-data/binaries/lib-i586.so similarity index 100% rename from tests/data/lib-i586.so rename to test-data/binaries/lib-i586.so diff --git a/tests/data/lib-ia64.so b/test-data/binaries/lib-ia64.so similarity index 100% rename from tests/data/lib-ia64.so rename to test-data/binaries/lib-ia64.so diff --git a/tests/data/lib-mipsel.so b/test-data/binaries/lib-mipsel.so similarity index 100% rename from tests/data/lib-mipsel.so rename to test-data/binaries/lib-mipsel.so diff --git a/tests/data/lib-ppc64.so b/test-data/binaries/lib-ppc64.so similarity index 100% rename from tests/data/lib-ppc64.so rename to test-data/binaries/lib-ppc64.so diff --git a/tests/data/lib-ppc64le.so b/test-data/binaries/lib-ppc64le.so similarity index 100% rename from tests/data/lib-ppc64le.so rename to test-data/binaries/lib-ppc64le.so diff --git a/tests/data/lib-sparc.so b/test-data/binaries/lib-sparc.so similarity index 100% rename from tests/data/lib-sparc.so rename to test-data/binaries/lib-sparc.so diff --git a/tests/data/lib-win32.dll b/test-data/binaries/lib-win32.dll similarity index 100% rename from tests/data/lib-win32.dll rename to test-data/binaries/lib-win32.dll diff --git a/tests/data/lib-win64.dll b/test-data/binaries/lib-win64.dll similarity index 100% rename from tests/data/lib-win64.dll rename to test-data/binaries/lib-win64.dll diff --git a/tests/data/lib-x86_64.so b/test-data/binaries/lib-x86_64.so similarity index 100% rename from tests/data/lib-x86_64.so rename to test-data/binaries/lib-x86_64.so diff --git a/test-data/blank-disks/Makefile.am b/test-data/blank-disks/Makefile.am new file mode 100644 index 000000000..365285a57 --- /dev/null +++ b/test-data/blank-disks/Makefile.am @@ -0,0 +1,56 @@ +# libguestfs test images +# Copyright (C) 2009-2015 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +include $(top_srcdir)/subdir-rules.mk + +files = \ + blank-disk-1s.raw \ + blank-disk-1s.qcow2 \ + blank-disk-1K.raw \ + blank-disk-1K.qcow2 \ + blank-disk-1M.raw \ + blank-disk-1M.qcow2 \ + blank-disk-with-backing.qcow2 + +noinst_DATA = $(files) + +CLEANFILES = $(files) + +# Blank disk images in various sizes and formats. +blank-disk-1s.raw: + rm -f $@ + $(top_builddir)/run guestfish sparse $@ 512 + +blank-disk-1s.qcow2: + qemu-img create -f qcow2 -o preallocation=metadata $@ 512 + +blank-disk-1K.raw: + rm -f $@ + $(top_builddir)/run guestfish sparse $@ 1K + +blank-disk-1K.qcow2: + qemu-img create -f qcow2 -o preallocation=metadata $@ 1K + +blank-disk-1M.raw: + rm -f $@ + $(top_builddir)/run guestfish sparse $@ 1M + +blank-disk-1M.qcow2: + qemu-img create -f qcow2 -o preallocation=metadata $@ 1M + +blank-disk-with-backing.qcow2: blank-disk-1M.raw + qemu-img create -f qcow2 -b $^ $@ diff --git a/test-data/files/Makefile.am b/test-data/files/Makefile.am new file mode 100644 index 000000000..58c2fa079 --- /dev/null +++ b/test-data/files/Makefile.am @@ -0,0 +1,116 @@ +# libguestfs test images +# Copyright (C) 2009-2015 Red Hat Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +include $(top_srcdir)/subdir-rules.mk + +EXTRA_DIST = \ + filesanddirs-10M.tar.xz \ + filesanddirs-100M.tar.xz \ + helloworld.tar \ + helloworld.tar.gz \ + helloworld.tar.xz \ + mbr-ext2-empty.img.gz \ + empty known-1 known-2 known-3 known-4 known-5 \ + test-grep.txt \ + minimal + +noinst_DATA = \ + 100kallzeroes \ + 100kallnewlines \ + 100kallspaces \ + 100krandom \ + 10klines \ + bin-x86_64-dynamic.gz \ + hello.b64 \ + initrd \ + initrd-x86_64.img \ + initrd-x86_64.img.gz \ + lib-i586.so.xz \ + test-grep.txt.gz + +100kallzeroes: + rm -f $@ $@-t + dd if=/dev/zero of=$@-t bs=1024 count=100 + mv $@-t $@ + +100kallnewlines: 100kallzeroes + rm -f $@ $@-t + tr '\0' '\n' < $< > $@-t + mv $@-t $@ + +100kallspaces: 100kallzeroes + rm -f $@ $@-t + tr '\0' ' ' < $< > $@-t + mv $@-t $@ + +100krandom: + rm -f $@ $@-t + dd if=/dev/urandom of=$@-t bs=1024 count=100 + mv $@-t $@ + +10klines: + rm -f $@ $@-t + i=0; \ + while [ $$i -lt 10000 ]; do \ + echo "$${i}abcdefghijklmnopqrstuvwxyz"; \ + i=$$(($$i+1)); \ + done > $@-t + mv $@-t $@ + +hello.b64: + echo "hello" | base64 > $@ + +# When builddir != srcdir, names like 'empty' are rewritten as +# '../../test-data/files/empty'. We need to copy the files into a fresh +# subdirectory in order to create the initrd correctly. +initrd: empty known-1 known-2 known-3 known-4 known-5 + rm -rf init.tmp $@ $@-t + mkdir -p init.tmp + cp $^ init.tmp + (cd init.tmp; ls -1 * | cpio -o -H newc | gzip --best) > $@-t + rm -r init.tmp + mv $@-t $@ + +# Create a dummy initrd with a single file called 'bin/nash' which +# is used to test the file_architecture function. +initrd-x86_64.img: $(top_srcdir)/test-data/binaries/bin-x86_64-dynamic + rm -rf bin $@ $@-t + mkdir bin + cp $< bin/nash + echo bin/nash | cpio -o -H newc > $@-t + mv $@-t $@ + rm -rf bin $@-t + +initrd-x86_64.img.gz: initrd-x86_64.img + rm -f $@ $@-t + gzip --best -c $< > $@-t + mv $@-t $@ + +test-grep.txt.gz: test-grep.txt + rm -f $@ $@-t + gzip --best -c $< > $@-t + mv $@-t $@ + +bin-x86_64-dynamic.gz: $(top_srcdir)/test-data/binaries/bin-x86_64-dynamic + rm -f $@ $@-t + gzip --best -c $< > $@-t + mv $@-t $@ + +lib-i586.so.xz: $(top_srcdir)/test-data/binaries/lib-i586.so + rm -f $@ $@-t + xz -c $< > $@-t + mv $@-t $@ diff --git a/tests/data/empty b/test-data/files/empty similarity index 100% rename from tests/data/empty rename to test-data/files/empty diff --git a/tests/data/filesanddirs-100M.tar.xz b/test-data/files/filesanddirs-100M.tar.xz similarity index 100% rename from tests/data/filesanddirs-100M.tar.xz rename to test-data/files/filesanddirs-100M.tar.xz diff --git a/tests/data/filesanddirs-10M.tar.xz b/test-data/files/filesanddirs-10M.tar.xz similarity index 100% rename from tests/data/filesanddirs-10M.tar.xz rename to test-data/files/filesanddirs-10M.tar.xz diff --git a/tests/data/helloworld.tar b/test-data/files/helloworld.tar similarity index 100% rename from tests/data/helloworld.tar rename to test-data/files/helloworld.tar diff --git a/tests/data/helloworld.tar.gz b/test-data/files/helloworld.tar.gz similarity index 100% rename from tests/data/helloworld.tar.gz rename to test-data/files/helloworld.tar.gz diff --git a/tests/data/helloworld.tar.xz b/test-data/files/helloworld.tar.xz similarity index 100% rename from tests/data/helloworld.tar.xz rename to test-data/files/helloworld.tar.xz diff --git a/tests/data/known-1 b/test-data/files/known-1 similarity index 100% rename from tests/data/known-1 rename to test-data/files/known-1 diff --git a/tests/data/known-2 b/test-data/files/known-2 similarity index 100% rename from tests/data/known-2 rename to test-data/files/known-2 diff --git a/tests/data/known-3 b/test-data/files/known-3 similarity index 100% rename from tests/data/known-3 rename to test-data/files/known-3 diff --git a/tests/data/known-4 b/test-data/files/known-4 similarity index 100% rename from tests/data/known-4 rename to test-data/files/known-4 diff --git a/tests/data/known-5 b/test-data/files/known-5 similarity index 100% rename from tests/data/known-5 rename to test-data/files/known-5 diff --git a/tests/data/mbr-ext2-empty.img.gz b/test-data/files/mbr-ext2-empty.img.gz similarity index 100% rename from tests/data/mbr-ext2-empty.img.gz rename to test-data/files/mbr-ext2-empty.img.gz diff --git a/tests/data/minimal b/test-data/files/minimal similarity index 100% rename from tests/data/minimal rename to test-data/files/minimal diff --git a/tests/data/test-grep.txt b/test-data/files/test-grep.txt similarity index 100% rename from tests/data/test-grep.txt rename to test-data/files/test-grep.txt diff --git a/tests/guests/Makefile.am b/test-data/phony-guests/Makefile.am similarity index 51% rename from tests/guests/Makefile.am rename to test-data/phony-guests/Makefile.am index 6ada4ec90..0b574d741 100644 --- a/tests/guests/Makefile.am +++ b/test-data/phony-guests/Makefile.am @@ -18,26 +18,26 @@ include $(top_srcdir)/subdir-rules.mk EXTRA_DIST = \ - guest-aux/make-debian-img.sh \ - guest-aux/debian-packages \ - guest-aux/debian-syslog \ - guest-aux/make-fedora-img.pl \ - guest-aux/fedora-journal.tar.xz \ - guest-aux/fedora-name.db.txt \ - guest-aux/fedora-name.db \ - guest-aux/fedora-packages.db.txt \ - guest-aux/fedora-packages.db \ - guest-aux/make-ubuntu-img.sh \ - guest-aux/make-archlinux-img.sh \ - guest-aux/archlinux-package \ - guest-aux/make-coreos-img.sh \ - guest-aux/make-windows-img.sh \ - guest-aux/windows-software \ - guest-aux/windows-software.reg \ - guest-aux/windows-system \ - guest-aux/windows-system.reg \ - guest-aux/minimal-hive \ - guest-aux/make-guests-all-good.pl \ + make-debian-img.sh \ + debian-packages \ + debian-syslog \ + make-fedora-img.pl \ + fedora-journal.tar.xz \ + fedora-name.db.txt \ + fedora-name.db \ + fedora-packages.db.txt \ + fedora-packages.db \ + make-ubuntu-img.sh \ + make-archlinux-img.sh \ + archlinux-package \ + make-coreos-img.sh \ + make-windows-img.sh \ + windows-software \ + windows-software.reg \ + windows-system \ + windows-system.reg \ + minimal-hive \ + make-guests-all-good.pl \ guests.xml.in disk_images = \ @@ -56,11 +56,10 @@ disk_images = \ coreos.img \ windows.img -# This is 'check_DATA' because we don't need it until 'make check' -# time and we need the tools we have built in order to make it. -check_DATA = $(disk_images) guests-all-good.xml +noinst_DATA = $(disk_images) guests-all-good.xml -CLEANFILES = $(check_DATA) \ +CLEANFILES = \ + $(noinst_DATA) \ guests-all-good.xml \ stamp-fedora-md.img \ *.tmp.* @@ -70,91 +69,91 @@ CLEANFILES = $(check_DATA) \ # virt-alignment-scan don't break when they encounter them. blank-%.img: rm -f $@ $@-t - $(top_builddir)/run \ - ../../fish/guestfish \ + $(top_builddir)/run guestfish \ -N $@-t="$$(echo $@ | $(SED) -e 's/blank-//' -e 's/.img//')" exit mv $@-t $@ # Make a (dummy) Fedora image. -fedora.img: guest-aux/make-fedora-img.pl \ - guest-aux/fedora-journal.tar.xz \ - guest-aux/fedora-name.db \ - guest-aux/fedora-packages.db - SRCDIR=$(srcdir) LAYOUT=partitions $(top_builddir)/run --test $< +fedora.img: make-fedora-img.pl \ + fedora-journal.tar.xz \ + fedora-name.db \ + fedora-packages.db + SRCDIR=$(srcdir) LAYOUT=partitions $(top_builddir)/run --test ./$< # Make a (dummy) Fedora image using md devices fedora-md1.img fedora-md2.img: stamp-fedora-md.img -stamp-fedora-md.img: guest-aux/make-fedora-img.pl \ - guest-aux/fedora-journal.tar.xz \ - guest-aux/fedora-name.db \ - guest-aux/fedora-packages.db +stamp-fedora-md.img: make-fedora-img.pl \ + fedora-journal.tar.xz \ + fedora-name.db \ + fedora-packages.db rm -f $@ - SRCDIR=$(srcdir) LAYOUT=partitions-md $(top_builddir)/run --test $< + SRCDIR=$(srcdir) LAYOUT=partitions-md $(top_builddir)/run --test ./$< touch $@ -fedora-btrfs.img: guest-aux/make-fedora-img.pl \ - guest-aux/fedora-journal.tar.xz \ - guest-aux/fedora-name.db \ - guest-aux/fedora-packages.db - SRCDIR=$(srcdir) LAYOUT=btrfs $(top_builddir)/run --test $< +fedora-btrfs.img: make-fedora-img.pl \ + fedora-journal.tar.xz \ + fedora-name.db \ + fedora-packages.db + SRCDIR=$(srcdir) LAYOUT=btrfs $(top_builddir)/run --test ./$< # Make a (dummy) Debian image. -debian.img: guest-aux/make-debian-img.sh - SRCDIR=$(srcdir) $(top_builddir)/run --test $< +debian.img: make-debian-img.sh + SRCDIR=$(srcdir) $(top_builddir)/run --test ./$< # Make a (dummy) Ubuntu image. -ubuntu.img: guest-aux/make-ubuntu-img.sh - SRCDIR=$(srcdir) $(top_builddir)/run --test $< +ubuntu.img: make-ubuntu-img.sh + SRCDIR=$(srcdir) $(top_builddir)/run --test ./$< # Make a (dummy) Arch Linux image. -archlinux.img: guest-aux/make-archlinux-img.sh - SRCDIR=$(srcdir) $(top_builddir)/run --test $< +archlinux.img: make-archlinux-img.sh + SRCDIR=$(srcdir) $(top_builddir)/run --test ./$< # Make a (dummy) CoreOS image. -coreos.img: guest-aux/make-coreos-img.sh - SRCDIR=$(srcdir) $(top_builddir)/run --test $< +coreos.img: make-coreos-img.sh + SRCDIR=$(srcdir) $(top_builddir)/run --test ./$< # Make a (dummy) Windows image. -windows.img: guest-aux/make-windows-img.sh \ - guest-aux/windows-software guest-aux/windows-system - SRCDIR=$(srcdir) $(top_builddir)/run --test $< +windows.img: make-windows-img.sh \ + windows-software \ + windows-system + SRCDIR=$(srcdir) $(top_builddir)/run --test ./$< -guests-all-good.xml: guest-aux/make-guests-all-good.pl $(disk_images) +guests-all-good.xml: make-guests-all-good.pl $(disk_images) rm -f $@ $@-t - $^ > $@-t + ./$^ > $@-t mv $@-t $@ # Since users might not have the tools needed to create this, we also # distribute these files and they are only cleaned by 'make distclean' # not regular 'make clean'. -guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt +fedora-name.db: fedora-name.db.txt rm -f $@ $@-t $(DB_LOAD) $@-t < $< mv $@-t $@ -guest-aux/fedora-packages.db: guest-aux/fedora-packages.db.txt +fedora-packages.db: fedora-packages.db.txt rm -f $@ $@-t $(DB_LOAD) $@-t < $< mv $@-t $@ -guest-aux/windows-software: guest-aux/windows-software.reg +windows-software: windows-software.reg rm -f $@ $@-t - cp $(srcdir)/guest-aux/minimal-hive $@-t + cp $(srcdir)/minimal-hive $@-t hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SOFTWARE' $< mv $@-t $@ -guest-aux/windows-system: guest-aux/windows-system.reg +windows-system: windows-system.reg rm -f $@ $@-t - cp $(srcdir)/guest-aux/minimal-hive $@-t + cp $(srcdir)/minimal-hive $@-t hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SYSTEM' $< mv $@-t $@ DISTCLEANFILES = \ - guest-aux/fedora-name.db \ - guest-aux/fedora-packages.db \ - guest-aux/windows-software \ - guest-aux/windows-system + fedora-name.db \ + fedora-packages.db \ + windows-software \ + windows-system # Don't construct the guests in parallel. In automake 1.13, check_DATA # was changed so it can now run in parallel, but this causes everything diff --git a/tests/guests/guest-aux/archlinux-package b/test-data/phony-guests/archlinux-package similarity index 100% rename from tests/guests/guest-aux/archlinux-package rename to test-data/phony-guests/archlinux-package diff --git a/tests/guests/guest-aux/debian-packages b/test-data/phony-guests/debian-packages similarity index 100% rename from tests/guests/guest-aux/debian-packages rename to test-data/phony-guests/debian-packages diff --git a/tests/guests/guest-aux/debian-syslog b/test-data/phony-guests/debian-syslog similarity index 100% rename from tests/guests/guest-aux/debian-syslog rename to test-data/phony-guests/debian-syslog diff --git a/tests/guests/guest-aux/fedora-journal.tar.xz b/test-data/phony-guests/fedora-journal.tar.xz similarity index 100% rename from tests/guests/guest-aux/fedora-journal.tar.xz rename to test-data/phony-guests/fedora-journal.tar.xz diff --git a/tests/guests/guest-aux/fedora-name.db.txt b/test-data/phony-guests/fedora-name.db.txt similarity index 100% rename from tests/guests/guest-aux/fedora-name.db.txt rename to test-data/phony-guests/fedora-name.db.txt diff --git a/tests/guests/guest-aux/fedora-packages.db.txt b/test-data/phony-guests/fedora-packages.db.txt similarity index 100% rename from tests/guests/guest-aux/fedora-packages.db.txt rename to test-data/phony-guests/fedora-packages.db.txt diff --git a/tests/guests/guests.xml.in b/test-data/phony-guests/guests.xml.in similarity index 100% rename from tests/guests/guests.xml.in rename to test-data/phony-guests/guests.xml.in diff --git a/tests/guests/guest-aux/make-archlinux-img.sh b/test-data/phony-guests/make-archlinux-img.sh similarity index 91% rename from tests/guests/guest-aux/make-archlinux-img.sh rename to test-data/phony-guests/make-archlinux-img.sh index 62babd177..5c848d2f4 100755 --- a/tests/guests/guest-aux/make-archlinux-img.sh +++ b/test-data/phony-guests/make-archlinux-img.sh @@ -47,9 +47,9 @@ write /etc/fstab "/dev/sda1 / ext4 rw,relatime,data=ordered 0 1" touch /etc/arch-release write /etc/hostname "archlinux.test" -upload $SRCDIR/guest-aux/archlinux-package /var/lib/pacman/local/test-package-1:0.1-1/desc +upload $SRCDIR/archlinux-package /var/lib/pacman/local/test-package-1:0.1-1/desc -upload $SRCDIR/../data/bin-x86_64-dynamic /bin/ls +upload $SRCDIR/../binaries/bin-x86_64-dynamic /bin/ls mkdir /boot/grub touch /boot/grub/grub.conf diff --git a/tests/guests/guest-aux/make-coreos-img.sh b/test-data/phony-guests/make-coreos-img.sh similarity index 100% rename from tests/guests/guest-aux/make-coreos-img.sh rename to test-data/phony-guests/make-coreos-img.sh diff --git a/tests/guests/guest-aux/make-debian-img.sh b/test-data/phony-guests/make-debian-img.sh similarity index 93% rename from tests/guests/guest-aux/make-debian-img.sh rename to test-data/phony-guests/make-debian-img.sh index 95228ab7e..b52758fe3 100755 --- a/tests/guests/guest-aux/make-debian-img.sh +++ b/test-data/phony-guests/make-debian-img.sh @@ -82,11 +82,11 @@ upload fstab.tmp.$$ /etc/fstab write /etc/debian_version "5.0.1" write /etc/hostname "debian.invalid" -upload $SRCDIR/guest-aux/debian-packages /var/lib/dpkg/status +upload $SRCDIR/debian-packages /var/lib/dpkg/status -upload $SRCDIR/../data/bin-x86_64-dynamic /bin/ls +upload $SRCDIR/../binaries/bin-x86_64-dynamic /bin/ls -upload $SRCDIR/guest-aux/debian-syslog /var/log/syslog +upload $SRCDIR/debian-syslog /var/log/syslog mkdir /boot/grub touch /boot/grub/grub.conf diff --git a/tests/guests/guest-aux/make-fedora-img.pl b/test-data/phony-guests/make-fedora-img.pl similarity index 95% rename from tests/guests/guest-aux/make-fedora-img.pl rename to test-data/phony-guests/make-fedora-img.pl index bd986057a..520a02d89 100755 --- a/tests/guests/guest-aux/make-fedora-img.pl +++ b/test-data/phony-guests/make-fedora-img.pl @@ -217,12 +217,12 @@ if (-f "mdadm.tmp.$$") { unlink ("mdadm.tmp.$$") or die; } -$g->upload ($ENV{SRCDIR}.'/guest-aux/fedora-name.db', '/var/lib/rpm/Name'); -$g->upload ($ENV{SRCDIR}.'/guest-aux/fedora-packages.db', '/var/lib/rpm/Packages'); +$g->upload ($ENV{SRCDIR}.'/fedora-name.db', '/var/lib/rpm/Name'); +$g->upload ($ENV{SRCDIR}.'/fedora-packages.db', '/var/lib/rpm/Packages'); -$g->upload ($ENV{SRCDIR}.'/../data/bin-x86_64-dynamic', '/bin/ls'); +$g->upload ($ENV{SRCDIR}.'/../binaries/bin-x86_64-dynamic', '/bin/ls'); -$g->txz_in ($ENV{SRCDIR}.'/guest-aux/fedora-journal.tar.xz', '/var/log/journal'); +$g->txz_in ($ENV{SRCDIR}.'/fedora-journal.tar.xz', '/var/log/journal'); $g->mkdir ('/boot/grub'); $g->touch ('/boot/grub/grub.conf'); diff --git a/tests/guests/guest-aux/make-guests-all-good.pl b/test-data/phony-guests/make-guests-all-good.pl similarity index 97% rename from tests/guests/guest-aux/make-guests-all-good.pl rename to test-data/phony-guests/make-guests-all-good.pl index ab6451a6e..433a75773 100755 --- a/tests/guests/guest-aux/make-guests-all-good.pl +++ b/test-data/phony-guests/make-guests-all-good.pl @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# Make the ../guests-all-good.xml file. +# Make the 'guests-all-good.xml' file. use strict; use warnings; diff --git a/tests/guests/guest-aux/make-ubuntu-img.sh b/test-data/phony-guests/make-ubuntu-img.sh similarity index 95% rename from tests/guests/guest-aux/make-ubuntu-img.sh rename to test-data/phony-guests/make-ubuntu-img.sh index 183985bb4..d546aee3a 100755 --- a/tests/guests/guest-aux/make-ubuntu-img.sh +++ b/test-data/phony-guests/make-ubuntu-img.sh @@ -73,9 +73,9 @@ write /etc/debian_version "5.0.1" upload release.tmp.$$ /etc/lsb-release write /etc/hostname "ubuntu.invalid" -upload $SRCDIR/guest-aux/debian-packages /var/lib/dpkg/status +upload $SRCDIR/debian-packages /var/lib/dpkg/status -upload $SRCDIR/../data/bin-x86_64-dynamic /bin/ls +upload $SRCDIR/../binaries/bin-x86_64-dynamic /bin/ls mkdir /boot/grub touch /boot/grub/grub.conf diff --git a/tests/guests/guest-aux/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh similarity index 90% rename from tests/guests/guest-aux/make-windows-img.sh rename to test-data/phony-guests/make-windows-img.sh index cfe59dc8d..0c2fe69c8 100755 --- a/tests/guests/guest-aux/make-windows-img.sh +++ b/test-data/phony-guests/make-windows-img.sh @@ -59,10 +59,10 @@ mount /dev/sda2 / mkdir-p /Windows/System32/Config mkdir-p /Windows/System32/Drivers -upload $SRCDIR/guest-aux/windows-software /Windows/System32/Config/SOFTWARE -upload $SRCDIR/guest-aux/windows-system /Windows/System32/Config/SYSTEM +upload $SRCDIR/windows-software /Windows/System32/Config/SOFTWARE +upload $SRCDIR/windows-system /Windows/System32/Config/SYSTEM -upload $SRCDIR/../data/bin-win32.exe /Windows/System32/cmd.exe +upload $SRCDIR/../binaries/bin-win32.exe /Windows/System32/cmd.exe mkdir "/Program Files" touch /autoexec.bat diff --git a/tests/guests/guest-aux/minimal-hive b/test-data/phony-guests/minimal-hive similarity index 100% rename from tests/guests/guest-aux/minimal-hive rename to test-data/phony-guests/minimal-hive diff --git a/tests/guests/guest-aux/windows-software.reg b/test-data/phony-guests/windows-software.reg similarity index 100% rename from tests/guests/guest-aux/windows-software.reg rename to test-data/phony-guests/windows-software.reg diff --git a/tests/guests/guest-aux/windows-system.reg b/test-data/phony-guests/windows-system.reg similarity index 100% rename from tests/guests/guest-aux/windows-system.reg rename to test-data/phony-guests/windows-system.reg diff --git a/tests/btrfs/test-btrfs-devices.sh b/tests/btrfs/test-btrfs-devices.sh index 3935c608f..2cdf01fef 100755 --- a/tests/btrfs/test-btrfs-devices.sh +++ b/tests/btrfs/test-btrfs-devices.sh @@ -55,7 +55,7 @@ mkfs-btrfs "/dev/sda1 /dev/sdb1" mount /dev/sda1 / mkdir /data1 -tar-in $srcdir/../data/filesanddirs-10M.tar.xz /data1 compress:xz +tar-in $srcdir/../../test-data/files/filesanddirs-10M.tar.xz /data1 compress:xz # In btrfs-progs 0.19, a test was added which prevents us from # deleting the mount device (/dev/sda1) although that restriction @@ -68,7 +68,7 @@ btrfs-device-add "/dev/sdb1" / btrfs-device-delete "/dev/sdc1 /dev/sdd1" / mkdir /data2 -tar-in $srcdir/../data/filesanddirs-10M.tar.xz /data2 compress:xz +tar-in $srcdir/../../test-data/files/filesanddirs-10M.tar.xz /data2 compress:xz btrfs-device-add "/dev/sdc1 /dev/sdd1" / btrfs-device-delete "/dev/sdb1" / @@ -76,7 +76,7 @@ btrfs-device-add "/dev/sdb1" / btrfs-device-delete "/dev/sdc1 /dev/sdd1" / mkdir /data3 -tar-in $srcdir/../data/filesanddirs-10M.tar.xz /data3 compress:xz +tar-in $srcdir/../../test-data/files/filesanddirs-10M.tar.xz /data3 compress:xz btrfs-device-add "/dev/sdc1 /dev/sdd1" / btrfs-device-delete "/dev/sdb1" / @@ -84,7 +84,7 @@ btrfs-device-add "/dev/sdb1" / btrfs-device-delete "/dev/sdc1 /dev/sdd1" / mkdir /data4 -tar-in $srcdir/../data/filesanddirs-10M.tar.xz /data4 compress:xz +tar-in $srcdir/../../test-data/files/filesanddirs-10M.tar.xz /data4 compress:xz btrfs-device-add "/dev/sdc1 /dev/sdd1" / btrfs-device-delete "/dev/sdb1" / diff --git a/tests/btrfs/test-btrfs-replace.sh b/tests/btrfs/test-btrfs-replace.sh index 2bf6d6db0..b0f4a1efc 100755 --- a/tests/btrfs/test-btrfs-replace.sh +++ b/tests/btrfs/test-btrfs-replace.sh @@ -44,7 +44,7 @@ mkfs-btrfs /dev/sda mount /dev/sda / mkdir /data -copy-in $srcdir/../data/filesanddirs-10M.tar.xz /data +copy-in $srcdir/../../test-data/files/filesanddirs-10M.tar.xz /data # now, sda is btrfs while sdb is blank. btrfs-replace /dev/sda /dev/sdb / diff --git a/tests/c-api/tests-main.c b/tests/c-api/tests-main.c index 71a361a05..ee5704aaa 100644 --- a/tests/c-api/tests-main.c +++ b/tests/c-api/tests-main.c @@ -455,8 +455,8 @@ create_handle (void) exit (EXIT_FAILURE); } - if (guestfs_add_drive_ro (g, "../data/test.iso") == -1) { - printf ("FAIL: guestfs_add_drive_ro ../data/test.iso\n"); + if (guestfs_add_drive_ro (g, "../../test-data/test.iso") == -1) { + printf ("FAIL: guestfs_add_drive_ro ../../test-data/test.iso\n"); exit (EXIT_FAILURE); } diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am deleted file mode 100644 index 305136f6a..000000000 --- a/tests/data/Makefile.am +++ /dev/null @@ -1,223 +0,0 @@ -# libguestfs test images -# Copyright (C) 2009-2015 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -include $(top_srcdir)/subdir-rules.mk - -EXTRA_DIST = \ - README-binfiles \ - filesanddirs-10M.tar.xz \ - filesanddirs-100M.tar.xz \ - helloworld.tar \ - helloworld.tar.gz \ - helloworld.tar.xz \ - mbr-ext2-empty.img.gz \ - empty known-1 known-2 known-3 known-4 known-5 \ - bin-aarch64-dynamic \ - bin-armv7-dynamic \ - bin-i586-dynamic \ - bin-ia64-dynamic \ - bin-mipsel-dynamic \ - bin-ppc64-dynamic \ - bin-ppc64le-dynamic \ - bin-sparc-dynamic \ - bin-win32.exe \ - bin-win64.exe \ - bin-x86_64-dynamic \ - lib-aarch64.so \ - lib-armv7.so \ - lib-i586.so \ - lib-ia64.so \ - lib-ppc64.so \ - lib-ppc64le.so \ - lib-mipsel.so \ - lib-sparc.so \ - lib-win32.dll \ - lib-win64.dll \ - lib-x86_64.so \ - test-grep.txt \ - minimal - -images_files_src = \ - $(srcdir)/helloworld.tar \ - $(srcdir)/helloworld.tar.gz \ - $(srcdir)/helloworld.tar.xz \ - $(srcdir)/empty \ - $(srcdir)/known-1 \ - $(srcdir)/known-2 \ - $(srcdir)/known-3 \ - $(srcdir)/known-4 \ - $(srcdir)/known-5 \ - $(srcdir)/bin-aarch64-dynamic \ - $(srcdir)/bin-armv7-dynamic \ - $(srcdir)/bin-i586-dynamic \ - $(srcdir)/bin-ia64-dynamic \ - $(srcdir)/bin-mipsel-dynamic \ - $(srcdir)/bin-ppc64-dynamic \ - $(srcdir)/bin-ppc64le-dynamic \ - $(srcdir)/bin-sparc-dynamic \ - $(srcdir)/bin-win32.exe \ - $(srcdir)/bin-win64.exe \ - $(srcdir)/bin-x86_64-dynamic \ - $(srcdir)/lib-aarch64.so \ - $(srcdir)/lib-armv7.so \ - $(srcdir)/lib-i586.so \ - $(srcdir)/lib-ia64.so \ - $(srcdir)/lib-mipsel.so \ - $(srcdir)/lib-ppc64.so \ - $(srcdir)/lib-ppc64le.so \ - $(srcdir)/lib-sparc.so \ - $(srcdir)/lib-win32.dll \ - $(srcdir)/lib-win64.dll \ - $(srcdir)/lib-x86_64.so \ - $(srcdir)/test-grep.txt \ - $(srcdir)/minimal - -images_files_build = \ - 100kallzeroes \ - 100kallnewlines \ - 100kallspaces \ - 100krandom \ - 10klines \ - bin-x86_64-dynamic.gz \ - blank-disk-1s.raw \ - blank-disk-1s.qcow2 \ - blank-disk-1K.raw \ - blank-disk-1K.qcow2 \ - blank-disk-1M.raw \ - blank-disk-1M.qcow2 \ - blank-disk-with-backing.qcow2 \ - hello.b64 \ - initrd \ - initrd-x86_64.img \ - initrd-x86_64.img.gz \ - lib-i586.so.xz \ - test-grep.txt.gz - -check_DATA = $(images_files_build) test.iso - -CLEANFILES = $(images_files_build) test.iso - -images_files = $(images_files_src) $(images_files_build) - -test.iso: $(images_files) - rm -f $@ $@-t - mkdir -p directory - ln -sf /10klines abssymlink - $(GENISOIMAGE) -J -r -graft-points \ - -o $@-t \ - $(images_files) /directory=directory abssymlink - rmdir directory - rm abssymlink - mv $@-t $@ - -100kallzeroes: - rm -f $@ $@-t - dd if=/dev/zero of=$@-t bs=1024 count=100 - mv $@-t $@ - -100kallnewlines: 100kallzeroes - rm -f $@ $@-t - tr '\0' '\n' < $< > $@-t - mv $@-t $@ - -100kallspaces: 100kallzeroes - rm -f $@ $@-t - tr '\0' ' ' < $< > $@-t - mv $@-t $@ - -100krandom: - rm -f $@ $@-t - dd if=/dev/urandom of=$@-t bs=1024 count=100 - mv $@-t $@ - -10klines: - rm -f $@ $@-t - i=0; \ - while [ $$i -lt 10000 ]; do \ - echo "$${i}abcdefghijklmnopqrstuvwxyz"; \ - i=$$(($$i+1)); \ - done > $@-t - mv $@-t $@ - -# Blank disk images in various sizes and formats. -blank-disk-1s.raw: - rm -f $@ - ../../fish/guestfish sparse $@ 512 - -blank-disk-1s.qcow2: - qemu-img create -f qcow2 -o preallocation=metadata $@ 512 - -blank-disk-1K.raw: - rm -f $@ - ../../fish/guestfish sparse $@ 1K - -blank-disk-1K.qcow2: - qemu-img create -f qcow2 -o preallocation=metadata $@ 1K - -blank-disk-1M.raw: - rm -f $@ - ../../fish/guestfish sparse $@ 1M - -blank-disk-1M.qcow2: - qemu-img create -f qcow2 -o preallocation=metadata $@ 1M - -blank-disk-with-backing.qcow2: blank-disk-1M.raw - qemu-img create -f qcow2 -b $^ $@ - -hello.b64: - echo "hello" | base64 > $@ - -# When builddir != srcdir, names like 'empty' are rewritten as -# '../../tests/data/empty'. We need to copy the files into a fresh -# subdirectory in order to create the initrd correctly. -initrd: empty known-1 known-2 known-3 known-4 known-5 - rm -rf init.tmp $@ $@-t - mkdir -p init.tmp - cp $^ init.tmp - (cd init.tmp; ls -1 * | cpio -o -H newc | gzip --best) > $@-t - rm -r init.tmp - mv $@-t $@ - -# Create a dummy initrd with a single file called 'bin/nash' which -# is used to test the file_architecture function. -initrd-x86_64.img: bin-x86_64-dynamic - rm -rf bin $@ $@-t - mkdir bin - cp $< bin/nash - echo bin/nash | cpio -o -H newc > $@-t - mv $@-t $@ - rm -rf bin $@-t - -initrd-x86_64.img.gz: initrd-x86_64.img - rm -f $@ $@-t - gzip --best -c $< > $@-t - mv $@-t $@ - -test-grep.txt.gz: test-grep.txt - rm -f $@ $@-t - gzip --best -c $< > $@-t - mv $@-t $@ - -bin-x86_64-dynamic.gz: bin-x86_64-dynamic - rm -f $@ $@-t - gzip --best -c $< > $@-t - mv $@-t $@ - -lib-i586.so.xz: lib-i586.so - rm -f $@ $@-t - xz -c $< > $@-t - mv $@-t $@ diff --git a/tests/fuzz/fuzz-inspection.pl b/tests/fuzz/fuzz-inspection.pl index 805558da6..dfb431a0d 100755 --- a/tests/fuzz/fuzz-inspection.pl +++ b/tests/fuzz/fuzz-inspection.pl @@ -34,12 +34,12 @@ $progname =~ s{.*/}{}; my $trace_depth = 0; my $srcdir = $ENV{srcdir} || "."; -# Location of tests/data. -my $datasrcdir = $srcdir . "/../data"; -my $databindir = "../data"; -# Location of tests/guests/guest-aux. -my $guestauxsrcdir = $srcdir . "/../guests/guest-aux"; -my $guestauxbindir = "../guests/guest-aux"; +# Location of test-data/files. +my $datasrcdir = $srcdir . "/../../test-data/files"; +my $databindir = "../../test-data/files"; +# Location of test-data/phony-guests. +my $guestsrcdir = $srcdir . "/../../test-data/phony-guests"; +my $guestbindir = "../../test-data/phony-guests"; if ($ENV{SKIP_FUZZ_INSPECTION_PL}) { print "$progname: test skipped because environment variable set\n"; @@ -526,9 +526,9 @@ sub random_file_hive my $filename = shift; my @hivefiles = (); - $_ = $guestauxbindir . "/windows-software"; + $_ = $guestbindir . "/windows-software"; push @hivefiles, $_ if -f $_; - $_ = $guestauxbindir . "/windows-system"; + $_ = $guestbindir . "/windows-system"; push @hivefiles, $_ if -f $_; if (@hivefiles > 0) { diff --git a/tests/http/test-http.py b/tests/http/test-http.py index 02401807d..8606c22c2 100755 --- a/tests/http/test-http.py +++ b/tests/http/test-http.py @@ -24,7 +24,7 @@ from time import sleep from random import randint progname = os.path.basename(sys.argv[0]) -guestsdir = "../guests" +guestsdir = "../../test-data/phony-guests" listen_addr = "localhost" #listen_addr = "127.0.0.1" #listen_addr = "" diff --git a/tests/journal/test-journal.pl b/tests/journal/test-journal.pl index 6d8675b13..8a3f94dfd 100755 --- a/tests/journal/test-journal.pl +++ b/tests/journal/test-journal.pl @@ -16,9 +16,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# Test journal using test data from ../guests/guest-aux/- -# fedora-journal.tar.xz which is incorporated into the Fedora test -# image in ../guests/fedora.img. +# Test journal using test data from +# test-data/phony-guests/fedora-journal.tar.xz which is incorporated +# into the Fedora test image in test-data/phony-guests/fedora.img. use strict; use warnings; @@ -28,7 +28,8 @@ use Sys::Guestfs; exit 77 if $ENV{SKIP_TEST_JOURNAL_PL}; my $g = Sys::Guestfs->new (); -$g->add_drive ("../guests/fedora.img", readonly => 1, format => "raw"); +$g->add_drive ("../../test-data/phony-guests/fedora.img", + readonly => 1, format => "raw"); $g->launch (); # If journal feature is not available, bail. diff --git a/tests/md/test-inspect-fstab-md.sh b/tests/md/test-inspect-fstab-md.sh index 43e1d3a38..6c1842f57 100755 --- a/tests/md/test-inspect-fstab-md.sh +++ b/tests/md/test-inspect-fstab-md.sh @@ -29,8 +29,8 @@ fi 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 +cp ../../test-data/phony-guests/fedora-md1.img inspect-fstab-md-1.img +cp ../../test-data/phony-guests/fedora-md2.img inspect-fstab-md-2.img guestfish -i inspect-fstab-md-[12].img <<'EOF' | sort > inspect-fstab-md.output exists /boot/grub/grub.conf diff --git a/tests/md/test-inspect-fstab.sh b/tests/md/test-inspect-fstab.sh index f31ec2e5c..007ea0840 100755 --- a/tests/md/test-inspect-fstab.sh +++ b/tests/md/test-inspect-fstab.sh @@ -35,7 +35,7 @@ rm -f inspect-fstab-1.qcow2 inspect-fstab.fstab inspect-fstab.output # and then inspect it. guestfish -- \ disk-create inspect-fstab-1.qcow2 qcow2 -1 \ - backingfile:../guests/fedora.img backingformat:raw + backingfile:../../test-data/phony-guests/fedora.img backingformat:raw cat <<'EOF' > inspect-fstab.fstab /dev/VG/Root / ext2 default 0 0 diff --git a/tests/mountable/test-mountable-inspect.sh b/tests/mountable/test-mountable-inspect.sh index 3b81fd09f..ebef0c613 100755 --- a/tests/mountable/test-mountable-inspect.sh +++ b/tests/mountable/test-mountable-inspect.sh @@ -44,7 +44,7 @@ rm -f root.tmp test.qcow2 test.output # and then inspect it. guestfish -- \ disk-create test.qcow2 qcow2 -1 \ - backingfile:../guests/fedora-btrfs.img backingformat:raw + backingfile:../../test-data/phony-guests/fedora-btrfs.img backingformat:raw # Test that basic inspection works and the expected filesystems are # found diff --git a/tests/nbd/test-nbd.pl b/tests/nbd/test-nbd.pl index 0ad299ca0..ab320db4c 100755 --- a/tests/nbd/test-nbd.pl +++ b/tests/nbd/test-nbd.pl @@ -22,7 +22,7 @@ use POSIX qw(getcwd); use Sys::Guestfs; -my $disk = "../guests/fedora.img"; +my $disk = "../../test-data/phony-guests/fedora.img"; my $pid = 0; END { kill 15, $pid if $pid > 0 }; diff --git a/tests/ntfsclone/test-ntfsclone.sh b/tests/ntfsclone/test-ntfsclone.sh index 30c21bfca..668ed8a67 100755 --- a/tests/ntfsclone/test-ntfsclone.sh +++ b/tests/ntfsclone/test-ntfsclone.sh @@ -33,13 +33,13 @@ if ! guestfish add /dev/null : run : available "ntfs3g"; then exit 77 fi -if [ ! -s ../guests/windows.img ]; then +if [ ! -s ../../test-data/phony-guests/windows.img ]; then echo "$0: skipped because windows.img is zero-sized" exit 77 fi # Export the filesystems to the backup file. -guestfish --ro -a ../guests/windows.img <test.error +$VG guestfish --ro -a ../../test-data/phony-guests/fedora.img -i <test.error # valid invocations lstatlist /etc "fedora-release sysconfig" lstatnslist /etc "fedora-release sysconfig" diff --git a/tests/regressions/rhbz1232192.sh b/tests/regressions/rhbz1232192.sh index 8cd64535c..6e0b775cd 100755 --- a/tests/regressions/rhbz1232192.sh +++ b/tests/regressions/rhbz1232192.sh @@ -37,13 +37,13 @@ if [ "$(guestfish get-backend)" = "uml" ]; then exit 77 fi -if [ ! -f ../guests/windows.img ] || [ ! -s ../guests/windows.img ]; then - echo "$0: test skipped because tests/guests/windows.img was not built" +if [ ! -f ../../test-data/phony-guests/windows.img ] || [ ! -s ../../test-data/phony-guests/windows.img ]; then + echo "$0: test skipped because test-data/phony-guests/windows.img was not built" exit 77 fi -if [ ! -f ../guests/blank-disk.img ]; then - echo "$0: test skipped because tests/guests/blank-disk.img was not built" +if [ ! -f ../../test-data/phony-guests/blank-disk.img ]; then + echo "$0: test skipped because test-data/phony-guests/blank-disk.img was not built" exit 77 fi diff --git a/tests/regressions/rhbz1232192.xml b/tests/regressions/rhbz1232192.xml index c31ea2460..099530de9 100644 --- a/tests/regressions/rhbz1232192.xml +++ b/tests/regressions/rhbz1232192.xml @@ -14,12 +14,12 @@ - + - + diff --git a/tests/regressions/rhbz563450.sh b/tests/regressions/rhbz563450.sh index d7cf75124..90397a2b2 100755 --- a/tests/regressions/rhbz563450.sh +++ b/tests/regressions/rhbz563450.sh @@ -22,7 +22,7 @@ set -e export LANG=C -if [ ! -s ../guests/fedora.img -o ! -s ../data/test.iso -o ! -s ../guests/debian.img ]; then +if [ ! -s ../../test-data/phony-guests/fedora.img -o ! -s ../../test-data/test.iso -o ! -s ../../test-data/phony-guests/debian.img ]; then echo "$0: test skipped because there is no fedora.img nor test.iso nor debian.img" exit 77 fi @@ -30,9 +30,9 @@ fi rm -f test.out guestfish --ro > test.out < test.out < test.out < test.out < - + - + diff --git a/v2v/test-v2v-i-disk.sh b/v2v/test-v2v-i-disk.sh index 17f904c3d..8d99ce8d8 100755 --- a/v2v/test-v2v-i-disk.sh +++ b/v2v/test-v2v-i-disk.sh @@ -32,7 +32,7 @@ if [ "$(guestfish get-backend)" = "uml" ]; then exit 77 fi -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-i-ova.sh b/v2v/test-v2v-i-ova.sh index 266382ef4..3589631ae 100755 --- a/v2v/test-v2v-i-ova.sh +++ b/v2v/test-v2v-i-ova.sh @@ -32,7 +32,7 @@ if [ "$(guestfish get-backend)" = "uml" ]; then exit 77 fi -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-in-place.sh b/v2v/test-v2v-in-place.sh index f685ddbb5..40f08cc42 100755 --- a/v2v/test-v2v-in-place.sh +++ b/v2v/test-v2v-in-place.sh @@ -35,7 +35,7 @@ fi abs_top_builddir="$(cd ..; pwd)" -img_base="$abs_top_builddir/tests/guests/windows.img" +img_base="$abs_top_builddir/test-data/phony-guests/windows.img" if ! test -f $img_base || ! test -s $img_base; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-networks-and-bridges.sh b/v2v/test-v2v-networks-and-bridges.sh index 1c16640fc..efef74c5d 100755 --- a/v2v/test-v2v-networks-and-bridges.sh +++ b/v2v/test-v2v-networks-and-bridges.sh @@ -35,7 +35,7 @@ fi abs_builddir="$(pwd)" libvirt_uri="test://$abs_builddir/test-v2v-networks-and-bridges.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-networks-and-bridges.xml b/v2v/test-v2v-networks-and-bridges.xml index a6409f80f..cd7a30d0e 100644 --- a/v2v/test-v2v-networks-and-bridges.xml +++ b/v2v/test-v2v-networks-and-bridges.xml @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - + diff --git a/v2v/test-v2v-no-copy.sh b/v2v/test-v2v-no-copy.sh index 647c668a3..27d58ceb3 100755 --- a/v2v/test-v2v-no-copy.sh +++ b/v2v/test-v2v-no-copy.sh @@ -33,9 +33,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-o-glance.sh b/v2v/test-v2v-o-glance.sh index a08364b36..fe4bdef4e 100755 --- a/v2v/test-v2v-o-glance.sh +++ b/v2v/test-v2v-o-glance.sh @@ -33,9 +33,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-o-libvirt.sh b/v2v/test-v2v-o-libvirt.sh index ac2862a46..972f05ead 100755 --- a/v2v/test-v2v-o-libvirt.sh +++ b/v2v/test-v2v-o-libvirt.sh @@ -50,9 +50,9 @@ if [ "$(uname -m)" != "x86_64" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-o-null.sh b/v2v/test-v2v-o-null.sh index 4a957404f..c21383e50 100755 --- a/v2v/test-v2v-o-null.sh +++ b/v2v/test-v2v-o-null.sh @@ -33,9 +33,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-o-qemu.sh b/v2v/test-v2v-o-qemu.sh index d6fb69f1e..03fbe8349 100755 --- a/v2v/test-v2v-o-qemu.sh +++ b/v2v/test-v2v-o-qemu.sh @@ -33,9 +33,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-o-rhev.sh b/v2v/test-v2v-o-rhev.sh index 897a82dc1..639b6a507 100755 --- a/v2v/test-v2v-o-rhev.sh +++ b/v2v/test-v2v-o-rhev.sh @@ -33,9 +33,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-o-vdsm-options.sh b/v2v/test-v2v-o-vdsm-options.sh index 914c70aa6..671f60039 100755 --- a/v2v/test-v2v-o-vdsm-options.sh +++ b/v2v/test-v2v-o-vdsm-options.sh @@ -33,9 +33,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-oa-option.sh b/v2v/test-v2v-oa-option.sh index 4de80c0dd..5648f95df 100755 --- a/v2v/test-v2v-oa-option.sh +++ b/v2v/test-v2v-oa-option.sh @@ -33,9 +33,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-of-option.sh b/v2v/test-v2v-of-option.sh index dea3d4036..a151c736e 100755 --- a/v2v/test-v2v-of-option.sh +++ b/v2v/test-v2v-of-option.sh @@ -33,9 +33,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-on-option.sh b/v2v/test-v2v-on-option.sh index 3cca6c26b..5aaad2f63 100755 --- a/v2v/test-v2v-on-option.sh +++ b/v2v/test-v2v-on-option.sh @@ -33,9 +33,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-print-source.sh b/v2v/test-v2v-print-source.sh index e7a838251..8dd014553 100755 --- a/v2v/test-v2v-print-source.sh +++ b/v2v/test-v2v-print-source.sh @@ -28,9 +28,9 @@ if [ -n "$SKIP_TEST_V2V_PRINT_SOURCE_SH" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-sound.sh b/v2v/test-v2v-sound.sh index 661a89850..e5bcc8cb0 100755 --- a/v2v/test-v2v-sound.sh +++ b/v2v/test-v2v-sound.sh @@ -35,7 +35,7 @@ fi abs_builddir="$(pwd)" libvirt_uri="test://$abs_builddir/test-v2v-sound.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-sound.xml b/v2v/test-v2v-sound.xml index f2babef35..0938d649c 100644 --- a/v2v/test-v2v-sound.xml +++ b/v2v/test-v2v-sound.xml @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - + diff --git a/v2v/test-v2v-virtio-win-iso.sh b/v2v/test-v2v-virtio-win-iso.sh index 090025c66..8a9182dce 100755 --- a/v2v/test-v2v-virtio-win-iso.sh +++ b/v2v/test-v2v-virtio-win-iso.sh @@ -34,9 +34,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77 diff --git a/v2v/test-v2v-windows-conversion.sh b/v2v/test-v2v-windows-conversion.sh index d086bc4bc..6d7d256e8 100755 --- a/v2v/test-v2v-windows-conversion.sh +++ b/v2v/test-v2v-windows-conversion.sh @@ -33,9 +33,9 @@ if [ "$(guestfish get-backend)" = "uml" ]; then fi abs_top_builddir="$(cd ..; pwd)" -libvirt_uri="test://$abs_top_builddir/tests/guests/guests.xml" +libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml" -f=../tests/guests/windows.img +f=../test-data/phony-guests/windows.img if ! test -f $f || ! test -s $f; then echo "$0: test skipped because phony Windows image was not created" exit 77