[OE-core] [meta-oe][PATCH 2/2] bash: inherit useradd and remove redundant patch

Sakib Sajal sakib.sajal at windriver.com
Tue Jun 4 19:29:39 UTC 2019


1) inherit useradd to allow new users to be created.

Ensure that useradd/del are available when running
bash ptests.

2) run ptest as non-root.

Removed patch:
   fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch

which enabled the two tests:
   execscript, test,
to be run by root but under 'su' as a user. These two tests
now fail since all bash ptest are now run as non-root and there
is no need to 'su'. There are remaining problems with the test
that will be resolved in future commits.

Bash ptest statistics with said changes:
   PASS: 77
   SKIP:  0
   FAIL:  4

Failed tests: execscript
	      test
	      read
  	      trap

Signed-off-by: Sakib Sajal <sakib.sajal at windriver.com>
Signed-off-by: Randy Macleod <randy.macleod at windriver.com>
---
 meta/recipes-extended/bash/bash.inc           |  2 +-
 ...un-heredoc-run-execscript-run-test-f.patch | 45 -------------------
 meta/recipes-extended/bash/bash_5.0.bb        |  1 -
 3 files changed, 1 insertion(+), 47 deletions(-)
 delete mode 100644 meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch

diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
index dbb803ddef..1965e9c4a3 100644
--- a/meta/recipes-extended/bash/bash.inc
+++ b/meta/recipes-extended/bash/bash.inc
@@ -4,7 +4,7 @@ SECTION = "base/shell"
 
 DEPENDS = "ncurses bison-native virtual/libiconv"
 
-inherit autotools gettext texinfo update-alternatives ptest
+inherit autotools gettext texinfo update-alternatives ptest useradd
 
 EXTRA_AUTORECONF += "--exclude=autoheader --exclude=aclocal"
 EXTRA_OECONF = "--enable-job-control --without-bash-malloc bash_cv_wexitstatus_offset=8"
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 at 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 at 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_5.0.bb b/meta/recipes-extended/bash/bash_5.0.bb
index e60e5304a5..0a3f1b15f0 100644
--- a/meta/recipes-extended/bash/bash_5.0.bb
+++ b/meta/recipes-extended/bash/bash_5.0.bb
@@ -16,7 +16,6 @@ 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://fix-run-builtins.patch \
            "
-- 
2.20.1



More information about the Openembedded-core mailing list