Permalink
Browse files

tests: Split images -> tests/data + tests/guests

  • Loading branch information...
1 parent c649817 commit cd077b8229731e292798f34dd56892cbfa6f1e0e @rwmjones rwmjones committed Dec 22, 2011
Showing with 191 additions and 175 deletions.
  1. +20 −20 .gitignore
  2. +1 −1 .x-sc_TAB_in_indentation
  3. +1 −1 .x-sc_trailing_blank
  4. +1 −1 Makefile.am
  5. +2 −2 cat/test-virt-cat.sh
  6. +2 −2 cat/test-virt-filesystems.sh
  7. +2 −2 cat/test-virt-ls.sh
  8. +1 −1 clone/test-virt-sysprep.sh
  9. +2 −1 configure.ac
  10. +1 −1 df/test-virt-df.sh
  11. +1 −1 edit/test-virt-edit.sh
  12. +3 −3 fish/test-copy.sh
  13. +1 −1 fish/test-find0.sh
  14. +2 −2 fish/test-read_file.sh
  15. +1 −1 fish/test-upload-to-dir.sh
  16. +5 −5 generator/generator_actions.ml
  17. +2 −2 generator/generator_tests_c_api.ml
  18. +4 −4 inspector/Makefile.am
  19. +1 −1 perl/Makefile.am
  20. +0 −4 po/POTFILES.in
  21. +0 −6 src/guestfs.pod
  22. +3 −84 {images → tests/data}/Makefile.am
  23. 0 {images → tests/data}/README-binfiles
  24. BIN {images → tests/data}/bin-i586-dynamic
  25. BIN {images → tests/data}/bin-sparc-dynamic
  26. BIN {images → tests/data}/bin-win32.exe
  27. BIN {images → tests/data}/bin-win64.exe
  28. BIN {images → tests/data}/bin-x86_64-dynamic
  29. 0 {images → tests/data}/empty
  30. BIN {images → tests/data}/helloworld.tar
  31. BIN {images → tests/data}/helloworld.tar.gz
  32. BIN {images → tests/data}/helloworld.tar.xz
  33. 0 {images → tests/data}/known-1
  34. 0 {images → tests/data}/known-2
  35. 0 {images → tests/data}/known-3
  36. 0 {images → tests/data}/known-4
  37. 0 {images → tests/data}/known-5
  38. BIN {images → tests/data}/lib-i586.so
  39. BIN {images → tests/data}/lib-sparc.so
  40. BIN {images → tests/data}/lib-win32.dll
  41. BIN {images → tests/data}/lib-win64.dll
  42. BIN {images → tests/data}/lib-x86_64.so
  43. BIN {images → tests/data}/mbr-ext2-empty.img.gz
  44. 0 {images → tests/data}/test-grep.txt
  45. +16 −16 tests/extra/Makefile.am
  46. +106 −0 tests/guests/Makefile.am
  47. 0 {images → tests/guests}/guest-aux/debian-packages
  48. 0 {images → tests/guests}/guest-aux/fedora-name.db.txt
  49. 0 {images → tests/guests}/guest-aux/fedora-packages.db.txt
  50. +2 −2 {images → tests/guests}/guest-aux/make-debian-img.sh
  51. +1 −1 {images → tests/guests}/guest-aux/make-fedora-img.pl
  52. +2 −2 {images → tests/guests}/guest-aux/make-ubuntu-img.sh
  53. +3 −3 {images → tests/guests}/guest-aux/make-windows-img.sh
  54. BIN {images → tests/guests}/guest-aux/minimal-hive
  55. BIN {images → tests/guests}/guest-aux/windows-software
  56. 0 {images → tests/guests}/guest-aux/windows-software.reg
  57. BIN {images → tests/guests}/guest-aux/windows-system
  58. 0 {images → tests/guests}/guest-aux/windows-system.reg
  59. +2 −2 tests/md/test-inspect-fstab-md.sh
  60. +1 −1 tests/md/test-inspect-fstab.sh
  61. +1 −1 tools/test-virt-list-filesystems.sh
  62. +1 −1 tools/test-virt-tar.sh
View
@@ -152,26 +152,6 @@ html/virt-tar.1.html
html/virt-tar-in.1.html
html/virt-tar-out.1.html
html/virt-win-reg.1.html
-images/100kallnewlines
-images/100kallspaces
-images/100kallzeroes
-images/100krandom
-images/10klines
-images/abssymlink
-images/debian.img
-images/fedora.img
-images/fedora-md1.img
-images/fedora-md2.img
-images/guest-aux/fedora-name.db
-images/guest-aux/fedora-packages.db
-images/hello.b64
-images/initrd
-images/initrd-x86_64.img
-images/initrd-x86_64.img.gz
-images/test.iso
-images/test-grep.txt.gz
-images/ubuntu.img
-images/windows.img
inspector/stamp-virt-inspector.pod
inspector/virt-inspector
inspector/virt-inspector.1
@@ -356,7 +336,27 @@ tests/c-api/test*.img
tests/c-api/tests
tests/c-api/tests.c
tests/c-api/test*.tmp
+tests/data/100kallnewlines
+tests/data/100kallspaces
+tests/data/100kallzeroes
+tests/data/100krandom
+tests/data/10klines
+tests/data/abssymlink
+tests/data/hello.b64
+tests/data/initrd
+tests/data/initrd-x86_64.img
+tests/data/initrd-x86_64.img.gz
+tests/data/test.iso
+tests/data/test-grep.txt.gz
tests/extra/valgrind.log
+tests/guests/debian.img
+tests/guests/fedora.img
+tests/guests/fedora-md1.img
+tests/guests/fedora-md2.img
+tests/guests/guest-aux/fedora-name.db
+tests/guests/guest-aux/fedora-packages.db
+tests/guests/ubuntu.img
+tests/guests/windows.img
tests/regressions/rhbz501893
tools/test.img
tools/virt-*.1
View
@@ -1,5 +1,5 @@
^appliance/debian/modules/
-^images/
+^tests/data/
^COPYING(.LIB)?$
^\.gitmodules$
(^|\/)ChangeLog[^/]*$
View
@@ -1,2 +1,2 @@
-images/bin-win64.exe
+tests/data/bin-win64.exe
*.pod
View
@@ -20,7 +20,7 @@ include $(top_srcdir)/subdir-rules.mk
ACLOCAL_AMFLAGS = -I m4
# Basic source for the library.
-SUBDIRS = gnulib/lib images generator src examples po
+SUBDIRS = gnulib/lib tests/data tests/guests generator src examples po
if ENABLE_DAEMON
SUBDIRS += daemon
View
@@ -4,11 +4,11 @@ export LANG=C
set -e
# Read out the test files from the image using virt-cat.
-if [ "$(./virt-cat ../images/fedora.img /etc/test1)" != "abcdefg" ]; then
+if [ "$(./virt-cat ../tests/guests/fedora.img /etc/test1)" != "abcdefg" ]; then
echo "$0: error: mismatch in file test1"
exit 1
fi
-if [ "$(./virt-cat ../images/fedora.img /etc/test2)" != "" ]; then
+if [ "$(./virt-cat ../tests/guests/fedora.img /etc/test2)" != "" ]; then
echo "$0: error: mismatch in file test2"
exit 1
fi
@@ -3,7 +3,7 @@
export LANG=C
set -e
-output="$(./virt-filesystems -a ../images/fedora.img | sort)"
+output="$(./virt-filesystems -a ../tests/guests/fedora.img | sort)"
expected="/dev/VG/LV1
/dev/VG/LV2
/dev/VG/LV3
@@ -16,7 +16,7 @@ if [ "$output" != "$expected" ]; then
exit 1
fi
-output="$(./virt-filesystems -a ../images/fedora.img --all --long --uuid -h --no-title | awk '{print $1}' | sort -u)"
+output="$(./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
View
@@ -4,7 +4,7 @@ export LANG=C
set -e
# Read out the test directory using virt-ls.
-if [ "$(./virt-ls ../images/fedora.img /bin)" != "ls
+if [ "$(./virt-ls ../tests/guests/fedora.img /bin)" != "ls
test1
test2
test3
@@ -17,7 +17,7 @@ test7" ]; then
fi
# Try the -lR option.
-output="$(./virt-ls -lR ../images/fedora.img /boot | awk '{print $1 $2 $4}')"
+output="$(./virt-ls -lR ../tests/guests/fedora.img /boot | awk '{print $1 $2 $4}')"
expected="d0755/boot
d0755/boot/grub
-0644/boot/grub/grub.conf
@@ -26,7 +26,7 @@ fi
rm -f test.img guestfish
-qemu-img create -f qcow2 -o backing_file=../images/fedora.img test.img
+qemu-img create -f qcow2 -o backing_file=../tests/guests/fedora.img test.img
# Provide alternate 'virt-inspector' and 'guestmount' binaries
# that run the just-built programs.
View
@@ -1022,7 +1022,6 @@ AC_CONFIG_FILES([Makefile
gnulib/lib/Makefile
gnulib/tests/Makefile
haskell/Makefile
- images/Makefile
inspector/Makefile
java/Makefile
java/examples/Makefile
@@ -1049,7 +1048,9 @@ AC_CONFIG_FILES([Makefile
src/Makefile
test-tool/Makefile
tests/c-api/Makefile
+ tests/data/Makefile
tests/extra/Makefile
+ tests/guests/Makefile
tests/luks/Makefile
tests/lvm/Makefile
tests/md/Makefile
View
@@ -4,7 +4,7 @@ export LANG=C
set -e
# Run virt-df.
-output=$(./virt-df ../images/fedora.img)
+output=$(./virt-df ../tests/guests/fedora.img)
# Check title is the first line.
if [[ ! $output =~ ^Filesystem.* ]]; then
View
@@ -5,7 +5,7 @@ set -e
# Make a copy of the Fedora image so we can write to it then
# discard it.
-cp ../images/fedora.img test.img
+cp ../tests/guests/fedora.img test.img
# Edit interactively. We have to simulate this by setting $EDITOR.
# The command will be: echo newline >> /tmp/file
View
@@ -32,13 +32,13 @@ rm -f test1.img
rm -rf original copy
mkdir original
-cp $srcdir/../images/known* original
-cp -P $srcdir/../images/abssymlink* original
+cp $srcdir/../tests/data/known* original
+cp -P $srcdir/../tests/data/abssymlink* original
output=$(
../fish/guestfish -N fs -m /dev/sda1 <<EOF
mkdir /data
-# This creates a directory /data/images/
+# This creates a directory /data/data/
copy-in original /data
is-file /data/original/known-1
is-file /data/original/known-3
View
@@ -23,7 +23,7 @@ set -e
rm -f test.out
../fish/guestfish <<'EOF'
-add-ro ../images/test.iso
+add-ro ../tests/data/test.iso
run
mount-ro /dev/sda /
find0 / test.out
View
@@ -23,12 +23,12 @@ set -e
rm -f test.out
../fish/guestfish <<'EOF' > test.out
-add-ro ../images/test.iso
+add-ro ../tests/data/test.iso
run
mount-ro /dev/sda /
read-file /helloworld.tar
EOF
-cmp ../images/helloworld.tar test.out
+cmp ../tests/data/helloworld.tar test.out
rm -f test.out
@@ -24,7 +24,7 @@ set -e
rm -f test1.img test.out
-if ../fish/guestfish -N fs -m /dev/sda1 upload ../images/test.iso / 2>test.out
+if ../fish/guestfish -N fs -m /dev/sda1 upload ../tests/data/test.iso / 2>test.out
then
echo "$0: expecting guestfish to return an error"
exit 1
@@ -2818,7 +2818,7 @@ To get the checksums for many files, use C<guestfs_checksums_out>.");
("tar_in", (RErr, [FileIn "tarfile"; Pathname "directory"], []), 69, [],
[InitScratchFS, Always, TestOutput (
[["mkdir"; "/tar_in"];
- ["tar_in"; "../images/helloworld.tar"; "/tar_in"];
+ ["tar_in"; "../data/helloworld.tar"; "/tar_in"];
["cat"; "/tar_in/hello"]], "hello\n")],
"unpack tarfile to directory",
"\
@@ -2841,7 +2841,7 @@ or C<guestfs_txz_out>.");
("tgz_in", (RErr, [FileIn "tarball"; Pathname "directory"], []), 71, [],
[InitScratchFS, Always, TestOutput (
[["mkdir"; "/tgz_in"];
- ["tgz_in"; "../images/helloworld.tar.gz"; "/tgz_in"];
+ ["tgz_in"; "../data/helloworld.tar.gz"; "/tgz_in"];
["cat"; "/tgz_in/hello"]], "hello\n")],
"unpack compressed tarball to directory",
"\
@@ -5385,7 +5385,7 @@ or growing unnecessarily.");
("txz_in", (RErr, [FileIn "tarball"; Pathname "directory"], []), 229, [Optional "xz"],
[InitScratchFS, Always, TestOutput (
[["mkdir"; "/txz_in"];
- ["txz_in"; "../images/helloworld.tar.xz"; "/txz_in"];
+ ["txz_in"; "../data/helloworld.tar.xz"; "/txz_in"];
["cat"; "/txz_in/hello"]], "hello\n")],
"unpack compressed tarball to directory",
"\
@@ -5482,7 +5482,7 @@ types (see C<guestfs_part_get_parttype>).");
("checksum_device", (RString "checksum", [String "csumtype"; Device "device"], []), 237, [],
[InitISOFS, Always, TestOutputFileMD5 (
[["checksum_device"; "md5"; "/dev/sdd"]],
- "../images/test.iso")],
+ "../data/test.iso")],
"compute MD5, SHAx or CRC checksum of the contents of a device",
"\
This call computes the MD5, SHAx or CRC checksum of the
@@ -5532,7 +5532,7 @@ to find out what it is for.");
("base64_in", (RErr, [FileIn "base64file"; Pathname "filename"], []), 242, [],
[InitScratchFS, Always, TestOutput (
- [["base64_in"; "../images/hello.b64"; "/base64_in"];
+ [["base64_in"; "../data/hello.b64"; "/base64_in"];
["cat"; "/base64_in"]], "hello\n")],
"upload base64-encoded data to file",
"\
@@ -257,8 +257,8 @@ int main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
- if (guestfs_add_drive_ro (g, \"../../images/test.iso\") == -1) {
- printf (\"guestfs_add_drive_ro ../../images/test.iso FAILED\\n\");
+ if (guestfs_add_drive_ro (g, \"../data/test.iso\") == -1) {
+ printf (\"guestfs_add_drive_ro ../data/test.iso FAILED\\n\");
exit (EXIT_FAILURE);
}
View
@@ -101,18 +101,18 @@ endif
example-debian.xml:
rm -f $@ $@-t
- ../run $(builddir)/virt-inspector ../images/debian.img > $@-t
+ ../run $(builddir)/virt-inspector ../tests/guests/debian.img > $@-t
mv $@-t $@
example-fedora.xml:
rm -f $@ $@-t
- ../run $(builddir)/virt-inspector ../images/fedora.img > $@-t
+ ../run $(builddir)/virt-inspector ../tests/guests/fedora.img > $@-t
mv $@-t $@
example-ubuntu.xml:
rm -f $@ $@-t
- ../run $(builddir)/virt-inspector ../images/ubuntu.img > $@-t
+ ../run $(builddir)/virt-inspector ../tests/guests/ubuntu.img > $@-t
mv $@-t $@
example-windows.xml:
rm -f $@ $@-t
- ../run $(builddir)/virt-inspector ../images/windows.img | \
+ ../run $(builddir)/virt-inspector ../tests/guests/windows.img | \
fgrep -v '<uuid>' > $@-t
mv $@-t $@
View
@@ -46,7 +46,7 @@ src_deps: $(top_builddir)/src/libguestfs.la $(generator_built)
# Images used by tests
.PHONY: test_images
test_images:
- $(MAKE) -C $(top_builddir)/images
+ $(MAKE) -C $(top_builddir)/tests/data
TESTS = run-bindtests run-perl-tests
View
@@ -137,10 +137,6 @@ perl/lib/Sys/Guestfs/Lib.pm
php/extension/guestfs_php.c
python/guestfs-py-byhand.c
python/guestfs-py.c
-regressions/rhbz501893.c
-regressions/test-launch-race.pl
-regressions/test-lvm-mapping.pl
-regressions/test-noexec-stack.pl
rescue/virt-rescue.c
resize/progress_c.c
ruby/ext/guestfs/_guestfs.c
View
@@ -2964,12 +2964,6 @@ L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs.
The crucially important generator, used to automatically generate
large amounts of boilerplate C code for things like RPC and bindings.
-=item C<images>
-
-Files used by the test suite.
-
-Some "phony" guest images which we test against.
-
=item C<inspector>
L<virt-inspector(1)>, the virtual machine image inspector.
Oops, something went wrong.

0 comments on commit cd077b8

Please sign in to comment.