From f724608f41122c82c2deb7a1e66f51fb053080c0 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 17 Dec 2014 13:02:06 +0000
Subject: [PATCH] fish: Add regression test for RHBZ#1175196.
(cherry picked from commit f1ecd6af808f22af913a589754ae11dc1e35b658)
---
tests/regressions/Makefile.am | 2 ++
tests/regressions/rhbz1175196.sh | 64 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+)
create mode 100755 tests/regressions/rhbz1175196.sh
diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
index de97526..72d26da 100644
--- a/tests/regressions/Makefile.am
+++ b/tests/regressions/Makefile.am
@@ -42,6 +42,7 @@ EXTRA_DIST = \
rhbz1044014.xml \
rhbz1054761.sh \
rhbz1091803.sh \
+ rhbz1175196.sh \
test-noexec-stack.pl
TESTS = \
@@ -66,6 +67,7 @@ TESTS = \
rhbz1054761.sh \
rhbz1055452 \
rhbz1091803.sh \
+ rhbz1175196.sh \
test-noexec-stack.pl
if HAVE_LIBVIRT
diff --git a/tests/regressions/rhbz1175196.sh b/tests/regressions/rhbz1175196.sh
new file mode 100755
index 0000000..e88f447
--- /dev/null
+++ b/tests/regressions/rhbz1175196.sh
@@ -0,0 +1,64 @@
+#!/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=1175196
+# Parse 'LIBGUESTFS_TRACE=0' in the environment.
+
+set -e
+export LANG=C
+
+output="$(guestfish <<EOF
+
+setenv LIBGUESTFS_TRACE 1
+parse-environment
+get-trace
+
+setenv LIBGUESTFS_TRACE 0
+parse-environment
+get-trace
+
+setenv LIBGUESTFS_TRACE true
+parse-environment
+get-trace
+
+setenv LIBGUESTFS_TRACE no
+parse-environment
+get-trace
+
+setenv LIBGUESTFS_TRACE t
+parse-environment
+get-trace
+
+setenv LIBGUESTFS_TRACE f
+parse-environment
+get-trace
+
+EOF
+)"
+
+if [ "$output" != "true
+false
+true
+false
+true
+false" ]; then
+ echo "$0: unexpected output from test:"
+ echo "$output"
+ exit 1
+fi
--
1.8.3.1