From 17bfda379be17acb20abfb7f0c9231d36ef8766d Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Tue, 13 Sep 2022 14:38:30 +0200 Subject: Debug and improve tests --- tests/breakpoints_auto_1n/callback.py | 4 ++++ tests/breakpoints_auto_1n/platform.yaml | 22 ++++++++++++++++++++++ tests/breakpoints_auto_1n/simulator.py | 18 ------------------ 3 files changed, 26 insertions(+), 18 deletions(-) create mode 100755 tests/breakpoints_auto_1n/callback.py create mode 100644 tests/breakpoints_auto_1n/platform.yaml delete mode 100755 tests/breakpoints_auto_1n/simulator.py (limited to 'tests/breakpoints_auto_1n') diff --git a/tests/breakpoints_auto_1n/callback.py b/tests/breakpoints_auto_1n/callback.py new file mode 100755 index 0000000..5c9c6bc --- /dev/null +++ b/tests/breakpoints_auto_1n/callback.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python + +def callback(simulator): + simulator.log("Hello Callback!") diff --git a/tests/breakpoints_auto_1n/platform.yaml b/tests/breakpoints_auto_1n/platform.yaml new file mode 100644 index 0000000..e8d4750 --- /dev/null +++ b/tests/breakpoints_auto_1n/platform.yaml @@ -0,0 +1,22 @@ +general: + breakpoints_every: 3.3 + breakpoints_callback: + file: "callback.py" + callback: "callback" + +nodes: + count: 2 + implementations: + - all node.py + +interfaces: + wlan0: + type: "wireless" + links: + - all 2bps 0s all + txperfs: + - all 2bps 0s + eth0: + type: "wired" + links: + - all 2bps 0s all \ No newline at end of file diff --git a/tests/breakpoints_auto_1n/simulator.py b/tests/breakpoints_auto_1n/simulator.py deleted file mode 100755 index ac24a03..0000000 --- a/tests/breakpoints_auto_1n/simulator.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python - -# Load ESDS -import esds -import numpy as np - -n=2 -B=np.full((2,2),n) -L=np.full((2,2),0) -s=esds.Simulator({"wlan0":{"bandwidth":B, "latency":L, "is_wired":False}, "eth0":{"bandwidth":B, "latency":L, "is_wired":True}}) - -s.create_node("node") -s.create_node("node") - -def callback(simulator): - simulator.log("Hello Callback!") - -s.run(breakpoints_every=3.3,breakpoint_callback=callback) -- cgit v1.2.3