Skip to contentSkip to conversation

nss: fix Upstream-Status format

PATCH In review Ross Burton 3 participants 7 messages Dec 10, 2018 – Dec 14, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 nss: fix Upstream-Status format

---
 meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-32be.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-32be.patch +1 -1
index 7ba8d16483a..bb1c6e3b345 100644
@@ -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 <[email protected]>
 ---
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/4 oeqa/sdk: show output if run() fails

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.

---
 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(-)
meta/lib/oeqa/sdk/cases/buildcpio.py +3 -0
index f348ac5d909..6697b12de29 100644
@@ -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']
 
meta/lib/oeqa/sdk/cases/buildlzip.py +2 -0
index 9d137f30ebf..b57fbbece7f 100644
@@ -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']
meta/lib/oeqa/sdk/cases/gcc.py +3 -0
index b32b01fc241..54c6fc488bc 100644
@@ -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']
 
meta/lib/oeqa/sdk/cases/perl.py +6 -6
index e1d2bc159a0..b8adc5ac72d 100644
@@ -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")
meta/lib/oeqa/sdk/cases/python.py +9 -12
index 2254867d455..b9174fadbaa 100644
@@ -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")
meta/lib/oeqa/sdkext/cases/devtool.py +3 -0
index 0860e8d17cf..d322f86c73e 100644
@@ -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):
Signature · 1 line
2.11.0
#2 lore raw

PATCH 3/4 oeqa/sdk: clean up galculator test

In reply to Ross Burton

Drop redundant imports and variables, and use os.makedirs() instead of bb.utils.mkdirhier().

---
 meta/lib/oeqa/sdk/cases/buildgalculator.py | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
meta/lib/oeqa/sdk/cases/buildgalculator.py +1 -7
index 7beb55884d3..c488a1c73e2 100644
@@ -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))
Signature · 1 line
2.11.0
#3 lore raw

PATCH 4/4 oeqa/sdk: rewrite lzip test

In reply to Ross Burton

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.

---
 meta/lib/oeqa/sdk/cases/buildlzip.py | 46 +++++++++++++-----------------------
 1 file changed, 16 insertions(+), 30 deletions(-)
meta/lib/oeqa/sdk/cases/buildlzip.py +16 -30
index b57fbbece7f..d98e10fc37f 100644
@@ -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"))
Signature · 1 line
2.11.0
#4 lore raw

Re: [PATCH 4/4] oeqa/sdk: rewrite lzip test

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

Quoted 69 lines · Ross Burton

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.

---
  meta/lib/oeqa/sdk/cases/buildlzip.py | 46 +++++++++++++-----------------------
  1 file changed, 16 insertions(+), 30 deletions(-)
meta/lib/oeqa/sdk/cases/buildlzip.py +16 -30
index b57fbbece7f..d98e10fc37f 100644
@@ -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"))
#6 lore raw
In reply to Ross Burton

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 : [email protected]

Quoted 40 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ross Burton
Sent: Tuesday, December 11, 2018 1:12 AM
To: [email protected]
Subject: [OE-core] [PATCH 1/4] nss: fix Upstream-Status format

---
 meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-32be.patch | 2
+-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

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

meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-32be.patch +1 -2
@@ -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 <[email protected]>
 ---
--

2.11.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core