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
10
tests/api_wait_end_3n/node.py
Normal file
10
tests/api_wait_end_3n/node.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
def execute(api):
|
||||
wait=api.node_id
|
||||
api.log("Before wait for "+str(wait)+"s")
|
||||
api.wait(wait) # Since 3 nodes max(wait)==2
|
||||
|
||||
# Ensure that wait end return back when simulation ends
|
||||
api.wait_end()
|
||||
api.log("Terminated")
|
7
tests/api_wait_end_3n/out
Normal file
7
tests/api_wait_end_3n/out
Normal file
|
@ -0,0 +1,7 @@
|
|||
[t=0.000,src=n0] Before wait for 0s
|
||||
[t=0.000,src=n1] Before wait for 1s
|
||||
[t=0.000,src=n2] Before wait for 2s
|
||||
[t=2.000,src=n0] Terminated
|
||||
[t=2.000,src=n1] Terminated
|
||||
[t=2.000,src=n2] Terminated
|
||||
[t=2.000,src=esds] Simulation ends
|
15
tests/api_wait_end_3n/simulator.py
Executable file
15
tests/api_wait_end_3n/simulator.py
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# Load ESDS
|
||||
import esds
|
||||
import numpy as np
|
||||
|
||||
B=np.full((3,3),2)
|
||||
L=np.full((3,3),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.run()
|
Loading…
Add table
Add a link
Reference in a new issue