All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bash: add iso8859-1 gconv RDEPENDS needed by bash-ptest.
@ 2019-05-28 14:31 Sakib Sajal
  2019-05-28 14:31 ` [PATCH 2/2] Bash: Allow new-exp ptest to pass when run as root Sakib Sajal
  0 siblings, 1 reply; 5+ messages in thread
From: Sakib Sajal @ 2019-05-28 14:31 UTC (permalink / raw)
  To: openembedded-core

One of the ptests failed for internationalization.
From the failed ptest log:
   run-intl
   fr_FR.ISO8859-1: Error Encoding U+00000080 to  [ "$'\200'" != "\\u0080" ]
   (125 similar errors related to same encoding)
The test was unable to convert iso8859-1 encoding to perform comparison.

Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Randy Macleod <randy.macleod@windriver.com>
---
 meta/recipes-extended/bash/bash.inc | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
index 4b3692c613..1e4dc55d01 100644
--- a/meta/recipes-extended/bash/bash.inc
+++ b/meta/recipes-extended/bash/bash.inc
@@ -26,8 +26,15 @@ RDEPENDS_${PN}_class-nativesdk = ""
 RDEPENDS_${PN}-ptest += "make coreutils perl"
 
 DEPENDS_append_libc-glibc = " virtual/libc-locale"
-RDEPENDS_${PN}-ptest_append_libc-glibc = " locale-base-en-us locale-base-fr-fr locale-base-fr-fr.iso-8859-1 locale-base-de-de locale-base-zh-hk.big5-hkscs glibc-utils"
-
+RDEPENDS_${PN}-ptest_append_libc-glibc = " \
+	glibc-gconv-iso8859-1 \
+	glibc-utils \
+	locale-base-de-de \
+	locale-base-en-us \
+	locale-base-fr-fr \
+	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"
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] Bash: Allow new-exp ptest to pass when run as root.
  2019-05-28 14:31 [PATCH 1/2] bash: add iso8859-1 gconv RDEPENDS needed by bash-ptest Sakib Sajal
@ 2019-05-28 14:31 ` Sakib Sajal
  2019-05-29 12:35   ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Sakib Sajal @ 2019-05-28 14:31 UTC (permalink / raw)
  To: openembedded-core

The ptest was failing as it was expecting non-root user.
Ptests are only run as root.

Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Randy Macleod <randy.macleod@windriver.com>
---
 ...llow-ptest-new-exp-to-be-run-as-root.patch | 45 +++++++++++++++++++
 meta/recipes-extended/bash/bash_5.0.bb        |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta/recipes-extended/bash/bash/0001-Bash-Allow-ptest-new-exp-to-be-run-as-root.patch

diff --git a/meta/recipes-extended/bash/bash/0001-Bash-Allow-ptest-new-exp-to-be-run-as-root.patch b/meta/recipes-extended/bash/bash/0001-Bash-Allow-ptest-new-exp-to-be-run-as-root.patch
new file mode 100644
index 0000000000..bc0154692e
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/0001-Bash-Allow-ptest-new-exp-to-be-run-as-root.patch
@@ -0,0 +1,45 @@
+From d360a22e7a0b75f1e081f6d7cbf4d55745ecce6b Mon Sep 17 00:00:00 2001
+From: Sakib Sajal <sakib.sajal@windriver.com>
+Date: Mon, 27 May 2019 17:57:04 -0400
+Subject: [PATCH] Bash: Allow ptest, new-exp, to be run as root
+
+Upstream-Status: inappropriate [embedded specific]
+
+The ptest was failing as it was expecting non-root user.
+Ptests are only run as root.
+
+Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
+Signed-off-by: Randy Macleod <randy.macleod@windriver.com>
+---
+ tests/new-exp.right | 2 +-
+ tests/new-exp.tests | 4 ----
+ 2 files changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/tests/new-exp.right b/tests/new-exp.right
+index c0f78fbb..9a42ec81 100644
+--- a/tests/new-exp.right
++++ b/tests/new-exp.right
+@@ -624,7 +624,7 @@ c Sub = 0 2 4 8
+ <'ab cd'> 
+ <'4'> <'ab cd'> 
+ <> 
+-argv[1] = <host(2)[5.0]$ >
++argv[1] = <host(2)[5.0]# >
+ < 	
+ >
+ <' \t\n'>
+diff --git a/tests/new-exp.tests b/tests/new-exp.tests
+index 557d6b44..31e15468 100644
+--- a/tests/new-exp.tests
++++ b/tests/new-exp.tests
+@@ -1,7 +1,3 @@
+-if (( $UID == 0 )); then
+-	echo "new-exp.tests: the test suite should not be run as root" >&2
+-fi
+-
+ # must do this because posix mode causes process substitution to be disabled
+ # and flagged as a syntax error, which causes the shell to exit
+ set +o posix
+-- 
+2.20.1
+
diff --git a/meta/recipes-extended/bash/bash_5.0.bb b/meta/recipes-extended/bash/bash_5.0.bb
index e60e5304a5..953f3cb0e1 100644
--- a/meta/recipes-extended/bash/bash_5.0.bb
+++ b/meta/recipes-extended/bash/bash_5.0.bb
@@ -19,6 +19,7 @@ SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \
            file://fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch \
            file://run-ptest \
            file://fix-run-builtins.patch \
+	   file://0001-Bash-Allow-ptest-new-exp-to-be-run-as-root.patch \
            "
 
 SRC_URI[tarball.md5sum] = "2b44b47b905be16f45709648f671820b"
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] Bash: Allow new-exp ptest to pass when run as root.
  2019-05-28 14:31 ` [PATCH 2/2] Bash: Allow new-exp ptest to pass when run as root Sakib Sajal
@ 2019-05-29 12:35   ` Richard Purdie
  2019-05-29 13:08     ` Randy MacLeod
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2019-05-29 12:35 UTC (permalink / raw)
  To: Sakib Sajal, openembedded-core

On Tue, 2019-05-28 at 10:31 -0400, Sakib Sajal wrote:
> The ptest was failing as it was expecting non-root user.
> Ptests are only run as root.
> 
> Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
> Signed-off-by: Randy Macleod <randy.macleod@windriver.com>

Rather than patching the code with a patch which we can never upstream,
can we run the ptest under a non-root user?

Cheers,

Richard



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] Bash: Allow new-exp ptest to pass when run as root.
  2019-05-29 12:35   ` Richard Purdie
@ 2019-05-29 13:08     ` Randy MacLeod
  2019-05-29 13:12       ` richard.purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Randy MacLeod @ 2019-05-29 13:08 UTC (permalink / raw)
  To: Richard Purdie, Sakib Sajal, openembedded-core

On 5/29/19 8:35 AM, Richard Purdie wrote:
> On Tue, 2019-05-28 at 10:31 -0400, Sakib Sajal wrote:
>> The ptest was failing as it was expecting non-root user.
>> Ptests are only run as root.
>>
>> Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
>> Signed-off-by: Randy Macleod <randy.macleod@windriver.com>
> 
> Rather than patching the code with a patch which we can never upstream,
> can we run the ptest under a non-root user?

We considered that but when I looked for an example of oe-core doing
that but didn't see one. Did I miss it/them?

I suppose the /usr/lib/bash/ptest/run-ptest script could:
  - create a user: say 'bashptest'
  - run the tests
  - delete the user.
Of course we'd need to add dependencies for the user mgmt tools.

Is that what you were thinking?

../Randy

> 
> Cheers,
> 
> Richard
> 


-- 
# Randy MacLeod
# Wind River Linux


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] Bash: Allow new-exp ptest to pass when run as root.
  2019-05-29 13:08     ` Randy MacLeod
@ 2019-05-29 13:12       ` richard.purdie
  0 siblings, 0 replies; 5+ messages in thread
From: richard.purdie @ 2019-05-29 13:12 UTC (permalink / raw)
  To: Randy MacLeod, Sakib Sajal, openembedded-core

On Wed, 2019-05-29 at 09:08 -0400, Randy MacLeod wrote:
> On 5/29/19 8:35 AM, Richard Purdie wrote:
> > On Tue, 2019-05-28 at 10:31 -0400, Sakib Sajal wrote:
> > > The ptest was failing as it was expecting non-root user.
> > > Ptests are only run as root.
> > > 
> > > Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
> > > Signed-off-by: Randy Macleod <randy.macleod@windriver.com>
> > 
> > Rather than patching the code with a patch which we can never
> > upstream,
> > can we run the ptest under a non-root user?
> 
> We considered that but when I looked for an example of oe-core doing
> that but didn't see one. Did I miss it/them?
> 
> I suppose the /usr/lib/bash/ptest/run-ptest script could:
>   - create a user: say 'bashptest'
>   - run the tests
>   - delete the user.
> Of course we'd need to add dependencies for the user mgmt tools.
> 
> Is that what you were thinking?

Yes, there is prior art:

$ cat recipes-core/glib-2.0/glib-2.0/run-ptest
#! /bin/sh

set -eux
useradd glib2-test
su glib2-test -c gnome-desktop-testing-runner glib
userdel glib2-test

(openssh also adds a test user)

Cheers,

Richard




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-29 13:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28 14:31 [PATCH 1/2] bash: add iso8859-1 gconv RDEPENDS needed by bash-ptest Sakib Sajal
2019-05-28 14:31 ` [PATCH 2/2] Bash: Allow new-exp ptest to pass when run as root Sakib Sajal
2019-05-29 12:35   ` Richard Purdie
2019-05-29 13:08     ` Randy MacLeod
2019-05-29 13:12       ` richard.purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.