Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From d1cd4c31ea0ed7406a3ad4bdaa211f581063f655 Mon Sep 17 00:00:00 2001 |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 3 | Date: Tue, 15 Aug 2017 10:21:21 +0800 |
| 4 | Subject: [PATCH 2/2] fix run-execscript/run-test/ failed |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 5 | |
| 6 | FAIL: run-execscript: |
| 7 | the test suite should not be run as root |
| 8 | |
| 9 | FAIL: run-test |
| 10 | the test suite should not be run as root |
| 11 | |
| 12 | Upstream-Status: Pending |
| 13 | |
| 14 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 15 | --- |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 16 | tests/run-execscript | 3 ++- |
| 17 | tests/run-test | 3 ++- |
| 18 | 2 files changed, 4 insertions(+), 2 deletions(-) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 19 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 20 | diff --git a/tests/run-execscript b/tests/run-execscript |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 21 | index de78644..38397c1 100644 |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 22 | --- a/tests/run-execscript |
| 23 | +++ b/tests/run-execscript |
| 24 | @@ -5,5 +5,6 @@ echo "warning: \`/tmp/bash-notthere' not being found or \`/' being a directory" |
| 25 | echo "warning: produce diff output, please do not consider this a test failure" >&2 |
| 26 | echo "warning: if diff output differing only in the location of the bash" >&2 |
| 27 | echo "warning: binary appears, please do not consider this a test failure" >&2 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 28 | -${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1 |
| 29 | +rm -f ${BASH_TSTOUT} |
| 30 | +su -c "${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1" test |
| 31 | diff ${BASH_TSTOUT} exec.right && rm -f ${BASH_TSTOUT} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 32 | diff --git a/tests/run-test b/tests/run-test |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 33 | index d68791c..d6317d2 100644 |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 34 | --- a/tests/run-test |
| 35 | +++ b/tests/run-test |
| 36 | @@ -1,4 +1,5 @@ |
| 37 | unset GROUPS UID 2>/dev/null |
| 38 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 39 | -${THIS_SH} ./test.tests >${BASH_TSTOUT} 2>&1 |
| 40 | +rm -f ${BASH_TSTOUT} |
| 41 | +su -c "${THIS_SH} ./test.tests > ${BASH_TSTOUT} 2>&1" test |
| 42 | diff ${BASH_TSTOUT} test.right && rm -f ${BASH_TSTOUT} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 43 | -- |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 44 | 1.8.3.1 |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 45 | |