diff options
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oeqa/runtime/context.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/meta/lib/oeqa/runtime/context.py b/meta/lib/oeqa/runtime/context.py index 7908ce1fd4..d707ab263a 100644 --- a/meta/lib/oeqa/runtime/context.py +++ b/meta/lib/oeqa/runtime/context.py | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | # | 5 | # |
| 6 | 6 | ||
| 7 | import os | 7 | import os |
| 8 | import sys | ||
| 8 | 9 | ||
| 9 | from oeqa.core.context import OETestContext, OETestContextExecutor | 10 | from oeqa.core.context import OETestContext, OETestContextExecutor |
| 10 | from oeqa.core.target.ssh import OESSHTarget | 11 | from oeqa.core.target.ssh import OESSHTarget |
| @@ -119,8 +120,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): | |||
| 119 | # XXX: Don't base your targets on this code it will be refactored | 120 | # XXX: Don't base your targets on this code it will be refactored |
| 120 | # in the near future. | 121 | # in the near future. |
| 121 | # Custom target module loading | 122 | # Custom target module loading |
| 122 | target_modules_path = kwargs.get('target_modules_path', '') | 123 | controller = OERuntimeTestContextExecutor.getControllerModule(target_type) |
| 123 | controller = OERuntimeTestContextExecutor.getControllerModule(target_type, target_modules_path) | ||
| 124 | target = controller(logger, target_ip, server_ip, **kwargs) | 124 | target = controller(logger, target_ip, server_ip, **kwargs) |
| 125 | 125 | ||
| 126 | return target | 126 | return target |
| @@ -130,15 +130,15 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): | |||
| 130 | # AttributeError raised if not found. | 130 | # AttributeError raised if not found. |
| 131 | # ImportError raised if a provided module can not be imported. | 131 | # ImportError raised if a provided module can not be imported. |
| 132 | @staticmethod | 132 | @staticmethod |
| 133 | def getControllerModule(target, target_modules_path): | 133 | def getControllerModule(target): |
| 134 | controllerslist = OERuntimeTestContextExecutor._getControllerModulenames(target_modules_path) | 134 | controllerslist = OERuntimeTestContextExecutor._getControllerModulenames() |
| 135 | controller = OERuntimeTestContextExecutor._loadControllerFromName(target, controllerslist) | 135 | controller = OERuntimeTestContextExecutor._loadControllerFromName(target, controllerslist) |
| 136 | return controller | 136 | return controller |
| 137 | 137 | ||
| 138 | # Return a list of all python modules in lib/oeqa/controllers for each | 138 | # Return a list of all python modules in lib/oeqa/controllers for each |
| 139 | # layer in bbpath | 139 | # layer in bbpath |
| 140 | @staticmethod | 140 | @staticmethod |
| 141 | def _getControllerModulenames(target_modules_path): | 141 | def _getControllerModulenames(): |
| 142 | 142 | ||
| 143 | controllerslist = [] | 143 | controllerslist = [] |
| 144 | 144 | ||
| @@ -153,9 +153,8 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): | |||
| 153 | else: | 153 | else: |
| 154 | raise RuntimeError("Duplicate controller module found for %s. Layers should create unique controller module names" % module) | 154 | raise RuntimeError("Duplicate controller module found for %s. Layers should create unique controller module names" % module) |
| 155 | 155 | ||
| 156 | extpath = target_modules_path.split(':') | 156 | for p in sys.path: |
| 157 | for p in extpath: | 157 | controllerpath = os.path.join(p, 'oeqa', 'controllers') |
| 158 | controllerpath = os.path.join(p, 'lib', 'oeqa', 'controllers') | ||
| 159 | if os.path.exists(controllerpath): | 158 | if os.path.exists(controllerpath): |
| 160 | add_controller_list(controllerpath) | 159 | add_controller_list(controllerpath) |
| 161 | return controllerslist | 160 | return controllerslist |
