tests: guests: Auto-generated guests-all-good.xml.

Only include guests which we successfully created, so for example if
there's no NTFS support then the Windows guest won't be included.
This commit is contained in:
Richard W.M. Jones
2013-04-17 20:06:24 +01:00
parent 0c605eb94f
commit 2ae72dcaf8
4 changed files with 80 additions and 228 deletions

View File

@@ -1599,7 +1599,6 @@ AC_CONFIG_FILES([Makefile
tests/disk-labels/Makefile
tests/guests/Makefile
tests/guests/guests.xml
tests/guests/guests-all-good.xml
tests/hotplug/Makefile
tests/luks/Makefile
tests/lvm/Makefile

View File

@@ -37,9 +37,7 @@ EXTRA_DIST = \
guest-aux/minimal-hive \
guests.xml.in
# 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 = \
blank-disk.img \
blank-part.img \
blank-fs.img \
@@ -53,6 +51,10 @@ check_DATA = \
ubuntu.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
CLEANFILES = $(check_DATA) stamp-fedora-md.img *.tmp.*
# Macro to display some information about each created disk, which
@@ -143,6 +145,11 @@ guest-aux/windows-system: guest-aux/windows-system.reg
hivexregedit --merge $@-t --prefix 'HKEY_LOCAL_MACHINE\SYSTEM' $<
mv $@-t $@
guests-all-good.xml: $(disk_images) guest-aux/make-guests-all-good.pl
rm -f $@ $@-t
guest-aux/make-guests-all-good.pl $(disk_images) > $@-t
mv $@-t $@
# 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
# to fall over on machines with limited memory.

View File

@@ -0,0 +1,70 @@
#!/usr/bin/perl
# libguestfs
# Copyright (C) 2013 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.
# Make the ../guests-all-good.xml file.
use strict;
use warnings;
my $outdir = `pwd`; chomp $outdir;
print <<__EOT__;
<!--
This file is generated from $0.
ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
To use the test guests by name, specify the following libvirt URI:
test://\$(abs_builddir)/guests-all-good.xml
eg:
./run ./df/virt-df -c test://$outdir/guests-all-good.xml
./run ./align/virt-alignment-scan -c test://$outdir/guests-all-good.xml
Note this differs from 'guests.xml' just in that none of these guests
have missing disks, etc.
-->
<node>
__EOT__
foreach (@ARGV) {
my $name = $_;
$name =~ s/.img//;
if (-f $_ && -s $_) {
print <<__EOT__;
<domain type='test'>
<name>$name</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='$outdir/$_'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
__EOT__
}
}
print "</node>";

View File

@@ -1,224 +0,0 @@
<!--
libguestfs test images
@configure_input@
Copyright (C) 2013 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.
To use the test guests by name, specify the following libvirt URI:
test://$(abs_builddir)/guests-all-good.xml
eg:
./run ./df/virt-df -c test://@abs_builddir@/guests-all-good.xml
./run ./align/virt-alignment-scan -c test://@abs_builddir@/guests-all-good.xml
Note this differs from 'guests.xml' just in that none of these guests
have missing disks, etc.
-->
<node>
<domain type='test'>
<name>blank-bootroot</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/blank-bootroot.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>blank-bootrootlv</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/blank-bootrootlv.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>blank-disk</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/blank-disk.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>blank-fs</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/blank-fs.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>blank-part</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/blank-part.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>debian</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/debian.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>fedora-btrfs</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/fedora-btrfs.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>fedora</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/fedora.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>fedora-md1</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/fedora-md1.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>fedora-md2</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/fedora-md2.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>ubuntu</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/ubuntu.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
<domain type='test'>
<name>windows</name>
<memory>1048576</memory>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='file' device='disk'>
<driver name='qemu'/>
<source file='@abs_builddir@/windows.img'/>
<target dev='vda' bus='virtio'/>
</disk>
</devices>
</domain>
</node>