Re: [OE-core] [PATCH 1/2] eoqa: use bash to execute SDK test commands

2019-05-08 Thread Mikko.Rapeli
On Wed, May 08, 2019 at 08:41:21AM -0500, Joshua Watt wrote:
> On Wed, 2019-05-08 at 16:26 +0300, Mikko Rapeli wrote:
> > The commands only work with with bash. If /bin/sh is
> > dash like in Debian, the command execution fails with
> > errors like:
> 
> This might possibly be related to 
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=11775 where it was
> discovered that in order to use dash, the CWD must be the same
> directory where the init script lives?

Yes, this is related.

In my case bitbake build is already called from bash and all scripts
seem to be calling bash correctly as /bin/bash, except for these
SDK tests.

Also on sumo, there is no meaningful debug output when these tests fail.

from oeqa.utils.subprocesstweak import errors_have_output
errors_have_output()

should maybe be used wherewhere with python subprocess...

-Mikko

> > 
> > Standard Output: /bin/sh: 5: export: --sysroot: bad variable name
> > 
> > and all SDK tests fail.
> > 
> > Signed-off-by: Mikko Rapeli 
> > ---
> >  meta/lib/oeqa/sdk/case.py  | 2 +-
> >  meta/lib/oeqa/sdk/utils/sdkbuildproject.py | 3 ++-
> >  2 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meta/lib/oeqa/sdk/case.py b/meta/lib/oeqa/sdk/case.py
> > index d8611c8..5334237 100644
> > --- a/meta/lib/oeqa/sdk/case.py
> > +++ b/meta/lib/oeqa/sdk/case.py
> > @@ -9,7 +9,7 @@ from oeqa.core.case import OETestCase
> >  class OESDKTestCase(OETestCase):
> >  def _run(self, cmd):
> >  return subprocess.check_output(". %s > /dev/null; %s;" % \
> > -(self.tc.sdk_env, cmd), shell=True,
> > +(self.tc.sdk_env, cmd), shell=True,
> > executable="/bin/bash",
> >  stderr=subprocess.STDOUT, universal_newlines=True)
> >  
> >  def fetch(self, workdir, dl_dir, url, archive=None):
> > diff --git a/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
> > b/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
> > index 6fed73e..eafbd7a 100644
> > --- a/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
> > +++ b/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
> > @@ -42,7 +42,8 @@ class SDKBuildProject(BuildProject):
> >  def _run(self, cmd):
> >  self.log("Running . %s; " % self.sdkenv + cmd)
> >  try:
> > -output = subprocess.check_output(". %s; " % self.sdkenv
> > + cmd, shell=True, stderr=subprocess.STDOUT)
> > +output = subprocess.check_output(". %s; " % self.sdkenv
> > + cmd, shell=True,
> > + executable='/bin/bash',
> > stderr=subprocess.STDOUT)
> >  except subprocess.CalledProcessError as exc:
> >  print(exc.output.decode('utf-8'))
> >  return exc.returncode
> > -- 
> > 1.9.1
> > 
> -- 
> Joshua Watt 
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 1/2] eoqa: use bash to execute SDK test commands

2019-05-08 Thread Joshua Watt
On Wed, 2019-05-08 at 16:26 +0300, Mikko Rapeli wrote:
> The commands only work with with bash. If /bin/sh is
> dash like in Debian, the command execution fails with
> errors like:

This might possibly be related to 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=11775 where it was
discovered that in order to use dash, the CWD must be the same
directory where the init script lives?

> 
> Standard Output: /bin/sh: 5: export: --sysroot: bad variable name
> 
> and all SDK tests fail.
> 
> Signed-off-by: Mikko Rapeli 
> ---
>  meta/lib/oeqa/sdk/case.py  | 2 +-
>  meta/lib/oeqa/sdk/utils/sdkbuildproject.py | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/lib/oeqa/sdk/case.py b/meta/lib/oeqa/sdk/case.py
> index d8611c8..5334237 100644
> --- a/meta/lib/oeqa/sdk/case.py
> +++ b/meta/lib/oeqa/sdk/case.py
> @@ -9,7 +9,7 @@ from oeqa.core.case import OETestCase
>  class OESDKTestCase(OETestCase):
>  def _run(self, cmd):
>  return subprocess.check_output(". %s > /dev/null; %s;" % \
> -(self.tc.sdk_env, cmd), shell=True,
> +(self.tc.sdk_env, cmd), shell=True,
> executable="/bin/bash",
>  stderr=subprocess.STDOUT, universal_newlines=True)
>  
>  def fetch(self, workdir, dl_dir, url, archive=None):
> diff --git a/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
> b/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
> index 6fed73e..eafbd7a 100644
> --- a/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
> +++ b/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
> @@ -42,7 +42,8 @@ class SDKBuildProject(BuildProject):
>  def _run(self, cmd):
>  self.log("Running . %s; " % self.sdkenv + cmd)
>  try:
> -output = subprocess.check_output(". %s; " % self.sdkenv
> + cmd, shell=True, stderr=subprocess.STDOUT)
> +output = subprocess.check_output(". %s; " % self.sdkenv
> + cmd, shell=True,
> + executable='/bin/bash',
> stderr=subprocess.STDOUT)
>  except subprocess.CalledProcessError as exc:
>  print(exc.output.decode('utf-8'))
>  return exc.returncode
> -- 
> 1.9.1
> 
-- 
Joshua Watt 

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/2] eoqa: use bash to execute SDK test commands

2019-05-08 Thread Mikko Rapeli
The commands only work with with bash. If /bin/sh is
dash like in Debian, the command execution fails with
errors like:

Standard Output: /bin/sh: 5: export: --sysroot: bad variable name

and all SDK tests fail.

Signed-off-by: Mikko Rapeli 
---
 meta/lib/oeqa/sdk/case.py  | 2 +-
 meta/lib/oeqa/sdk/utils/sdkbuildproject.py | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/sdk/case.py b/meta/lib/oeqa/sdk/case.py
index d8611c8..5334237 100644
--- a/meta/lib/oeqa/sdk/case.py
+++ b/meta/lib/oeqa/sdk/case.py
@@ -9,7 +9,7 @@ from oeqa.core.case import OETestCase
 class OESDKTestCase(OETestCase):
 def _run(self, cmd):
 return subprocess.check_output(". %s > /dev/null; %s;" % \
-(self.tc.sdk_env, cmd), shell=True,
+(self.tc.sdk_env, cmd), shell=True, executable="/bin/bash",
 stderr=subprocess.STDOUT, universal_newlines=True)
 
 def fetch(self, workdir, dl_dir, url, archive=None):
diff --git a/meta/lib/oeqa/sdk/utils/sdkbuildproject.py 
b/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
index 6fed73e..eafbd7a 100644
--- a/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
+++ b/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
@@ -42,7 +42,8 @@ class SDKBuildProject(BuildProject):
 def _run(self, cmd):
 self.log("Running . %s; " % self.sdkenv + cmd)
 try:
-output = subprocess.check_output(". %s; " % self.sdkenv + cmd, 
shell=True, stderr=subprocess.STDOUT)
+output = subprocess.check_output(". %s; " % self.sdkenv + cmd, 
shell=True,
+ executable='/bin/bash', 
stderr=subprocess.STDOUT)
 except subprocess.CalledProcessError as exc:
 print(exc.output.decode('utf-8'))
 return exc.returncode
-- 
1.9.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core