Richard W.M. Jones
2014-Apr-03 07:59 UTC
[Libguestfs] [PATCH 0/3] builder: Add test of virt-index-validate.
Somewhat ineffective test of virt-index-validate.
Richard W.M. Jones
2014-Apr-03 07:59 UTC
[Libguestfs] [PATCH 1/3] builder: Don't use configure to generate test-index file.
The file contained no replacement patterns so generating it with configure did nothing. --- .gitignore | 1 - builder/Makefile.am | 1 + builder/test-index | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ builder/test-index.in | 66 --------------------------------------------------- configure.ac | 1 - 5 files changed, 67 insertions(+), 68 deletions(-) create mode 100644 builder/test-index delete mode 100644 builder/test-index.in diff --git a/.gitignore b/.gitignore index 1d3311a..dc8aaf8 100644 --- a/.gitignore +++ b/.gitignore @@ -65,7 +65,6 @@ Makefile.in /builder/stamp-virt-builder.pod /builder/stamp-virt-index-validate.pod /builder/test-config/virt-builder/repos.d/test-index.conf -/builder/test-index /builder/test-website/virt-builder/repos.d/libguestfs.conf /builder/virt-builder /builder/virt-builder.1 diff --git a/builder/Makefile.am b/builder/Makefile.am index 3be547c..92a09bc 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -29,6 +29,7 @@ AM_CFLAGS = \ EXTRA_DIST = \ $(SOURCES) \ libguestfs.gpg \ + test-index \ virt-builder.pod \ virt-index-validate.pod \ test-virt-builder.sh \ diff --git a/builder/test-index b/builder/test-index new file mode 100644 index 0000000..3efebc4 --- /dev/null +++ b/builder/test-index @@ -0,0 +1,66 @@ +[phony-debian] +name=Phony Debian +arch=x86_64 +file=debian.xz +format=raw +size=536870912 +expand=/dev/sda2 +lvexpand=/dev/debian/root +notes=Phony Debian look-alike used for testing. + +[phony-fedora] +name=Phony Fedora +arch=x86_64 +file=fedora.xz +format=raw +size=1073741824 +expand=/dev/sda2 +lvexpand=/dev/VG/Root +notes=Phony Fedora look-alike used for testing. + +[phony-fedora-qcow2] +name=Phony Fedora qcow2 +arch=x86_64 +file=fedora.qcow2.xz +format=qcow2 +size=1073741824 +expand=/dev/sda2 +lvexpand=/dev/VG/Root +notes=Phony Fedora look-alike used for testing. + +[phony-fedora-qcow2-uncompressed] +name=Phony Fedora qcow2 uncompressed +arch=x86_64 +file=fedora.qcow2 +format=qcow2 +size=1073741824 +expand=/dev/sda2 +lvexpand=/dev/VG/Root +notes=Phony Fedora look-alike used for testing. + +[phony-fedora-no-format] +name=Phony Fedora +arch=x86_64 +file=fedora.qcow2.xz +size=1073741824 +expand=/dev/sda2 +lvexpand=/dev/VG/Root +notes=Phony Fedora look-alike used for testing. + +[phony-ubuntu] +name=Phony Ubuntu +arch=x86_64 +file=ubuntu.xz +format=raw +size=536870912 +expand=/dev/sda2 +notes=Phony Ubuntu look-alike used for testing. + +[phony-windows] +name=Phony Windows +arch=x86_64 +file=windows.xz +format=raw +size=536870912 +expand=/dev/sda2 +notes=Phony Windows look-alike used for testing. diff --git a/builder/test-index.in b/builder/test-index.in deleted file mode 100644 index 3efebc4..0000000 --- a/builder/test-index.in +++ /dev/null @@ -1,66 +0,0 @@ -[phony-debian] -name=Phony Debian -arch=x86_64 -file=debian.xz -format=raw -size=536870912 -expand=/dev/sda2 -lvexpand=/dev/debian/root -notes=Phony Debian look-alike used for testing. - -[phony-fedora] -name=Phony Fedora -arch=x86_64 -file=fedora.xz -format=raw -size=1073741824 -expand=/dev/sda2 -lvexpand=/dev/VG/Root -notes=Phony Fedora look-alike used for testing. - -[phony-fedora-qcow2] -name=Phony Fedora qcow2 -arch=x86_64 -file=fedora.qcow2.xz -format=qcow2 -size=1073741824 -expand=/dev/sda2 -lvexpand=/dev/VG/Root -notes=Phony Fedora look-alike used for testing. - -[phony-fedora-qcow2-uncompressed] -name=Phony Fedora qcow2 uncompressed -arch=x86_64 -file=fedora.qcow2 -format=qcow2 -size=1073741824 -expand=/dev/sda2 -lvexpand=/dev/VG/Root -notes=Phony Fedora look-alike used for testing. - -[phony-fedora-no-format] -name=Phony Fedora -arch=x86_64 -file=fedora.qcow2.xz -size=1073741824 -expand=/dev/sda2 -lvexpand=/dev/VG/Root -notes=Phony Fedora look-alike used for testing. - -[phony-ubuntu] -name=Phony Ubuntu -arch=x86_64 -file=ubuntu.xz -format=raw -size=536870912 -expand=/dev/sda2 -notes=Phony Ubuntu look-alike used for testing. - -[phony-windows] -name=Phony Windows -arch=x86_64 -file=windows.xz -format=raw -size=536870912 -expand=/dev/sda2 -notes=Phony Windows look-alike used for testing. diff --git a/configure.ac b/configure.ac index 2b92058..70d5afc 100644 --- a/configure.ac +++ b/configure.ac @@ -1614,7 +1614,6 @@ AC_CONFIG_FILES([Makefile builder/Makefile builder/libguestfs.conf builder/test-config/virt-builder/repos.d/test-index.conf - builder/test-index builder/test-website/virt-builder/repos.d/libguestfs.conf builder/website/Makefile cat/Makefile -- 1.8.5.3
Richard W.M. Jones
2014-Apr-03 07:59 UTC
[Libguestfs] [PATCH 2/3] builder: Rearrange EXTRA_DIST in alphabetical order.
No functional change. --- builder/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/Makefile.am b/builder/Makefile.am index 92a09bc..56e8929 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -30,11 +30,11 @@ EXTRA_DIST = \ $(SOURCES) \ libguestfs.gpg \ test-index \ - virt-builder.pod \ - virt-index-validate.pod \ test-virt-builder.sh \ test-virt-builder-list.sh \ - test-virt-builder-planner.sh + test-virt-builder-planner.sh \ + virt-builder.pod \ + virt-index-validate.pod CLEANFILES = *~ *.cmi *.cmo *.cmx *.cmxa *.o virt-builder -- 1.8.5.3
Richard W.M. Jones
2014-Apr-03 07:59 UTC
[Libguestfs] [PATCH 3/3] builder: Add test of virt-index-validate.
--- builder/Makefile.am | 8 +++++++- builder/test-virt-index-validate-bad-1 | 8 ++++++++ builder/test-virt-index-validate-good-1 | 0 builder/test-virt-index-validate-good-2 | 2 ++ builder/test-virt-index-validate.sh | 24 ++++++++++++++++++++++++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 builder/test-virt-index-validate-bad-1 create mode 100644 builder/test-virt-index-validate-good-1 create mode 100644 builder/test-virt-index-validate-good-2 create mode 100755 builder/test-virt-index-validate.sh diff --git a/builder/Makefile.am b/builder/Makefile.am index 56e8929..851e3a6 100644 --- a/builder/Makefile.am +++ b/builder/Makefile.am @@ -33,6 +33,10 @@ EXTRA_DIST = \ test-virt-builder.sh \ test-virt-builder-list.sh \ test-virt-builder-planner.sh \ + test-virt-index-validate.sh \ + test-virt-index-validate-bad-1 \ + test-virt-index-validate-good-1 \ + test-virt-index-validate-good-2 \ virt-builder.pod \ virt-index-validate.pod @@ -226,7 +230,9 @@ fedora.qcow2.xz: fedora.qcow2 xz --best --block-size=16777216 -c $< > $@-t mv $@-t $@ -TESTS = test-virt-builder-list.sh +TESTS = \ + test-virt-builder-list.sh \ + test-virt-index-validate.sh if ENABLE_APPLIANCE TESTS += test-virt-builder.sh diff --git a/builder/test-virt-index-validate-bad-1 b/builder/test-virt-index-validate-bad-1 new file mode 100644 index 0000000..f722af4 --- /dev/null +++ b/builder/test-virt-index-validate-bad-1 @@ -0,0 +1,8 @@ +name=Phony Fedora +arch=x86_64 +file=fedora.xz +format=raw +size=1073741824 +expand=/dev/sda2 +lvexpand=/dev/VG/Root +notes=Phony Fedora look-alike used for testing. diff --git a/builder/test-virt-index-validate-good-1 b/builder/test-virt-index-validate-good-1 new file mode 100644 index 0000000..e69de29 diff --git a/builder/test-virt-index-validate-good-2 b/builder/test-virt-index-validate-good-2 new file mode 100644 index 0000000..347e245 --- /dev/null +++ b/builder/test-virt-index-validate-good-2 @@ -0,0 +1,2 @@ +# All lines commented out. +# [foo] diff --git a/builder/test-virt-index-validate.sh b/builder/test-virt-index-validate.sh new file mode 100755 index 0000000..37e7339 --- /dev/null +++ b/builder/test-virt-index-validate.sh @@ -0,0 +1,24 @@ +#!/bin/bash - +# test virt-index-validate +# Copyright (C) 2014 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. + +export LANG=C +set -e + +! $VG ./virt-index-validate test-virt-index-validate-bad-1 +$VG ./virt-index-validate test-virt-index-validate-good-1 +$VG ./virt-index-validate test-virt-index-validate-good-2 -- 1.8.5.3
Pino Toscano
2014-Apr-03 08:56 UTC
[Libguestfs] [PATCH 0/3] builder: Add test of virt-index-validate.
On Thursday 03 April 2014 08:59:45 Richard W.M. Jones wrote:> Somewhat ineffective test of virt-index-validate.LGTM. Are you also planning to remove builder/website/validate.sh, and move its validations to the new test-virt-index-validate.sh? -- Pino Toscano
Richard W.M. Jones
2014-Apr-03 09:00 UTC
Re: [Libguestfs] [PATCH 0/3] builder: Add test of virt-index-validate.
On Thu, Apr 03, 2014 at 10:56:49AM +0200, Pino Toscano wrote:> On Thursday 03 April 2014 08:59:45 Richard W.M. Jones wrote: > > Somewhat ineffective test of virt-index-validate. > > LGTM.I have pushed these patches + your patch.> Are you also planning to remove builder/website/validate.sh, and move > its validations to the new test-virt-index-validate.sh?I wasn't planning on it. This test validates the real index file (ie. not any of the test files). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/