summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-04-12 16:49:58 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-04-12 18:59:14 +0100
commita9bd90abfb3d4519278dfff305b8b7033ae6d76a (patch)
tree2e5d06d6a10117c4829cf5ab9e100962b3e0c18c
parentd2183a62aadff11609b561d3f821ec7d6094aa39 (diff)
downloadlibguestfs-a9bd90abfb3d4519278dfff305b8b7033ae6d76a.tar.gz
libguestfs-a9bd90abfb3d4519278dfff305b8b7033ae6d76a.tar.xz
libguestfs-a9bd90abfb3d4519278dfff305b8b7033ae6d76a.zip
Add regression test to test funny filenames (RHBZ#811649).
-rw-r--r--tests/regressions/Makefile.am1
-rwxr-xr-xtests/regressions/rhbz811649.sh49
2 files changed, 50 insertions, 0 deletions
diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
index a2a3673e..3027cd8e 100644
--- a/tests/regressions/Makefile.am
+++ b/tests/regressions/Makefile.am
@@ -28,6 +28,7 @@ TESTS = \
rhbz690819.sh \
rhbz789960.sh \
rhbz790721 \
+ rhbz811649.sh \
test-noexec-stack.pl
tests_not_run = \
diff --git a/tests/regressions/rhbz811649.sh b/tests/regressions/rhbz811649.sh
new file mode 100755
index 00000000..1d0e56ae
--- /dev/null
+++ b/tests/regressions/rhbz811649.sh
@@ -0,0 +1,49 @@
+#!/bin/bash -
+# libguestfs
+# Copyright (C) 2012 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=811649
+# Test filenames containing a variety of characters.
+
+set -e
+export LANG=C
+
+declare -a filenames
+filenames[0]=' '
+filenames[1]=','
+filenames[2]='='
+filenames[3]='水'
+filenames[4]='-'
+filenames[5]='-hda'
+#filenames[6]=':' # a future version of qemu may allow colon
+#filenames[7]='http:'
+#filenames[8]='file:'
+#filenames[9]='raw:'
+
+rm -f -- test1.img "${filenames[@]}"
+
+truncate -s 10M test1.img
+
+for f in "${filenames[@]}"; do
+ ln -- test1.img "$f"
+ guestfish <<EOF
+add "$f"
+run
+EOF
+done
+
+rm -f -- test1.img "${filenames[@]}"