From 00fed41d26b4b39f208d8384b5f63bbe58d3b7fc Mon Sep 17 00:00:00 2001 From: MrKevinWeiss Date: Wed, 31 Jan 2024 12:56:32 +0100 Subject: [PATCH] test_iotlab: Add test for random feature --- testutils/tests/test_iotlab.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/testutils/tests/test_iotlab.py b/testutils/tests/test_iotlab.py index 7223e95..3c761f0 100644 --- a/testutils/tests/test_iotlab.py +++ b/testutils/tests/test_iotlab.py @@ -177,6 +177,7 @@ def test_stop(monkeypatch, exp_id, expected): "ctrl_envs, exp_nodes", [ ([{"BOARD": "nrf52dk"}], ["nrf52dk-5.saclay.iot-lab.info"]), + ([{"BOARD": "iotlab-m3"}], ["m3-3.saclay.iot-lab.info"]), ( [{"IOTLAB_NODE": "samr21-21.saclay.iot-lab.info"}], ["samr21-21.saclay.iot-lab.info"], @@ -199,6 +200,18 @@ def test_start(monkeypatch, ctrl_envs, exp_nodes): monkeypatch.setattr( testutils.iotlab, "get_experiment", lambda api, exp_id: {"nodes": exp_nodes} ) + monkeypatch.setattr( + testutils.iotlab, + "info_experiment", + lambda api, site: { + "items": [ + { + "state": "Alive", + "network_address": exp_nodes[0], + }, + ], + }, + ) monkeypatch.setattr(testutils.iotlab, "wait_experiment", lambda api, exp_id: {}) ctrls = [MockRIOTCtrl(env) for env in ctrl_envs] exp = testutils.iotlab.IoTLABExperiment("test", ctrls)