When testexport.bbclass is used, then build environment and bitbake
may not be available when oeqa tests run.

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 <[email protected]>
---
 meta/lib/oeqa/utils/httpserver.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/utils/httpserver.py 
b/meta/lib/oeqa/utils/httpserver.py
index 9e61cd89d5..cd42d3ed4c 100644
--- a/meta/lib/oeqa/utils/httpserver.py
+++ b/meta/lib/oeqa/utils/httpserver.py
@@ -6,7 +6,10 @@
 
 import http.server
 import logging
-from bb import multiprocessing
+try:
+    from bb import multiprocessing
+except ImportError:
+    import multiprocessing
 import os
 import signal
 from socketserver import ThreadingMixIn
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#226668): 
https://lists.openembedded.org/g/openembedded-core/message/226668
Mute This Topic: https://lists.openembedded.org/mt/116405823/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to