reset upstream subtrees to yocto 2.6

Reset the following subtrees on thud HEAD:

  poky: 87e3a9739d
  meta-openembedded: 6094ae18c8
  meta-security: 31dc4e7532
  meta-raspberrypi: a48743dc36
  meta-xilinx: c42016e2e6

Also re-apply backports that didn't make it into thud:
  poky:
    17726d0 systemd-systemctl-native: handle Install wildcards

  meta-openembedded:
    4321a5d libtinyxml2: update to 7.0.1
    042f0a3 libcereal: Add native and nativesdk classes
    e23284f libcereal: Allow empty package
    030e8d4 rsyslog: curl-less build with fmhttp PACKAGECONFIG
    179a1b9 gtest: update to 1.8.1

Squashed OpenBMC subtree compatibility updates:
  meta-aspeed:
    Brad Bishop (1):
          aspeed: add yocto 2.6 compatibility

  meta-ibm:
    Brad Bishop (1):
          ibm: prepare for yocto 2.6

  meta-ingrasys:
    Brad Bishop (1):
          ingrasys: set layer compatibility to yocto 2.6

  meta-openpower:
    Brad Bishop (1):
          openpower: set layer compatibility to yocto 2.6

  meta-phosphor:
    Brad Bishop (3):
          phosphor: set layer compatibility to thud
          phosphor: libgpg-error: drop patches
          phosphor: react to fitimage artifact rename

    Ed Tanous (4):
          Dropbear: upgrade options for latest upgrade
          yocto2.6: update openssl options
          busybox: remove upstream watchdog patch
          systemd: Rebase CONFIG_CGROUP_BPF patch

Change-Id: I7b1fe71cca880d0372a82d94b5fd785323e3a9e7
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/poky/meta/lib/oeqa/sdk/cases/assimp.py b/poky/meta/lib/oeqa/sdk/cases/assimp.py
new file mode 100644
index 0000000..26c1df0
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/cases/assimp.py
@@ -0,0 +1,63 @@
+import os, subprocess, unittest
+import bb
+from oeqa.sdk.case import OESDKTestCase
+
+from oeqa.utils.subprocesstweak import errors_have_output
+errors_have_output()
+
+class BuildAssimp(OESDKTestCase):
+    """
+    Test case to build a project using cmake.
+    """
+
+    td_vars = ['DATETIME', 'TARGET_OS', 'TARGET_ARCH']
+
+    @classmethod
+    def setUpClass(self):
+        if not (self.tc.hasHostPackage("nativesdk-cmake") or
+                self.tc.hasHostPackage("cmake-native")):
+            raise unittest.SkipTest("Needs cmake")
+
+    def fetch(self, workdir, dl_dir, url, archive=None):
+        if not archive:
+            from urllib.parse import urlparse
+            archive = os.path.basename(urlparse(url).path)
+
+        if dl_dir:
+            tarball = os.path.join(dl_dir, archive)
+            if os.path.exists(tarball):
+                return tarball
+
+        tarball = os.path.join(workdir, archive)
+        subprocess.check_output(["wget", "-O", tarball, url])
+        return tarball
+
+    def test_assimp(self):
+        import tempfile
+        import oe.qa, oe.elf
+
+        with tempfile.TemporaryDirectory(prefix="assimp", dir=self.tc.sdk_dir) as testdir:
+            dl_dir = self.td.get('DL_DIR', None)
+            tarball = self.fetch(testdir, dl_dir, "https://github.com/assimp/assimp/archive/v4.1.0.tar.gz")
+            subprocess.check_output(["tar", "xf", tarball, "-C", testdir])
+
+            sourcedir = os.path.join(testdir, "assimp-4.1.0") 
+            builddir = os.path.join(testdir, "build")
+            installdir = os.path.join(testdir, "install")
+            bb.utils.mkdirhier(builddir)
+
+            self._run("cd %s && cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON %s " % (builddir, sourcedir))
+            self._run("cmake --build %s -- -j" % builddir)
+            self._run("cmake --build %s --target install -- DESTDIR=%s" % (builddir, installdir))
+
+            elf = oe.qa.ELFFile(os.path.join(installdir, "usr", "local", "lib", "libassimp.so.4.1.0"))
+            elf.open()
+
+            output = self._run("echo $OECORE_TARGET_OS:$OECORE_TARGET_ARCH")
+            target_os, target_arch = output.strip().split(":")
+            machine_data = oe.elf.machine_dict(None)[target_os][target_arch]
+            (machine, osabi, abiversion, endian, bits) = machine_data
+
+            self.assertEqual(machine, elf.machine())
+            self.assertEqual(bits, elf.abiSize())
+            self.assertEqual(endian, elf.isLittleEndian())
diff --git a/poky/meta/lib/oeqa/sdk/cases/buildgalculator.py b/poky/meta/lib/oeqa/sdk/cases/buildgalculator.py
index 780afcc..050d1b3 100644
--- a/poky/meta/lib/oeqa/sdk/cases/buildgalculator.py
+++ b/poky/meta/lib/oeqa/sdk/cases/buildgalculator.py
@@ -8,9 +8,11 @@
 
     @classmethod
     def setUpClass(self):
-        if not (self.tc.hasTargetPackage("gtk\+3") or\
-                self.tc.hasTargetPackage("libgtk-3.0")):
+        if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \
+                self.tc.hasTargetPackage("libgtk-3.0", multilib=True)):
             raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
+        if not (self.tc.hasHostPackage("nativesdk-gettext-dev")):
+            raise unittest.SkipTest("GalculatorTest class: SDK doesn't contain gettext")
 
     def test_galculator(self):
         dl_dir = self.td.get('DL_DIR', None)
diff --git a/poky/meta/lib/oeqa/sdk/cases/buildlzip.py b/poky/meta/lib/oeqa/sdk/cases/buildlzip.py
index 3a89ce8..b28cc3a 100644
--- a/poky/meta/lib/oeqa/sdk/cases/buildlzip.py
+++ b/poky/meta/lib/oeqa/sdk/cases/buildlzip.py
@@ -17,8 +17,8 @@
 
         machine = self.td.get("MACHINE")
 
-        if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or
-                self.tc.hasTargetPackage("gcc")):
+        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):
diff --git a/poky/meta/lib/oeqa/sdk/cases/gcc.py b/poky/meta/lib/oeqa/sdk/cases/gcc.py
index d11f4b6..b32b01f 100644
--- a/poky/meta/lib/oeqa/sdk/cases/gcc.py
+++ b/poky/meta/lib/oeqa/sdk/cases/gcc.py
@@ -18,8 +18,8 @@
 
     def setUp(self):
         machine = self.td.get("MACHINE")
-        if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or
-                self.tc.hasTargetPackage("gcc")):
+        if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or
+                self.tc.hasHostPackage("^gcc-", regex=True)):
             raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain")
 
     def test_gcc_compile(self):
diff --git a/poky/meta/lib/oeqa/sdk/cases/perl.py b/poky/meta/lib/oeqa/sdk/cases/perl.py
index 8085678..ff50b46 100644
--- a/poky/meta/lib/oeqa/sdk/cases/perl.py
+++ b/poky/meta/lib/oeqa/sdk/cases/perl.py
@@ -1,8 +1,4 @@
-import os
-import shutil
 import unittest
-
-from oeqa.core.utils.path import remove_safe
 from oeqa.sdk.case import OESDKTestCase
 
 class PerlTest(OESDKTestCase):
@@ -12,17 +8,10 @@
                 self.tc.hasHostPackage("perl-native")):
             raise unittest.SkipTest("No perl package in the SDK")
 
-        for f in ['test.pl']:
-            shutil.copyfile(os.path.join(self.tc.files_dir, f),
-                    os.path.join(self.tc.sdk_dir, f))
-        self.testfile = os.path.join(self.tc.sdk_dir, "test.pl")
-
-    def test_perl_exists(self):
-        self._run('which perl')
-
-    def test_perl_works(self):
-        self._run('perl %s' % self.testfile)
-
-    @classmethod
-    def tearDownClass(self):
-        remove_safe(self.testfile)
+    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))
diff --git a/poky/meta/lib/oeqa/sdk/cases/python.py b/poky/meta/lib/oeqa/sdk/cases/python.py
index 72dfcc7..bd5f1f6 100644
--- a/poky/meta/lib/oeqa/sdk/cases/python.py
+++ b/poky/meta/lib/oeqa/sdk/cases/python.py
@@ -1,32 +1,17 @@
-import os
-import shutil
-import unittest
-
-from oeqa.core.utils.path import remove_safe
+import subprocess, unittest
 from oeqa.sdk.case import OESDKTestCase
 
 class PythonTest(OESDKTestCase):
     @classmethod
     def setUpClass(self):
-        if not (self.tc.hasHostPackage("nativesdk-python") or
-                self.tc.hasHostPackage("python-native")):
+        if not (self.tc.hasHostPackage("nativesdk-python3") or
+                self.tc.hasHostPackage("python3-native")):
             raise unittest.SkipTest("No python package in the SDK")
 
-        for f in ['test.py']:
-            shutil.copyfile(os.path.join(self.tc.files_dir, f),
-                   os.path.join(self.tc.sdk_dir, f))
-
-    def test_python_exists(self):
-        self._run('which python')
-
-    def test_python_stdout(self):
-        output = self._run('python %s/test.py' % self.tc.sdk_dir)
-        self.assertEqual(output.strip(), "the value of a is 0.01", msg="Incorrect output: %s" % output)
-
-    def test_python_testfile(self):
-        self._run('ls /tmp/testfile.python')
-
-    @classmethod
-    def tearDownClass(self):
-        remove_safe("%s/test.py" % self.tc.sdk_dir)
-        remove_safe("/tmp/testfile.python")
+    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))
diff --git a/poky/meta/lib/oeqa/sdk/context.py b/poky/meta/lib/oeqa/sdk/context.py
index 82e4c19b..adc4166 100644
--- a/poky/meta/lib/oeqa/sdk/context.py
+++ b/poky/meta/lib/oeqa/sdk/context.py
@@ -20,17 +20,30 @@
         self.target_pkg_manifest = target_pkg_manifest
         self.host_pkg_manifest = host_pkg_manifest
 
-    def _hasPackage(self, manifest, pkg):
-        for host_pkg in manifest.keys():
-            if re.search(pkg, host_pkg):
+    def _hasPackage(self, manifest, pkg, regex=False):
+        if regex:
+            # do regex match
+            pat = re.compile(pkg)
+            for p in manifest.keys():
+                if pat.search(p):
+                    return True
+        else:
+            # do exact match
+            if pkg in manifest.keys():
                 return True
         return False
 
-    def hasHostPackage(self, pkg):
-        return self._hasPackage(self.host_pkg_manifest, pkg)
+    def hasHostPackage(self, pkg, regex=False):
+        return self._hasPackage(self.host_pkg_manifest, pkg, regex=regex)
 
-    def hasTargetPackage(self, pkg):
-        return self._hasPackage(self.target_pkg_manifest, pkg)
+    def hasTargetPackage(self, pkg, multilib=False, regex=False):
+        if multilib:
+            # match multilib according to sdk_env
+            mls = self.td.get('MULTILIB_VARIANTS', '').split()
+            for ml in mls:
+                if ('ml'+ml) in self.sdk_env:
+                    pkg = ml + '-' + pkg
+        return self._hasPackage(self.target_pkg_manifest, pkg, regex=regex)
 
 class OESDKTestContextExecutor(OETestContextExecutor):
     _context_class = OESDKTestContext
@@ -65,6 +78,9 @@
         sdk_rgroup.add_argument('--sdk-dir', required=False, action='store', 
             help='sdk installed directory')
 
+        self.parser.add_argument('-j', '--num-processes', dest='processes', action='store',
+                type=int, help="number of processes to execute in parallel with")
+
     @staticmethod
     def _load_manifest(manifest):
         pkg_manifest = {}
@@ -85,6 +101,7 @@
                 OESDKTestContextExecutor._load_manifest(args.target_manifest)
         self.tc_kwargs['init']['host_pkg_manifest'] = \
                 OESDKTestContextExecutor._load_manifest(args.host_manifest)
+        self.tc_kwargs['run']['processes'] = args.processes
 
     @staticmethod
     def _get_sdk_environs(sdk_dir):
diff --git a/poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py b/poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
index 4e25114..6fed73e 100644
--- a/poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
+++ b/poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
@@ -20,10 +20,9 @@
         BuildProject.__init__(self, uri, foldername, tmpdir=testpath, dl_dir=dl_dir)
 
     def download_archive(self):
-
         self._download_archive()
 
-        cmd = 'tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir)
+        cmd = 'tar xf %s -C %s' % (os.path.join(self.targetdir, self.archive), self.targetdir)
         subprocess.check_output(cmd, shell=True)
 
         #Change targetdir to project folder
@@ -42,4 +41,9 @@
 
     def _run(self, cmd):
         self.log("Running . %s; " % self.sdkenv + cmd)
-        return subprocess.call(". %s; " % self.sdkenv + cmd, shell=True)
+        try:
+            output = subprocess.check_output(". %s; " % self.sdkenv + cmd, shell=True, stderr=subprocess.STDOUT)
+        except subprocess.CalledProcessError as exc:
+            print(exc.output.decode('utf-8'))
+            return exc.returncode
+        return 0