diff options
5 files changed, 12 insertions, 54 deletions
diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc index 4cf1054967..c91cc8ada8 100644 --- a/meta/recipes-extended/bash/bash.inc +++ b/meta/recipes-extended/bash/bash.inc @@ -23,7 +23,7 @@ ALTERNATIVE_PRIORITY = "100" RDEPENDS_${PN} += "base-files" RDEPENDS_${PN}_class-nativesdk = "" -RDEPENDS_${PN}-ptest += "make coreutils perl" +RDEPENDS_${PN}-ptest += "make coreutils perl sed shadow util-linux-setpriv" DEPENDS_append_libc-glibc = " virtual/libc-locale" RDEPENDS_${PN}-ptest_append_libc-glibc = " \ @@ -36,8 +36,6 @@ RDEPENDS_${PN}-ptest_append_libc-glibc = " \ locale-base-fr-fr.iso-8859-1 \ locale-base-zh-hk.big5-hkscs \ " -USERADD_PACKAGES = "${PN}-ptest" -USERADD_PARAM_${PN}-ptest = "--create-home --user-group test" CACHED_CONFIGUREVARS += "headersdir=${includedir}/${PN}" @@ -74,6 +72,7 @@ do_install_append_class-target () { do_install_ptest () { make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test cp ${B}/Makefile ${D}${PTEST_PATH} + install -D ${WORKDIR}/run-bash-ptests ${D}${PTEST_PATH}/run-bash-ptests sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ -e 's|${DEBUG_PREFIX_MAP}||g' \ -e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" \ diff --git a/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch b/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch deleted file mode 100644 index 9ac2461ab6..0000000000 --- a/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch +++ /dev/null @@ -1,45 +0,0 @@ -From d1cd4c31ea0ed7406a3ad4bdaa211f581063f655 Mon Sep 17 00:00:00 2001 -From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Tue, 15 Aug 2017 10:21:21 +0800 -Subject: [PATCH 2/2] fix run-execscript/run-test/ failed - -FAIL: run-execscript: -the test suite should not be run as root - -FAIL: run-test -the test suite should not be run as root - -Upstream-Status: Pending - -Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> ---- - tests/run-execscript | 3 ++- - tests/run-test | 3 ++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/tests/run-execscript b/tests/run-execscript -index de78644..38397c1 100644 ---- a/tests/run-execscript -+++ b/tests/run-execscript -@@ -5,5 +5,6 @@ echo "warning: \`/tmp/bash-notthere' not being found or \`/' being a directory" - echo "warning: produce diff output, please do not consider this a test failure" >&2 - echo "warning: if diff output differing only in the location of the bash" >&2 - echo "warning: binary appears, please do not consider this a test failure" >&2 --${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1 -+rm -f ${BASH_TSTOUT} -+su -c "${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1" test - diff ${BASH_TSTOUT} exec.right && rm -f ${BASH_TSTOUT} -diff --git a/tests/run-test b/tests/run-test -index d68791c..d6317d2 100644 ---- a/tests/run-test -+++ b/tests/run-test -@@ -1,4 +1,5 @@ - unset GROUPS UID 2>/dev/null - --${THIS_SH} ./test.tests >${BASH_TSTOUT} 2>&1 -+rm -f ${BASH_TSTOUT} -+su -c "${THIS_SH} ./test.tests > ${BASH_TSTOUT} 2>&1" test - diff ${BASH_TSTOUT} test.right && rm -f ${BASH_TSTOUT} --- -1.8.3.1 - diff --git a/meta/recipes-extended/bash/bash/run-bash-ptests b/meta/recipes-extended/bash/bash/run-bash-ptests new file mode 100644 index 0000000000..d73a27224d --- /dev/null +++ b/meta/recipes-extended/bash/bash/run-bash-ptests @@ -0,0 +1,4 @@ +#!/bin/sh +cd "$(dirname "$0")" +make -k THIS_SH=/bin/bash BUILD_DIR=`pwd` srcdir=`pwd` runtest + diff --git a/meta/recipes-extended/bash/bash/run-ptest b/meta/recipes-extended/bash/bash/run-ptest index c0cf27b6c2..738ad3c42c 100644 --- a/meta/recipes-extended/bash/bash/run-ptest +++ b/meta/recipes-extended/bash/bash/run-ptest @@ -19,8 +19,8 @@ then echo "Warning: The de_DE* locales is needed to run the intl.tests, please add it." fi -useradd bash_user -chown -R bash_user:bash_user ./tests -su bash_user -c "make -k THIS_SH=/bin/bash BUILD_DIR=`pwd` srcdir=`pwd` runtest" -chown -R root:root ./tests -userdel bash_user +useradd bashtest +chown -R bashtest:bashtest tests +setpriv --reuid bashtest --rgid bashtest --clear-groups --reset-env $(dirname "$0")/run-bash-ptests +chown -R root:root tests +userdel -r bashtest diff --git a/meta/recipes-extended/bash/bash_5.0.bb b/meta/recipes-extended/bash/bash_5.0.bb index e60e5304a5..eadc82279d 100644 --- a/meta/recipes-extended/bash/bash_5.0.bb +++ b/meta/recipes-extended/bash/bash_5.0.bb @@ -16,8 +16,8 @@ SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \ file://mkbuiltins_have_stringize.patch \ file://build-tests.patch \ file://test-output.patch \ - file://fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch \ file://run-ptest \ + file://run-bash-ptests \ file://fix-run-builtins.patch \ " |