From 5ff3845d280515ab623d22666c3f5013f095d32a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 26 Feb 2013 16:47:38 +0000 Subject: [PATCH] tests: guests: Add blank disks plus libvirt test:// XML. You can now run virt-df and virt-alignment-scan on all of the test guests by doing: ./run ./df/virt-df -c test:///path/to/tests/guests/guests.xml ./run ./align/virt-alignment-scan -c test:///path/to/tests/guests/guests.xml which is kinda cool. --- .gitignore | 2 + configure.ac | 1 + tests/guests/Makefile.am | 30 ++++- tests/guests/guests.xml.in | 250 +++++++++++++++++++++++++++++++++++++ 4 files changed, 281 insertions(+), 2 deletions(-) create mode 100644 tests/guests/guests.xml.in diff --git a/.gitignore b/.gitignore index 74004908b..0747430bc 100644 --- a/.gitignore +++ b/.gitignore @@ -429,11 +429,13 @@ Makefile.in /tests/data/initrd-x86_64.img.gz /tests/data/test-grep.txt.gz /tests/data/test.iso +/tests/guests/blank-*.img /tests/guests/debian.img /tests/guests/fedora.img /tests/guests/fedora-btrfs.img /tests/guests/fedora-md1.img /tests/guests/fedora-md2.img +/tests/guests/guests.xml /tests/guests/guest-aux/fedora-name.db /tests/guests/guest-aux/fedora-packages.db /tests/guests/stamp-fedora-md.img diff --git a/configure.ac b/configure.ac index ffd46fce3..a7b83d47f 100644 --- a/configure.ac +++ b/configure.ac @@ -1566,6 +1566,7 @@ AC_CONFIG_FILES([Makefile tests/disks/Makefile tests/disk-labels/Makefile tests/guests/Makefile + tests/guests/guests.xml tests/hotplug/Makefile tests/luks/Makefile tests/lvm/Makefile diff --git a/tests/guests/Makefile.am b/tests/guests/Makefile.am index 834d69c01..bef3c2570 100644 --- a/tests/guests/Makefile.am +++ b/tests/guests/Makefile.am @@ -34,14 +34,37 @@ EXTRA_DIST = \ guest-aux/windows-software.reg \ guest-aux/windows-system \ guest-aux/windows-system.reg \ - guest-aux/minimal-hive + 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 = debian.img fedora.img fedora-md1.img fedora-md2.img fedora-btrfs.img ubuntu.img windows.img +check_DATA = \ + blank-disk.img \ + blank-part.img \ + blank-fs.img \ + blank-bootroot.img \ + blank-bootrootlv.img \ + debian.img \ + fedora.img \ + fedora-md1.img \ + fedora-md2.img \ + fedora-btrfs.img \ + ubuntu.img \ + windows.img CLEANFILES = $(check_DATA) stamp-fedora-md.img *.tmp.* +# Make several different blank images. These are not guests, but we +# include them in the libvirt fake XML to make sure that virt-df and +# virt-alignment-scan don't break when they encounter them. +blank-%.img: + rm -f $@ test1.img + $(top_builddir)/run \ + ../../fish/guestfish \ + -N "$$(echo $@ | sed -e 's/blank-//' -e 's/.img//')" exit + mv test1.img $@ + # Make a (dummy) Fedora image. fedora.img: guest-aux/make-fedora-img.pl \ guest-aux/fedora-name.db \ @@ -105,4 +128,7 @@ guest-aux/windows-system: guest-aux/windows-system.reg # 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. +# +# ALSO: the guestfish rules above for making the blank-*.img files are +# NOT safe to run in parallel. .NOTPARALLEL: diff --git a/tests/guests/guests.xml.in b/tests/guests/guests.xml.in new file mode 100644 index 000000000..57c5faa06 --- /dev/null +++ b/tests/guests/guests.xml.in @@ -0,0 +1,250 @@ + + + + + + nodisks + 1048576 + + hvm + + + + + + + + + missing-disks + 1048576 + + hvm + + + + + + + + + + + + + blank-bootroot + 1048576 + + hvm + + + + + + + + + + + + + blank-bootrootlv + 1048576 + + hvm + + + + + + + + + + + + + blank-disk + 1048576 + + hvm + + + + + + + + + + + + + blank-fs + 1048576 + + hvm + + + + + + + + + + + + + blank-part + 1048576 + + hvm + + + + + + + + + + + + + debian + 1048576 + + hvm + + + + + + + + + + + + + fedora-btrfs + 1048576 + + hvm + + + + + + + + + + + + + fedora + 1048576 + + hvm + + + + + + + + + + + + + fedora-md1 + 1048576 + + hvm + + + + + + + + + + + + + fedora-md2 + 1048576 + + hvm + + + + + + + + + + + + + ubuntu + 1048576 + + hvm + + + + + + + + + + + + + windows + 1048576 + + hvm + + + + + + + + + + + +