[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] Cross testing and LD_LIBRARY_PATH



LD_LIBRARY_PATH needs to be treated like LD_AUDIT and LD_PRELOAD in cross 
testing.  I've applied this patch.

Index: scripts/run-with-env.sh
===================================================================
--- scripts/run-with-env.sh	(revision 2026)
+++ scripts/run-with-env.sh	(working copy)
@@ -17,4 +17,8 @@
     export LD_AUDIT="${EGLIBC_TEST_LD_AUDIT}"
 fi
 
+if [ "${EGLIBC_TEST_LD_LIBRARY_PATH+set}" ]; then
+    export LD_LIBRARY_PATH="${EGLIBC_TEST_LD_LIBRARY_PATH}"
+fi
+
 exec "$@"
Index: dlfcn/Makefile
===================================================================
--- dlfcn/Makefile	(revision 2026)
+++ dlfcn/Makefile	(working copy)
@@ -56,8 +56,10 @@
 tests += tststatic tststatic2
 tests-static += tststatic tststatic2
 modules-names += modstatic modstatic2
-tststatic-ENV = LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
-tststatic2-ENV = LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
+tststatic-ENV = EGLIBC_TEST_LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
+tststatic-WRAPPER = $(..)scripts/run-with-env.sh
+tststatic2-ENV = EGLIBC_TEST_LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
+tststatic2-WRAPPER = $(..)scripts/run-with-env.sh
 endif
 
 extra-test-objs += $(modules-names:=.os)
Index: ChangeLog.eglibc
===================================================================
--- ChangeLog.eglibc	(revision 2026)
+++ ChangeLog.eglibc	(working copy)
@@ -1,3 +1,22 @@
+2007-04-19  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* scripts/run-with-env.sh: Also handle
+	EGLIBC_TEST_LD_LIBRARY_PATH.
+	* dlfcn/Makefile (tststatic-ENV, tststatic2-ENV): Use
+	EGLIBC_TEST_LD_LIBRARY_PATH.
+	(tststatic-WRAPPER, tststatic2-WRAPPER): Define.
+	* elf/Makefile (tst-tls9-static-ENV): Use
+	EGLIBC_TEST_LD_LIBRARY_PATH.
+	(tst-tls9-static-WRAPPER): Define.
+	($(objpfx)tst-pathopt.out): Pass run-with-env.sh to
+	tst-pathopt.sh.
+	* elf/tst-pathopt.sh: Take run_with_env argument.  Use
+	EGLIBC_TEST_LD_LIBRARY_PATH.
+	* io/Makefile ($(objpfx)ftwtest.out): Pass run-with-env.sh to
+	ftwtest-sh.
+	* io/ftwtest-sh: Take run_with_env argument.  Use
+	EGLIBC_TEST_LD_LIBRARY_PATH.
+
 2007-04-18  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* scripts/cross-test-ssh.sh: Use printf in place of echo.
Index: elf/Makefile
===================================================================
--- elf/Makefile	(revision 2026)
+++ elf/Makefile	(working copy)
@@ -149,7 +149,8 @@
 ifeq (yesyesyes,$(build-static)$(build-shared)$(elf))
 tests-static += tst-tls9-static
 tst-tls9-static-ENV = \
-       LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
+  EGLIBC_TEST_LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
+tst-tls9-static-WRAPPER = $(..)scripts/run-with-env.sh
 endif
 ifeq (yes,$(have-initfini-array))
 tests-static += tst-array1-static tst-array5-static
@@ -640,7 +641,8 @@
 $(objpfx)tst-pathopt: $(libdl)
 $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
 			  $(objpfx)pathoptobj.so
-	$(SHELL) -e $< $(common-objpfx) "$(cross-test-wrapper)"
+	$(SHELL) -e $< $(common-objpfx) "$(cross-test-wrapper)" \
+		$(..)scripts/run-with-env.sh
 
 $(objpfx)initfirst: $(libdl)
 $(objpfx)initfirst.out: $(objpfx)firstobj.so
Index: elf/tst-pathopt.sh
===================================================================
--- elf/tst-pathopt.sh	(revision 2026)
+++ elf/tst-pathopt.sh	(working copy)
@@ -21,6 +21,7 @@
 
 common_objpfx=$1
 cross_test_wrapper="$2"
+run_with_env="$3"
 
 test -e ${common_objpfx}elf/will-be-empty &&
   rm -fr ${common_objpfx}elf/will-be-empty
@@ -30,8 +31,8 @@
 cp ${common_objpfx}elf/pathoptobj.so ${common_objpfx}elf/for-renamed/renamed.so
 
 LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
-LC_ALL=C LD_LIBRARY_PATH=${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \
-  ${cross_test_wrapper} ${common_objpfx}elf/ld.so \
+LC_ALL=C EGLIBC_TEST_LD_LIBRARY_PATH=${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \
+  ${cross_test_wrapper} ${run_with_env} ${common_objpfx}elf/ld.so \
     ${common_objpfx}elf/tst-pathopt \
     > ${common_objpfx}elf/tst-pathopt.out
 
Index: io/Makefile
===================================================================
--- io/Makefile	(revision 2026)
+++ io/Makefile	(working copy)
@@ -108,6 +108,7 @@
 	$(ftwtest-tmpdir) \
 	$(SHELL) -e ftwtest-sh $(shell cd $(common-objpfx). && pwd)/ \
 		 '$(cross-test-wrapper)' \
+		 $(shell cd $(..)scripts && pwd)/run-with-env.sh \
 		 $(shell cd $(<D) && pwd)/$(<F) > $@
 
 # eglibc: endif
Index: io/ftwtest-sh
===================================================================
--- io/ftwtest-sh	(revision 2026)
+++ io/ftwtest-sh	(working copy)
@@ -6,6 +6,9 @@
 # The cross-testing wrapper.
 cross_test_wrapper="$2"
 
+# The environment-setting wrapper.
+run_with_env="$3"
+
 # We expect one parameter which is the test program.  This must understand
 # a number options:
 #   --phys		use the FTW_PHYS flag
@@ -14,7 +17,7 @@
 #   --depth		use the FTW_DEPTH flag
 #   --early-exit 	print file@2 item only and return non-zero from the
 #			callback when it is seen
-testprogram=$3
+testprogram=$4
 
 # We cannot test this as root.
 if test `id | sed "s/uid=\([0-9]*\).*/\1/"` = 0; then
@@ -32,7 +35,7 @@
 tmpdir=$tmp/ftwtest.d
 
 [ -f ${objpfx}elf/ld.so ] && ldso=${objpfx}elf/ld.so
-ldso="${cross_test_wrapper:+$cross_test_wrapper }$ldso"
+ldso="${cross_test_wrapper:+$cross_test_wrapper }$run_with_env $ldso"
 
 trap 'chmod -fR a+x $tmpdir; rm -fr $tmpdir $testout' 1 2 3 15
 
@@ -58,7 +61,7 @@
 
 testout=${TMPDIR:-/tmp}/ftwtest.out
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
@@ -77,7 +80,7 @@
 EOF
 rm $testout
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --depth $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --depth $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
@@ -96,7 +99,7 @@
 EOF
 rm $testout
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --phys $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --phys $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
@@ -120,7 +123,7 @@
 # For the next test everything must be readable.
 chmod -fR a+x $tmpdir
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir $tmpdir |
     sort > $testout
 
 # perhaps $tmp involves some symlinks...
@@ -144,7 +147,7 @@
 
 curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
 cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d |
     sort > $testout
 cd "$curwd"
 
@@ -166,7 +169,7 @@
 
 curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
 cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/. |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/. |
     sort > $testout
 cd "$curwd"
 
@@ -188,7 +191,7 @@
 
 curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
 cd "$tmp"
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
     sort > $testout
 cd "$curwd"
 
@@ -197,7 +200,7 @@
 EOF
 rm $testout
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --early-exit $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --early-exit $tmpdir |
     sort > $testout
 
 cat <<EOF | cmp $testout - || exit 1
@@ -211,7 +214,7 @@
 echo > $tmpdir/foo/lvl1b/file2@1b
 echo > $tmpdir/foo/lvl1b/file3@1b
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-subtree=lvl1 $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-subtree=lvl1 $tmpdir |
     sort > $testout
 
 cat <<EOF | diff -u $testout - || exit 1
@@ -228,7 +231,7 @@
 EOF
 rm $testout
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=lvl1 $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=lvl1 $tmpdir |
     sort > $testout
 
 # The filesystem is not required to put lvl1 before lvl1b.
@@ -252,7 +255,7 @@
 EOF
 rm $testout
 
-LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=file@1b $tmpdir |
+EGLIBC_TEST_LD_LIBRARY_PATH=$objpfx $ldso $testprogram --skip-siblings=file@1b $tmpdir |
     sort > $testout
 
 # The filesystem is not required to put file2@1b and file3@1b after file@1b.

-- 
Joseph S. Myers
joseph@xxxxxxxxxxxxxxxx