Added in 2392fae6803b9de4a4761509007c160339d57f50 and removed in
be025369ad622867ecf08d5c9170e8e59d2d6294; now they should work with any
backend, as the device names are normalised and not change the guestfish
output depending on the used backend.

Thanks Richard for the hints.
---
 tests/regressions/Makefile.am    |  2 ++
 tests/regressions/rhbz563450.sh  | 59 ++++++++++++++++++++++++++++++++++++++++
 tests/regressions/rhbz563450b.sh | 48 ++++++++++++++++++++++++++++++++
 3 files changed, 109 insertions(+)
 create mode 100755 tests/regressions/rhbz563450.sh
 create mode 100755 tests/regressions/rhbz563450b.sh

diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
index 5b0d1c3..741f45f 100644
--- a/tests/regressions/Makefile.am
+++ b/tests/regressions/Makefile.am
@@ -21,6 +21,8 @@ TESTS = \
        rhbz501893 \
        rhbz503169c13.sh \
        rhbz557655.sh \
+       rhbz563450.sh \
+       rhbz563450b.sh \
        rhbz576879.sh \
        rhbz578407.sh \
        rhbz580246.sh \
diff --git a/tests/regressions/rhbz563450.sh b/tests/regressions/rhbz563450.sh
new file mode 100755
index 0000000..96fca8c
--- /dev/null
+++ b/tests/regressions/rhbz563450.sh
@@ -0,0 +1,59 @@
+#!/bin/bash -
+# libguestfs
+# Copyright (C) 2013 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.
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=563450
+# Test the order of added images
+
+set -e
+export LANG=C
+
+if [ ! -s ../guests/fedora.img -o ! -s ../data/test.iso -o ! -s 
../guests/debian.img ]; then
+    echo "$0: test skipped because there is no fedora.img nor test.iso nor 
debian.img"
+    exit 77
+fi
+
+rm -f test.out
+
+../../fish/guestfish --ro > test.out <<EOF
+add-drive-ro ../guests/fedora.img
+add-cdrom ../data/test.iso
+add-drive-ro ../guests/debian.img
+
+run
+
+list-devices | sed -r 's,^/dev/[abce-ln-z]+d,/dev/sd,'
+echo ----
+list-partitions | sed -r 's,^/dev/[abce-ln-z]+d,/dev/sd,'
+
+ping-daemon
+EOF
+
+if [ "$(cat test.out)" != "/dev/sda
+/dev/sdb
+/dev/sdc
+----
+/dev/sda1
+/dev/sda2
+/dev/sdc1
+/dev/sdc2" ]; then
+    echo "$0: unexpected output:"
+    cat test.out
+    exit 1
+fi
+
+rm -f test.out
diff --git a/tests/regressions/rhbz563450b.sh b/tests/regressions/rhbz563450b.sh
new file mode 100755
index 0000000..7b890b1
--- /dev/null
+++ b/tests/regressions/rhbz563450b.sh
@@ -0,0 +1,48 @@
+#!/bin/bash -
+# libguestfs
+# Copyright (C) 2013 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.
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=563450
+# Test only CD-ROM disk images can be added
+
+set -e
+export LANG=C
+
+if [ ! -s ../data/test.iso ]; then
+    echo "$0: test skipped because there is no test.iso"
+    exit 77
+fi
+
+rm -f test.out
+
+../../fish/guestfish --ro > test.out <<EOF
+add-cdrom ../data/test.iso
+
+run
+
+list-devices | sed -r 's,^/dev/[abce-ln-z]+d,/dev/sd,'
+
+ping-daemon
+EOF
+
+if [ "$(cat test.out)" != "/dev/sda" ]; then
+    echo "$0: unexpected output:"
+    cat test.out
+    exit 1
+fi
+
+rm -f test.out
-- 
1.8.3.1

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to