Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion framework/python/src/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 7 additions & 1 deletion framework/python/src/test_orc/test_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion modules/ui/ui.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions testing/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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

Expand Down