]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
testexport.bbclass: export bitbake/lib
authorMikko Rapeli <mikko.rapeli@linaro.org>
Fri, 21 Nov 2025 15:41:39 +0000 (17:41 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Nov 2025 11:01:03 +0000 (11:01 +0000)
utils/httpserver.py now depends on bb and multiprocessing.

Fixes oeqa test execution:

https://ledge.validation.linaro.org/scheduler/job/123974

ImportError: Failed to import test module: apt
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/lava-downloads/core-image-sato/meta/lib/oeqa/runtime/cases/apt.py", line 8, in <module>
    from oeqa.utils.httpserver import HTTPService
  File "/lava-downloads/core-image-sato/meta/lib/oeqa/utils/httpserver.py", line 9, in <module>
    from bb import multiprocessing
ModuleNotFoundError: No module named 'bb'

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/classes-recipe/testexport.bbclass

index 843d777e3bb9f842c16d77e8f792e746e33b92b3..344ae489b5a0f0ce899cf2773d6111431025e1e6 100644 (file)
@@ -84,6 +84,7 @@ def copy_needed_files(d, tc):
     from oeqa.core.utils.test import getSuiteCasesFiles
 
     export_path = d.getVar('TEST_EXPORT_DIR')
+    bitbake_path = d.getVar('BITBAKEPATH')
     corebase_path = d.getVar('COREBASE')
     bblayers = d.getVar('BBLAYERS').split()
 
@@ -91,9 +92,18 @@ def copy_needed_files(d, tc):
     oe.path.remove(export_path)
     bb.utils.mkdirhier(os.path.join(export_path, 'lib', 'oeqa'))
 
-    # The source of files to copy are relative to 'COREBASE' directory
-    # The destination is relative to 'TEST_EXPORT_DIR'
-    # core files/dirs first
+    # The source of files to copy are relative to 'BITBAKEPATH' and 'COREBASE'
+    # directory. The destination is relative to 'TEST_EXPORT_DIR'.
+    # bitbake and core files/dirs first.
+    bitbake_files_to_copy = [os.path.join('..', 'lib')]
+    for f in bitbake_files_to_copy:
+        src = os.path.join(bitbake_path, f)
+        dst = os.path.join(export_path, 'bitbake', f.split('/', 1)[-1])
+        if os.path.isdir(src):
+            oe.path.copytree(src, dst)
+        else:
+            shutil.copy2(src, dst)
+
     core_files_to_copy = [ os.path.join('scripts', 'oe-test'),
                       os.path.join('scripts', 'lib', 'argparse_oe.py'),
                       os.path.join('scripts', 'lib', 'scriptutils.py'), ]