From 4d900cdac8258daa2e99c6ceb2a4985154e94150 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 11 Nov 2010 16:20:25 +0000 Subject: 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 +++++-- images/make-dummy-fedora-img.sh | 89 +++++++++++++++++++++++++++++++++++++ regressions/test-copy.sh | 28 +++++++----- tools/Makefile.am | 6 --- tools/make-test-img.sh | 89 ------------------------------------- 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 +- 11 files changed, 132 insertions(+), 121 deletions(-) create mode 100755 images/make-dummy-fedora-img.sh delete mode 100755 tools/make-test-img.sh diff --git a/.gitignore b/.gitignore index 180e17e7..e968ffd9 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 771018fc..b1b4855c 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/images/make-dummy-fedora-img.sh b/images/make-dummy-fedora-img.sh new file mode 100755 index 00000000..635ad108 --- /dev/null +++ b/images/make-dummy-fedora-img.sh @@ -0,0 +1,89 @@ +#!/bin/bash - +# libguestfs +# Copyright (C) 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +# 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 fedora.img + +cat > fstab.tmp < fstab <