[Pkg-libvirt-commits] [libguestfs] 103/233: tests: Add a regression test for RHBZ#1054761.

Hilko Bengen bengen at moszumanska.debian.org
Wed Feb 19 21:11:23 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 7d8d065feee46337a2c4a3b4736f57878de84928
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Wed Jan 22 17:00:43 2014 +0000

    tests: Add a regression test for RHBZ#1054761.
---
 tests/regressions/Makefile.am    |  1 +
 tests/regressions/rhbz1054761.sh | 49 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)

diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
index 7ae306c..8be5f03 100644
--- a/tests/regressions/Makefile.am
+++ b/tests/regressions/Makefile.am
@@ -36,6 +36,7 @@ TESTS = \
 	rhbz957772.sh \
 	rhbz975797.sh \
 	rhbz1001875.sh \
+	rhbz1054761.sh \
 	rhbz1055452 \
 	test-noexec-stack.pl
 
diff --git a/tests/regressions/rhbz1054761.sh b/tests/regressions/rhbz1054761.sh
new file mode 100755
index 0000000..f7f49df
--- /dev/null
+++ b/tests/regressions/rhbz1054761.sh
@@ -0,0 +1,49 @@
+#!/bin/bash -
+# libguestfs
+# 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.
+
+# Regression test for:
+# https://bugzilla.redhat.com/show_bug.cgi?id=1054761
+# Handle broken/missing PVs gracefully.
+
+set -e
+export LANG=C
+
+if [ -n "$SKIP_TEST_RHBZ1054761_SH" ]; then
+    echo "$0: test skipped because environment variable is set."
+    exit 77
+fi
+
+rm -f rhbz1054761-[ab].img
+
+../../fish/guestfish -N rhbz1054761-a.img=disk -N rhbz1054761-b.img=disk <<EOF
+pvcreate /dev/sda
+pvcreate /dev/sdb
+vgcreate VG "/dev/sda /dev/sdb"
+EOF
+
+output="$(
+    ../../fish/guestfish -a rhbz1054761-a.img run : pvs |
+        sed -r 's,^/dev/[abce-ln-z]+d,/dev/sd,'
+)"
+if [ "$output" != "/dev/sda" ]; then
+    echo "$0: unexpected output from test:"
+    echo "$output"
+    exit 1
+fi
+
+rm rhbz1054761-[ab].img

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