diff --git a/framework/python/src/api/api.py b/framework/python/src/api/api.py index ebd022acf..06659043d 100644 --- a/framework/python/src/api/api.py +++ b/framework/python/src/api/api.py @@ -176,7 +176,8 @@ async def start_test_run(self, request: Request, response: Response): ]: LOGGER.debug("Testrun is already running. Cannot start another instance") response.status_code = status.HTTP_409_CONFLICT - return self._generate_msg(False, "Testrun is already running") + return self._generate_msg(False, "Testrun cannot be started " + + "whilst a test is running on another device") # Check if requested device is known in the device repository if device is None: diff --git a/framework/python/src/test_orc/test_orchestrator.py b/framework/python/src/test_orc/test_orchestrator.py index 2e342fcc4..07f43006f 100644 --- a/framework/python/src/test_orc/test_orchestrator.py +++ b/framework/python/src/test_orc/test_orchestrator.py @@ -88,7 +88,7 @@ def run_test_modules(self): test_modules = [] for module in self._test_modules: - if module is None or not module.enable_container or not module.enabled: + if module is None or not module.enable_container: continue if not self._is_module_enabled(module, device): @@ -254,12 +254,18 @@ def test_in_progress(self): return self._test_in_progress def _is_module_enabled(self, module, device): + + # Enable module as fallback enabled = True if device.test_modules is not None: test_modules = device.test_modules if module.name in test_modules: if "enabled" in test_modules[module.name]: enabled = test_modules[module.name]["enabled"] + else: + # Module has not been specified in the device config + enabled = module.enabled + return enabled def _run_test_module(self, module): diff --git a/modules/ui/ui.Dockerfile b/modules/ui/ui.Dockerfile index 1fc6e92ea..da56be93e 100644 --- a/modules/ui/ui.Dockerfile +++ b/modules/ui/ui.Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # Image name: test-run/ui -FROM node:20@sha256:ffebb4405810c92d267a764b21975fb2d96772e41877248a37bf3abaa0d3b590 as build as build +FROM node@sha256:ffebb4405810c92d267a764b21975fb2d96772e41877248a37bf3abaa0d3b590 as build WORKDIR /modules/ui COPY modules/ui/ /modules/ui diff --git a/testing/api/test_api.py b/testing/api/test_api.py index c6368148c..44daef335 100644 --- a/testing/api/test_api.py +++ b/testing/api/test_api.py @@ -231,7 +231,7 @@ def test_get_system_interfaces(testrun): r = requests.get(f"{API}/system/interfaces") response = json.loads(r.text) local_interfaces = get_network_interfaces() - assert set(response) == set(local_interfaces) + assert set(response.keys()) == set(local_interfaces) # schema expects a flat list assert all([isinstance(x, str) for x in response]) @@ -262,13 +262,18 @@ def test_modify_device(testing_devices, testrun): } updated_device["test_modules"] = new_test_modules + updated_device_payload = {} + updated_device_payload["device"] = updated_device + updated_device_payload["mac_addr"] = mac_addr + print("updated_device") pretty_print(updated_device) print("api_device") pretty_print(api_device) # update device - r = requests.post(f"{API}/device", data=json.dumps(updated_device)) + r = requests.post(f"{API}/device/edit", + data=json.dumps(updated_device_payload)) assert r.status_code == 200