[Pkg-libvirt-commits] [libguestfs] 07/78: rescue: Add a regression test for virt-rescue --suggest option.

Hilko Bengen bengen at moszumanska.debian.org
Fri May 9 12:55:35 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 f6a37740f2ba6668bee4952fdd35c46cb6d79cba
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Mar 28 14:37:45 2014 +0000

    rescue: Add a regression test for virt-rescue --suggest option.
---
 rescue/Makefile.am                 | 10 ++++++++-
 rescue/test-virt-rescue-suggest.sh | 43 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/rescue/Makefile.am b/rescue/Makefile.am
index 8afaddc..c2a9b9e 100644
--- a/rescue/Makefile.am
+++ b/rescue/Makefile.am
@@ -19,6 +19,7 @@ include $(top_srcdir)/subdir-rules.mk
 
 EXTRA_DIST = \
 	test-virt-rescue.pl \
+	test-virt-rescue-suggest.sh \
 	virt-rescue.pod
 
 CLEANFILES = stamp-virt-rescue.pod
@@ -78,6 +79,13 @@ stamp-virt-rescue.pod: virt-rescue.pod
 
 TESTS_ENVIRONMENT = $(top_builddir)/run --test
 
+TESTS =
+
 if ENABLE_APPLIANCE
-TESTS = test-virt-rescue.pl
+TESTS += \
+	test-virt-rescue.pl \
+	test-virt-rescue-suggest.sh
 endif ENABLE_APPLIANCE
+
+check-valgrind:
+	$(MAKE) TESTS="test-virt-rescue-suggest.sh" VG="$(top_builddir)/run @VG@" check
diff --git a/rescue/test-virt-rescue-suggest.sh b/rescue/test-virt-rescue-suggest.sh
new file mode 100755
index 0000000..f3fbebc
--- /dev/null
+++ b/rescue/test-virt-rescue-suggest.sh
@@ -0,0 +1,43 @@
+#!/bin/bash -
+# test virt-rescue --suggest
+# 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
+
+guest=../tests/guests/fedora.img
+
+if [ ! -s "$guest" ]; then
+    echo "$0: test skipped because $guest does not exist or is an empty file"
+    exit 77
+fi
+
+rm -f virt-rescue-suggest.out
+
+$VG ./virt-rescue --suggest "$guest" > virt-rescue-suggest.out
+if [ "$(grep '^mount ' virt-rescue-suggest.out)" != "mount /dev/VG/Root /sysroot/
+mount /dev/sda1 /sysroot/boot
+mount --bind /dev /sysroot/dev
+mount --bind /dev/pts /sysroot/dev/pts
+mount --bind /proc /sysroot/proc
+mount --bind /sys /sysroot/sys" ]; then
+    echo "$0: unexpected output from virt-rescue --suggest command:"
+    cat virt-rescue-suggest.out
+    exit 1
+fi
+
+rm virt-rescue-suggest.out

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