diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-12-22 12:15:06 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-12-22 15:48:11 +0000 |
commit | cd077b8229731e292798f34dd56892cbfa6f1e0e (patch) | |
tree | d7c2fb6e9d8c34b8f73152c297f243eee74dc450 /tests/data | |
parent | c649817586e5b4df53b251d1290422f5ef046045 (diff) | |
download | libguestfs-cd077b8229731e292798f34dd56892cbfa6f1e0e.tar.gz libguestfs-cd077b8229731e292798f34dd56892cbfa6f1e0e.tar.xz libguestfs-cd077b8229731e292798f34dd56892cbfa6f1e0e.zip |
tests: Split images -> tests/data + tests/guests
Diffstat (limited to 'tests/data')
23 files changed, 206 insertions, 0 deletions
diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am new file mode 100644 index 00000000..43f40a19 --- /dev/null +++ b/tests/data/Makefile.am @@ -0,0 +1,152 @@ +# libguestfs test images +# Copyright (C) 2009-2010 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 + +# Old RHEL 5 autoconf doesn't have builddir. +builddir ?= $(top_builddir)/tests/data + +EXTRA_DIST = \ + 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-i586-dynamic \ + bin-sparc-dynamic \ + bin-win32.exe \ + bin-win64.exe \ + bin-x86_64-dynamic \ + lib-i586.so \ + lib-sparc.so \ + lib-win32.dll \ + lib-win64.dll \ + lib-x86_64.so \ + test-grep.txt + +noinst_DATA = test.iso + +CLEANFILES = \ + test.iso test.sqsh \ + 100kallzeroes 100kallnewlines 100kallspaces 100krandom 10klines \ + initrd + +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-i586-dynamic \ + $(srcdir)/bin-sparc-dynamic \ + $(srcdir)/bin-win32.exe \ + $(srcdir)/bin-win64.exe \ + $(srcdir)/bin-x86_64-dynamic \ + $(srcdir)/lib-i586.so \ + $(srcdir)/lib-sparc.so \ + $(srcdir)/lib-win32.dll \ + $(srcdir)/lib-win64.dll \ + $(srcdir)/lib-x86_64.so \ + $(srcdir)/test-grep.txt + +images_files_build = \ + $(builddir)/100kallzeroes \ + $(builddir)/100kallnewlines \ + $(builddir)/100kallspaces \ + $(builddir)/100krandom \ + $(builddir)/10klines \ + $(builddir)/abssymlink \ + $(builddir)/hello.b64 \ + $(builddir)/initrd \ + $(builddir)/initrd-x86_64.img \ + $(builddir)/initrd-x86_64.img.gz \ + $(builddir)/test-grep.txt.gz + +images_files = $(images_files_src) $(images_files_build) + +test.iso: $(images_files) + rm -f $@ $@-t + mkdir -p directory + $(GENISOIMAGE) -J -r -graft-points \ + -o $@-t \ + $(images_files) /directory=directory + rmdir directory + mv $@-t $@ + +$(builddir)/100kallzeroes: + rm -f $@ $@-t + dd if=/dev/zero of=$@-t bs=1024 count=100 + mv $@-t $@ + +$(builddir)/100kallnewlines: $(builddir)/100kallzeroes + rm -f $@ $@-t + tr '\0' '\n' < $< > $@-t + mv $@-t $@ + +$(builddir)/100kallspaces: $(builddir)/100kallzeroes + rm -f $@ $@-t + tr '\0' ' ' < $< > $@-t + mv $@-t $@ + +$(builddir)/100krandom: + rm -f $@ $@-t + dd if=/dev/urandom of=$@-t bs=1024 count=100 + mv $@-t $@ + +$(builddir)/10klines: + rm -f $@ $@-t + i=0; \ + while [ $$i -lt 10000 ]; do \ + echo "$${i}abcdefghijklmnopqrstuvwxyz"; \ + i=$$(($$i+1)); \ + done > $@-t + mv $@-t $@ + +$(builddir)/abssymlink: + ln -sf /10klines $@ + +$(builddir)/hello.b64: + echo "hello" | base64 > $@ + +$(builddir)/initrd: empty known-1 known-2 known-3 known-4 known-5 + rm -f $@ $@-t + for f in $^; do echo $$f; done | cpio -o -H newc | gzip --best > $@-t + mv $@-t $@ + +# Create a dummy initrd with a single file called 'bin/nash' which +# is used to test the Sys::Guestfs::Lib::file_architecture function. +$(builddir)/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 + +$(builddir)/initrd-x86_64.img.gz: initrd-x86_64.img + rm -f $@ $@-t + gzip --best -c $< > $@-t + mv $@-t $@ + +$(builddir)/test-grep.txt.gz: test-grep.txt + rm -f $@ $@-t + gzip --best -c $< > $@-t + mv $@-t $@ diff --git a/tests/data/README-binfiles b/tests/data/README-binfiles new file mode 100644 index 00000000..f99fc847 --- /dev/null +++ b/tests/data/README-binfiles @@ -0,0 +1,13 @@ +The bin-* and lib-* files are used for testing the +Sys::Guestfs::Lib::file_architecture API. + +The bin-* files are generated from empty source files (ie. +"main(){}") on the respective architectures. + +The lib-* files are generated from a (really) empty source file called +lib.c which is linked into a library using gcc -shared on the +respective architectures. + +If you are concerned that these binary files "lack source" then you +can just remove them, but you may need to patch out tests in the perl/ +directory. diff --git a/tests/data/bin-i586-dynamic b/tests/data/bin-i586-dynamic Binary files differnew file mode 100755 index 00000000..4f770633 --- /dev/null +++ b/tests/data/bin-i586-dynamic diff --git a/tests/data/bin-sparc-dynamic b/tests/data/bin-sparc-dynamic Binary files differnew file mode 100755 index 00000000..138839af --- /dev/null +++ b/tests/data/bin-sparc-dynamic diff --git a/tests/data/bin-win32.exe b/tests/data/bin-win32.exe Binary files differnew file mode 100755 index 00000000..db6d5758 --- /dev/null +++ b/tests/data/bin-win32.exe diff --git a/tests/data/bin-win64.exe b/tests/data/bin-win64.exe Binary files differnew file mode 100755 index 00000000..98bddc02 --- /dev/null +++ b/tests/data/bin-win64.exe diff --git a/tests/data/bin-x86_64-dynamic b/tests/data/bin-x86_64-dynamic Binary files differnew file mode 100755 index 00000000..033ac759 --- /dev/null +++ b/tests/data/bin-x86_64-dynamic diff --git a/tests/data/empty b/tests/data/empty new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/data/empty diff --git a/tests/data/helloworld.tar b/tests/data/helloworld.tar Binary files differnew file mode 100644 index 00000000..191a31b2 --- /dev/null +++ b/tests/data/helloworld.tar diff --git a/tests/data/helloworld.tar.gz b/tests/data/helloworld.tar.gz Binary files differnew file mode 100644 index 00000000..9d36cc97 --- /dev/null +++ b/tests/data/helloworld.tar.gz diff --git a/tests/data/helloworld.tar.xz b/tests/data/helloworld.tar.xz Binary files differnew file mode 100644 index 00000000..661f1a20 --- /dev/null +++ b/tests/data/helloworld.tar.xz diff --git a/tests/data/known-1 b/tests/data/known-1 new file mode 100644 index 00000000..8baef1b4 --- /dev/null +++ b/tests/data/known-1 @@ -0,0 +1 @@ +abc diff --git a/tests/data/known-2 b/tests/data/known-2 new file mode 100644 index 00000000..0373d933 --- /dev/null +++ b/tests/data/known-2 @@ -0,0 +1 @@ +abcdef diff --git a/tests/data/known-3 b/tests/data/known-3 new file mode 100644 index 00000000..3ac370d7 --- /dev/null +++ b/tests/data/known-3 @@ -0,0 +1,27 @@ + I WANDERED lonely as a cloud + That floats on high o'er vales and hills, + When all at once I saw a crowd, + A host, of golden daffodils; + Beside the lake, beneath the trees, + Fluttering and dancing in the breeze. + + Continuous as the stars that shine + And twinkle on the milky way, + They stretched in never-ending line + Along the margin of a bay: + Ten thousand saw I at a glance, + Tossing their heads in sprightly dance. + + The waves beside them danced; but they + Out-did the sparkling waves in glee: + A poet could not but be gay, + In such a jocund company: + I gazed--and gazed--but little thought + What wealth the show to me had brought: + + For oft, when on my couch I lie + In vacant or in pensive mood, + They flash upon that inward eye + Which is the bliss of solitude; + And then my heart with pleasure fills, + And dances with the daffodils. diff --git a/tests/data/known-4 b/tests/data/known-4 new file mode 100644 index 00000000..f5bc74f6 --- /dev/null +++ b/tests/data/known-4 @@ -0,0 +1,3 @@ +abc +def +ghi
\ No newline at end of file diff --git a/tests/data/known-5 b/tests/data/known-5 new file mode 100644 index 00000000..3122d943 --- /dev/null +++ b/tests/data/known-5 @@ -0,0 +1,2 @@ +abcdefghi +jklmnopqr
\ No newline at end of file diff --git a/tests/data/lib-i586.so b/tests/data/lib-i586.so Binary files differnew file mode 100755 index 00000000..e82023a1 --- /dev/null +++ b/tests/data/lib-i586.so diff --git a/tests/data/lib-sparc.so b/tests/data/lib-sparc.so Binary files differnew file mode 100755 index 00000000..7feec75e --- /dev/null +++ b/tests/data/lib-sparc.so diff --git a/tests/data/lib-win32.dll b/tests/data/lib-win32.dll Binary files differnew file mode 100755 index 00000000..e1a2d2e6 --- /dev/null +++ b/tests/data/lib-win32.dll diff --git a/tests/data/lib-win64.dll b/tests/data/lib-win64.dll Binary files differnew file mode 100755 index 00000000..ca94485c --- /dev/null +++ b/tests/data/lib-win64.dll diff --git a/tests/data/lib-x86_64.so b/tests/data/lib-x86_64.so Binary files differnew file mode 100755 index 00000000..8cee4d20 --- /dev/null +++ b/tests/data/lib-x86_64.so diff --git a/tests/data/mbr-ext2-empty.img.gz b/tests/data/mbr-ext2-empty.img.gz Binary files differnew file mode 100644 index 00000000..5438c1dd --- /dev/null +++ b/tests/data/mbr-ext2-empty.img.gz diff --git a/tests/data/test-grep.txt b/tests/data/test-grep.txt new file mode 100644 index 00000000..1d24b9a0 --- /dev/null +++ b/tests/data/test-grep.txt @@ -0,0 +1,7 @@ +abc +def +ghi +ghi + +abc123 +ABC |