From 4d900cdac8258daa2e99c6ceb2a4985154e94150 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 11 Nov 2010 16:20:25 +0000 Subject: [PATCH] Generate a dummy 'Fedora' fedora.img in images directory for use by tests. We were generating this dummy 'Fedora' image already in the tools directory. It contains just enough Fedora-like files to fool our inspection code and thus to test the tools. This is general enough that we can use it everywhere. --- .gitignore | 1 + images/Makefile.am | 17 ++++++++++--- .../make-dummy-fedora-img.sh | 20 ++++++++-------- regressions/test-copy.sh | 28 ++++++++++++---------- tools/Makefile.am | 6 ----- tools/test-virt-cat.sh | 4 ++-- tools/test-virt-df.sh | 12 +++++----- tools/test-virt-list-filesystems.sh | 3 ++- tools/test-virt-ls.sh | 2 +- tools/test-virt-tar.sh | 2 +- 10 files changed, 53 insertions(+), 42 deletions(-) rename tools/make-test-img.sh => images/make-dummy-fedora-img.sh (84%) diff --git a/.gitignore b/.gitignore index 180e17e..e968ffd 100644 --- a/.gitignore +++ b/.gitignore @@ -120,6 +120,7 @@ images/100kallzeroes images/100krandom images/10klines images/abssymlink +images/fedora.img images/hello.b64 images/initrd images/initrd-x86_64.img diff --git a/images/Makefile.am b/images/Makefile.am index 771018f..b1b4855 100644 --- a/images/Makefile.am +++ b/images/Makefile.am @@ -1,5 +1,5 @@ # libguestfs test images -# Copyright (C) 2009 Red Hat Inc. +# 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 @@ -36,14 +36,19 @@ EXTRA_DIST = \ lib-win32.dll \ lib-win64.dll \ lib-x86_64.so \ - test-grep.txt + test-grep.txt \ + make-dummy-fedora-img.sh noinst_DATA = test.iso +# 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 = fedora.img + CLEANFILES = \ test.iso test.sqsh \ 100kallzeroes 100kallnewlines 100kallspaces 100krandom 10klines \ - initrd + initrd fedora.img images_files_src = \ $(srcdir)/helloworld.tar \ @@ -150,3 +155,9 @@ $(builddir)/test-grep.txt.gz: test-grep.txt rm -f $@ $@-t gzip --best -c $< > $@-t mv $@-t $@ + +# Make a (dummy) Fedora image. +fedora.img: make-dummy-fedora-img.sh + LIBGUESTFS_PATH=../appliance \ + LD_LIBRARY_PATH=../src/.libs \ + bash $< diff --git a/tools/make-test-img.sh b/images/make-dummy-fedora-img.sh similarity index 84% rename from tools/make-test-img.sh rename to images/make-dummy-fedora-img.sh index fddd8a2..635ad10 100755 --- a/tools/make-test-img.sh +++ b/images/make-dummy-fedora-img.sh @@ -1,5 +1,5 @@ #!/bin/bash - -# libguestfs virt-* tools +# libguestfs # Copyright (C) 2010 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify @@ -16,24 +16,24 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# Make a standard test image which is used by all the tools/test-*.sh -# test scripts. This test image is supposed to look like a Fedora -# installation, or at least enough of one to fool virt-inspector's +# Make a standard test image which is used by all the tools test +# scripts. This test image is supposed to look like a Fedora +# installation, or at least enough of one to fool the inspection API # heuristics. export LANG=C set -e -rm -f test.img +rm -f fedora.img -cat > fstab < fstab.tmp <