[Pkg-libvirt-commits] [libguestfs] 34/78: builder: Add test of virt-index-validate.

Hilko Bengen bengen at moszumanska.debian.org
Fri May 9 12:55:50 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit d268cfd13ef8e8dff3313c951e4d415fd183cf89
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Thu Apr 3 08:58:46 2014 +0100

    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(-)

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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list