aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-12 02:22:58 -0500
committerMike Frysinger <vapier@gentoo.org>2009-02-12 03:01:41 -0500
commit23eb90e6b96fc9a448dd9fba7640733fa578ce47 (patch)
treea050e0db7b04853f02f9f9bcdc1709ac43422b50
parentbump to sandbox-1.3.7 (diff)
downloadsandbox-23eb90e6b96fc9a448dd9fba7640733fa578ce47.tar.gz
sandbox-23eb90e6b96fc9a448dd9fba7640733fa578ce47.tar.bz2
sandbox-23eb90e6b96fc9a448dd9fba7640733fa578ce47.zip
add testcase for old PATH bug
Also fix common script execution code to remove debug "moo" string and disable pointless sleep code in sandbox. URL: http://bugs.gentoo.org/139591 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reported-by: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
-rw-r--r--data/sandbox.bashrc2
-rw-r--r--tests/Makefile.am3
-rwxr-xr-xtests/script-2.sh31
-rw-r--r--tests/script.at3
4 files changed, 36 insertions, 3 deletions
diff --git a/data/sandbox.bashrc b/data/sandbox.bashrc
index bfd848a..9b813e1 100644
--- a/data/sandbox.bashrc
+++ b/data/sandbox.bashrc
@@ -22,7 +22,7 @@ if [[ ${SANDBOX_INTRACTV} == "1" && -t 1 ]] || [[ ${__SANDBOX_TESTING} == "yes"
# Make sure this do not get recusively called
unset SANDBOX_INTRACTV
- # Do not set this, as user might want to override path, etc ...
+ # Do not set this, as user might want to override path, etc ... #139591
#source /etc/profile
if [[ ${__SANDBOX_TESTING} != "yes" ]] ; then
diff --git a/tests/Makefile.am b/tests/Makefile.am
index fd74d4f..3f26191 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -52,7 +52,8 @@ check_PROGRAMS = \
dist_check_SCRIPTS = \
access.sh \
script-0.sh \
- script-1.sh
+ script-1.sh \
+ script-2.sh
sb_printf_tst_CFLAGS = -I$(top_srcdir)/libsbutil -I$(top_srcdir)/libsbutil/include
sb_printf_tst_LDADD = $(top_builddir)/libsbutil/libsbutil.la
diff --git a/tests/script-2.sh b/tests/script-2.sh
new file mode 100755
index 0000000..77c050c
--- /dev/null
+++ b/tests/script-2.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+# http://bugs.gentoo.org/139591
+addwrite $PWD
+td=".tmp.${0##*/}"
+rm -rf $td
+mkdir $td
+pushd $td >/dev/null
+
+cat << EOF > test1
+#!/bin/sh
+export PATH="\`pwd\`/:\${PATH}"
+test2
+EOF
+
+cat << EOF > test2
+#!/bin/sh
+test3
+EOF
+
+cat << EOF > test3
+#!/bin/sh
+printf hi
+EOF
+
+chmod a+rx test[123]
+
+./test1
+
+popd >/dev/null
+rm -rf $td
+exit 0
diff --git a/tests/script.at b/tests/script.at
index a887378..040ed62 100644
--- a/tests/script.at
+++ b/tests/script.at
@@ -1,7 +1,7 @@
m4_defun([SB_CHECK],[dnl
AT_SETUP([scripts/$1])
AT_CHECK(
- [sandbox.sh . $abs_top_srcdir/tests/script-$1.sh; echo moo],
+ [env SANDBOX_BEEP=0 sandbox.sh . $abs_top_srcdir/tests/script-$1.sh],
[0],
m4_ifval($2,$2,[ignore]),
m4_ifval($3,$3,[ignore]))
@@ -10,3 +10,4 @@ AT_CLEANUP])
SB_CHECK(0)
SB_CHECK(1,, [touch: cannot touch `/a/b/c/d/e/f/g/no/real/path/so/dont/make/it': No such file or directory
])
+SB_CHECK(2, [hi])