mirror of
https://gitlab.com/manzerbredes/esds.git
synced 2025-04-19 03:59:45 +00:00
Improve tests
This commit is contained in:
parent
1bef51d878
commit
d0ae9f3296
85 changed files with 77 additions and 44 deletions
7
tests/api_log_5n/node.py
Normal file
7
tests/api_log_5n/node.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
def execute(api):
|
||||
api.log("A")
|
||||
api.log("B")
|
||||
api.log("C")
|
||||
api.log("D")
|
21
tests/api_log_5n/out
Normal file
21
tests/api_log_5n/out
Normal file
|
@ -0,0 +1,21 @@
|
|||
[t=0.000,src=n0] A
|
||||
[t=0.000,src=n0] B
|
||||
[t=0.000,src=n0] C
|
||||
[t=0.000,src=n0] D
|
||||
[t=0.000,src=n1] A
|
||||
[t=0.000,src=n1] B
|
||||
[t=0.000,src=n1] C
|
||||
[t=0.000,src=n1] D
|
||||
[t=0.000,src=n2] A
|
||||
[t=0.000,src=n2] B
|
||||
[t=0.000,src=n2] C
|
||||
[t=0.000,src=n2] D
|
||||
[t=0.000,src=n3] A
|
||||
[t=0.000,src=n3] B
|
||||
[t=0.000,src=n3] C
|
||||
[t=0.000,src=n3] D
|
||||
[t=0.000,src=n4] A
|
||||
[t=0.000,src=n4] B
|
||||
[t=0.000,src=n4] C
|
||||
[t=0.000,src=n4] D
|
||||
[t=0.000,src=esds] Simulation ends
|
17
tests/api_log_5n/simulator.py
Executable file
17
tests/api_log_5n/simulator.py
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Load ESDS
|
||||
import esds
|
||||
import numpy as np
|
||||
|
||||
B=np.full((5,5),5)
|
||||
L=np.full((5,5),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")
|
||||
s.create_node("node")
|
||||
s.create_node("node")
|
||||
s.create_node("node")
|
||||
|
||||
s.run()
|
Loading…
Add table
Add a link
Reference in a new issue