Debug and improve tests

This commit is contained in:
Loic Guegan 2022-09-13 14:38:30 +02:00
parent b3cbb52f00
commit 17bfda379b
25 changed files with 376 additions and 21 deletions

View file

@ -0,0 +1,4 @@
#!/usr/bin/env python
def callback(simulator):
simulator.log("Hello Callback!")

View file

@ -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

View file

@ -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)