* [PATCH 2/4] oeqa/sdk: show output if run() fails
2018-12-10 17:11 [PATCH 1/4] nss: fix Upstream-Status format Ross Burton
@ 2018-12-10 17:11 ` Ross Burton
2018-12-10 17:11 ` [PATCH 3/4] oeqa/sdk: clean up galculator test Ross Burton
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2018-12-10 17:11 UTC (permalink / raw)
To: openembedded-core
Use oeqa.utils.subprocesstweak to monkey-patch the subprocess exception so that
any output is shown, and remove any explicit try/catch handling that would have
hidden this.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/lib/oeqa/sdk/cases/buildcpio.py | 3 +++
meta/lib/oeqa/sdk/cases/buildlzip.py | 2 ++
meta/lib/oeqa/sdk/cases/gcc.py | 3 +++
meta/lib/oeqa/sdk/cases/perl.py | 12 ++++++------
meta/lib/oeqa/sdk/cases/python.py | 21 +++++++++------------
meta/lib/oeqa/sdkext/cases/devtool.py | 3 +++
6 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/meta/lib/oeqa/sdk/cases/buildcpio.py b/meta/lib/oeqa/sdk/cases/buildcpio.py
index f348ac5d909..6697b12de29 100644
--- a/meta/lib/oeqa/sdk/cases/buildcpio.py
+++ b/meta/lib/oeqa/sdk/cases/buildcpio.py
@@ -2,6 +2,9 @@ import unittest
from oeqa.sdk.case import OESDKTestCase
from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
+from oeqa.utils.subprocesstweak import errors_have_output
+errors_have_output()
+
class BuildCpioTest(OESDKTestCase):
td_vars = ['DATETIME']
diff --git a/meta/lib/oeqa/sdk/cases/buildlzip.py b/meta/lib/oeqa/sdk/cases/buildlzip.py
index 9d137f30ebf..b57fbbece7f 100644
--- a/meta/lib/oeqa/sdk/cases/buildlzip.py
+++ b/meta/lib/oeqa/sdk/cases/buildlzip.py
@@ -2,6 +2,8 @@ import unittest
from oeqa.sdk.case import OESDKTestCase
from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
+from oeqa.utils.subprocesstweak import errors_have_output
+errors_have_output()
class BuildLzipTest(OESDKTestCase):
td_vars = ['DATETIME']
diff --git a/meta/lib/oeqa/sdk/cases/gcc.py b/meta/lib/oeqa/sdk/cases/gcc.py
index b32b01fc241..54c6fc488bc 100644
--- a/meta/lib/oeqa/sdk/cases/gcc.py
+++ b/meta/lib/oeqa/sdk/cases/gcc.py
@@ -5,6 +5,9 @@ import unittest
from oeqa.core.utils.path import remove_safe
from oeqa.sdk.case import OESDKTestCase
+from oeqa.utils.subprocesstweak import errors_have_output
+errors_have_output()
+
class GccCompileTest(OESDKTestCase):
td_vars = ['MACHINE']
diff --git a/meta/lib/oeqa/sdk/cases/perl.py b/meta/lib/oeqa/sdk/cases/perl.py
index e1d2bc159a0..b8adc5ac72d 100644
--- a/meta/lib/oeqa/sdk/cases/perl.py
+++ b/meta/lib/oeqa/sdk/cases/perl.py
@@ -1,6 +1,9 @@
import unittest
from oeqa.sdk.case import OESDKTestCase
+from oeqa.utils.subprocesstweak import errors_have_output
+errors_have_output()
+
class PerlTest(OESDKTestCase):
def setUp(self):
if not (self.tc.hasHostPackage("nativesdk-perl") or
@@ -8,9 +11,6 @@ class PerlTest(OESDKTestCase):
raise unittest.SkipTest("No perl package in the SDK")
def test_perl(self):
- try:
- cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'"
- output = self._run(cmd)
- self.assertEqual(output, "Hello, world")
- except subprocess.CalledProcessError as e:
- self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output))
+ cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'"
+ output = self._run(cmd)
+ self.assertEqual(output, "Hello, world")
diff --git a/meta/lib/oeqa/sdk/cases/python.py b/meta/lib/oeqa/sdk/cases/python.py
index 2254867d455..b9174fadbaa 100644
--- a/meta/lib/oeqa/sdk/cases/python.py
+++ b/meta/lib/oeqa/sdk/cases/python.py
@@ -1,6 +1,9 @@
import subprocess, unittest
from oeqa.sdk.case import OESDKTestCase
+from oeqa.utils.subprocesstweak import errors_have_output
+errors_have_output()
+
class Python2Test(OESDKTestCase):
def setUp(self):
if not (self.tc.hasHostPackage("nativesdk-python-core") or
@@ -8,12 +11,9 @@ class Python2Test(OESDKTestCase):
raise unittest.SkipTest("No python package in the SDK")
def test_python2(self):
- try:
- cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
- output = self._run(cmd)
- self.assertEqual(output, "Hello, world\n")
- except subprocess.CalledProcessError as e:
- self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output))
+ cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
+ output = self._run(cmd)
+ self.assertEqual(output, "Hello, world\n")
class Python3Test(OESDKTestCase):
def setUp(self):
@@ -22,9 +22,6 @@ class Python3Test(OESDKTestCase):
raise unittest.SkipTest("No python3 package in the SDK")
def test_python3(self):
- try:
- cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
- output = self._run(cmd)
- self.assertEqual(output, "Hello, world\n")
- except subprocess.CalledProcessError as e:
- self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output))
+ cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\""
+ output = self._run(cmd)
+ self.assertEqual(output, "Hello, world\n")
diff --git a/meta/lib/oeqa/sdkext/cases/devtool.py b/meta/lib/oeqa/sdkext/cases/devtool.py
index 0860e8d17cf..d322f86c73e 100644
--- a/meta/lib/oeqa/sdkext/cases/devtool.py
+++ b/meta/lib/oeqa/sdkext/cases/devtool.py
@@ -9,6 +9,9 @@ from oeqa.sdkext.case import OESDKExtTestCase
from oeqa.core.decorator.oeid import OETestID
from oeqa.utils.httpserver import HTTPService
+from oeqa.utils.subprocesstweak import errors_have_output
+errors_have_output()
+
class DevtoolTest(OESDKExtTestCase):
@classmethod
def setUpClass(cls):
--
2.11.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 3/4] oeqa/sdk: clean up galculator test
2018-12-10 17:11 [PATCH 1/4] nss: fix Upstream-Status format Ross Burton
2018-12-10 17:11 ` [PATCH 2/4] oeqa/sdk: show output if run() fails Ross Burton
@ 2018-12-10 17:11 ` Ross Burton
2018-12-10 17:11 ` [PATCH 4/4] oeqa/sdk: rewrite lzip test Ross Burton
2018-12-14 6:20 ` [PATCH 1/4] nss: fix Upstream-Status format Zheng, Ruoqin
3 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2018-12-10 17:11 UTC (permalink / raw)
To: openembedded-core
Drop redundant imports and variables, and use os.makedirs() instead of
bb.utils.mkdirhier().
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/lib/oeqa/sdk/cases/buildgalculator.py | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/meta/lib/oeqa/sdk/cases/buildgalculator.py b/meta/lib/oeqa/sdk/cases/buildgalculator.py
index 7beb55884d3..c488a1c73e2 100644
--- a/meta/lib/oeqa/sdk/cases/buildgalculator.py
+++ b/meta/lib/oeqa/sdk/cases/buildgalculator.py
@@ -3,17 +3,11 @@ import subprocess
import tempfile
import unittest
-import bb
-
from oeqa.sdk.case import OESDKTestCase
-from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
-
from oeqa.utils.subprocesstweak import errors_have_output
errors_have_output()
class GalculatorTest(OESDKTestCase):
- td_vars = ['DATETIME']
-
def setUp(self):
if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \
self.tc.hasTargetPackage("libgtk-3.0", multilib=True)):
@@ -33,8 +27,8 @@ class GalculatorTest(OESDKTestCase):
subprocess.check_output(["tar", "xf", tarball, "-C", testdir])
self.assertTrue(os.path.isdir(dirs["source"]))
+ os.makedirs(dirs["build"])
- bb.utils.mkdirhier(dirs["build"])
self._run("cd {source} && autoreconf -i -f -I $OECORE_TARGET_SYSROOT/usr/share/aclocal -I m4".format(**dirs))
self._run("cd {build} && {source}/configure $CONFIGURE_FLAGS".format(**dirs))
self._run("cd {build} && make -j".format(**dirs))
--
2.11.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 4/4] oeqa/sdk: rewrite lzip test
2018-12-10 17:11 [PATCH 1/4] nss: fix Upstream-Status format Ross Burton
2018-12-10 17:11 ` [PATCH 2/4] oeqa/sdk: show output if run() fails Ross Burton
2018-12-10 17:11 ` [PATCH 3/4] oeqa/sdk: clean up galculator test Ross Burton
@ 2018-12-10 17:11 ` Ross Burton
2018-12-11 9:50 ` ChenQi
2018-12-14 6:20 ` [PATCH 1/4] nss: fix Upstream-Status format Zheng, Ruoqin
3 siblings, 1 reply; 7+ messages in thread
From: Ross Burton @ 2018-12-10 17:11 UTC (permalink / raw)
To: openembedded-core
Don't use the helper class as it gets in the way more than it helps, exercise
the out-of-tree paths, and verify the installed files match the expected
architecture.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/lib/oeqa/sdk/cases/buildlzip.py | 46 +++++++++++++-----------------------
1 file changed, 16 insertions(+), 30 deletions(-)
diff --git a/meta/lib/oeqa/sdk/cases/buildlzip.py b/meta/lib/oeqa/sdk/cases/buildlzip.py
index b57fbbece7f..d98e10fc37f 100644
--- a/meta/lib/oeqa/sdk/cases/buildlzip.py
+++ b/meta/lib/oeqa/sdk/cases/buildlzip.py
@@ -1,39 +1,25 @@
-import unittest
+import os, tempfile, subprocess, unittest
from oeqa.sdk.case import OESDKTestCase
-from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
-
from oeqa.utils.subprocesstweak import errors_have_output
errors_have_output()
class BuildLzipTest(OESDKTestCase):
- td_vars = ['DATETIME']
-
- @classmethod
- def setUpClass(self):
- dl_dir = self.td.get('DL_DIR', None)
-
- self.project = SDKBuildProject(self.tc.sdk_dir + "/lzip/", self.tc.sdk_env,
- "http://downloads.yoctoproject.org/mirror/sources/lzip-1.19.tar.gz",
- self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
- self.project.download_archive()
-
- def setUp(self):
- machine = self.td.get("MACHINE")
-
- if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or
- self.tc.hasHostPackage("^gcc-", regex=True)):
- raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain")
-
def test_lzip(self):
- self.assertEqual(self.project.run_configure(), 0,
- msg="Running configure failed")
+ with tempfile.TemporaryDirectory(prefix="lzip", dir=self.tc.sdk_dir) as testdir:
+ dl_dir = self.td.get('DL_DIR', None)
+ tarball = self.fetch(testdir, dl_dir, "http://downloads.yoctoproject.org/mirror/sources/lzip-1.19.tar.gz")
+
+ dirs = {}
+ dirs["source"] = os.path.join(testdir, "lzip-1.19")
+ dirs["build"] = os.path.join(testdir, "build")
+ dirs["install"] = os.path.join(testdir, "install")
- self.assertEqual(self.project.run_make(), 0,
- msg="Running make failed")
+ subprocess.check_output(["tar", "xf", tarball, "-C", testdir])
+ self.assertTrue(os.path.isdir(dirs["source"]))
+ os.makedirs(dirs["build"])
- self.assertEqual(self.project.run_install(), 0,
- msg="Running make install failed")
+ self._run("cd {build} && {source}/configure --srcdir {source} $CONFIGURE_FLAGS".format(**dirs))
+ self._run("cd {build} && make -j".format(**dirs))
+ self._run("cd {build} && make install DESTDIR={install}".format(**dirs))
- @classmethod
- def tearDownClass(self):
- self.project.clean()
+ self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "lzip"))
--
2.11.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 4/4] oeqa/sdk: rewrite lzip test
2018-12-10 17:11 ` [PATCH 4/4] oeqa/sdk: rewrite lzip test Ross Burton
@ 2018-12-11 9:50 ` ChenQi
2018-12-11 10:41 ` Burton, Ross
0 siblings, 1 reply; 7+ messages in thread
From: ChenQi @ 2018-12-11 9:50 UTC (permalink / raw)
To: Ross Burton, openembedded-core
There's a failure related to this patch.
https://autobuilder.yoctoproject.org/typhoon/#/builders/48/builds/80/steps/7/logs/step1c
Best Regards,
Chen Qi
On 12/11/2018 01:11 AM, Ross Burton wrote:
> Don't use the helper class as it gets in the way more than it helps, exercise
> the out-of-tree paths, and verify the installed files match the expected
> architecture.
>
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
> meta/lib/oeqa/sdk/cases/buildlzip.py | 46 +++++++++++++-----------------------
> 1 file changed, 16 insertions(+), 30 deletions(-)
>
> diff --git a/meta/lib/oeqa/sdk/cases/buildlzip.py b/meta/lib/oeqa/sdk/cases/buildlzip.py
> index b57fbbece7f..d98e10fc37f 100644
> --- a/meta/lib/oeqa/sdk/cases/buildlzip.py
> +++ b/meta/lib/oeqa/sdk/cases/buildlzip.py
> @@ -1,39 +1,25 @@
> -import unittest
> +import os, tempfile, subprocess, unittest
> from oeqa.sdk.case import OESDKTestCase
> -from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
> -
> from oeqa.utils.subprocesstweak import errors_have_output
> errors_have_output()
>
> class BuildLzipTest(OESDKTestCase):
> - td_vars = ['DATETIME']
> -
> - @classmethod
> - def setUpClass(self):
> - dl_dir = self.td.get('DL_DIR', None)
> -
> - self.project = SDKBuildProject(self.tc.sdk_dir + "/lzip/", self.tc.sdk_env,
> - "http://downloads.yoctoproject.org/mirror/sources/lzip-1.19.tar.gz",
> - self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
> - self.project.download_archive()
> -
> - def setUp(self):
> - machine = self.td.get("MACHINE")
> -
> - if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or
> - self.tc.hasHostPackage("^gcc-", regex=True)):
> - raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain")
> -
> def test_lzip(self):
> - self.assertEqual(self.project.run_configure(), 0,
> - msg="Running configure failed")
> + with tempfile.TemporaryDirectory(prefix="lzip", dir=self.tc.sdk_dir) as testdir:
> + dl_dir = self.td.get('DL_DIR', None)
> + tarball = self.fetch(testdir, dl_dir, "http://downloads.yoctoproject.org/mirror/sources/lzip-1.19.tar.gz")
> +
> + dirs = {}
> + dirs["source"] = os.path.join(testdir, "lzip-1.19")
> + dirs["build"] = os.path.join(testdir, "build")
> + dirs["install"] = os.path.join(testdir, "install")
>
> - self.assertEqual(self.project.run_make(), 0,
> - msg="Running make failed")
> + subprocess.check_output(["tar", "xf", tarball, "-C", testdir])
> + self.assertTrue(os.path.isdir(dirs["source"]))
> + os.makedirs(dirs["build"])
>
> - self.assertEqual(self.project.run_install(), 0,
> - msg="Running make install failed")
> + self._run("cd {build} && {source}/configure --srcdir {source} $CONFIGURE_FLAGS".format(**dirs))
> + self._run("cd {build} && make -j".format(**dirs))
> + self._run("cd {build} && make install DESTDIR={install}".format(**dirs))
>
> - @classmethod
> - def tearDownClass(self):
> - self.project.clean()
> + self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "lzip"))
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] nss: fix Upstream-Status format
2018-12-10 17:11 [PATCH 1/4] nss: fix Upstream-Status format Ross Burton
` (2 preceding siblings ...)
2018-12-10 17:11 ` [PATCH 4/4] oeqa/sdk: rewrite lzip test Ross Burton
@ 2018-12-14 6:20 ` Zheng, Ruoqin
3 siblings, 0 replies; 7+ messages in thread
From: Zheng, Ruoqin @ 2018-12-14 6:20 UTC (permalink / raw)
To: Ross Burton, openembedded-core@lists.openembedded.org
Hi Ross:
My patch has been merged by Upstream NSS:
https://hg.mozilla.org/projects/nss/rev/66cae6a8f4b640bec5e8510dcfc247e0546c973c
--------------------------------------------------
Zheng Ruoqin
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
Nanjing, 210012, China
MAIL : zhengrq.fnst@cn.fujistu.com
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Ross Burton
> Sent: Tuesday, December 11, 2018 1:12 AM
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH 1/4] nss: fix Upstream-Status format
>
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
> meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-32be.patch | 2
> +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-
> 32be.patch b/meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-
> 32be.patch
> index 7ba8d16483a..bb1c6e3b345 100644
> --- a/meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-
> 32be.patch
> +++ b/meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-
> 32be.patch
> @@ -2,7 +2,7 @@ Subject: [PATCH] Fix SHA_HTONL bug for arm 32be.
>
> In arm 32be, there is no need to reverse the host value.
>
> -Upstream Status: Pending
> +Upstream-Status: Pending
>
> Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
> ---
> --
> 2.11.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
^ permalink raw reply [flat|nested] 7+ messages in thread