summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-09-13 15:49:38 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2022-09-13 15:49:38 +0200
commitbe6dafcd106ff9c50c9fa316685874773f6b251e (patch)
treedfa3cc1e7327bbfc636662b165c2f7822c585ca8
parent17bfda379be17acb20abfb7f0c9231d36ef8766d (diff)
Update all integration tests and debug platform parsing
-rw-r--r--esds/platform.py2
-rw-r--r--tests/api_log_5n/platform.yaml6
-rwxr-xr-xtests/api_log_5n/simulator.py17
-rw-r--r--tests/api_read_clock_2n/platform.yaml6
-rwxr-xr-xtests/api_read_clock_2n/simulator.py14
-rw-r--r--tests/api_read_eth0_ncom_2s1r/platform.yaml6
-rwxr-xr-xtests/api_read_eth0_ncom_2s1r/simulator.py15
-rw-r--r--tests/api_read_order_ncom_1s2r/platform.yaml5
-rwxr-xr-xtests/api_read_order_ncom_1s2r/simulator.py17
-rw-r--r--tests/api_read_wlan0_ncom_2s1r/platform.yaml4
-rwxr-xr-xtests/api_read_wlan0_ncom_2s1r/simulator.py15
-rw-r--r--tests/api_receivet0_eth0_1s1r/platform.yaml6
-rwxr-xr-xtests/api_receivet0_eth0_1s1r/simulator.py14
-rw-r--r--tests/api_receivet0_eth0_1s1r/yoctosim.debug43
-rw-r--r--tests/api_receivet_eth0_1s1r/platform.yaml6
-rwxr-xr-xtests/api_receivet_eth0_1s1r/simulator.py14
-rw-r--r--tests/api_receivet_eth0_1s1r/yoctosim.debug43
-rw-r--r--tests/api_send0_eth0_1s1r/platform.yaml6
-rwxr-xr-xtests/api_send0_eth0_1s1r/simulator.py14
-rwxr-xr-xtests/api_send_4interfaces_1s2r/simulator.py24
-rw-r--r--tests/api_send_eth0_1s1r/platform.yaml6
-rwxr-xr-xtests/api_send_eth0_1s1r/simulator.py14
-rw-r--r--tests/api_send_eth0_2s1r/platform.yaml6
-rwxr-xr-xtests/api_send_eth0_2s1r/simulator.py15
-rw-r--r--tests/api_send_eth0_3s1r/platform.yaml6
-rwxr-xr-xtests/api_send_eth0_3s1r/simulator.py16
-rw-r--r--tests/api_send_wlan0_1s2r/platform.yaml4
-rwxr-xr-xtests/api_send_wlan0_1s2r/simulator.py15
-rw-r--r--tests/api_send_wlan0_2s1r/platform.yaml4
-rwxr-xr-xtests/api_send_wlan0_2s1r/simulator.py15
-rw-r--r--tests/api_sendt_eth0_1s1r/platform.yaml6
-rwxr-xr-xtests/api_sendt_eth0_1s1r/simulator.py14
-rw-r--r--tests/api_sendt_wlan0_1s2r/platform.yaml4
-rwxr-xr-xtests/api_sendt_wlan0_1s2r/simulator.py15
-rw-r--r--tests/api_wait_2n/platform.yaml6
-rwxr-xr-xtests/api_wait_2n/simulator.py14
-rw-r--r--tests/api_wait_end_3n/platform.yaml6
-rwxr-xr-xtests/api_wait_end_3n/simulator.py15
-rw-r--r--tests/breakpoints_auto_1n/platform.yaml6
-rw-r--r--tests/breakpoints_manual_1n/platform.yaml6
-rwxr-xr-xtests/breakpoints_manual_1n/simulator.py18
-rw-r--r--tests/breakpoints_manual_no_callback_1n/platform.yaml6
-rwxr-xr-xtests/breakpoints_manual_no_callback_1n/simulator.py15
-rwxr-xr-xtests/hidden_node_2s1r/simulator.py20
-rwxr-xr-xtests/mobility_eth0_bandwidth_1s1r/mobility.py8
-rw-r--r--[-rwxr-xr-x]tests/mobility_eth0_bandwidth_1s1r/platform.yaml (renamed from tests/mobility_eth0_bandwidth_1s1r/simulator.py)39
-rwxr-xr-xtests/mobility_eth0_bandwidth_2s1r/mobility.py7
-rw-r--r--[-rwxr-xr-x]tests/mobility_eth0_bandwidth_2s1r/platform.yaml (renamed from tests/mobility_eth0_bandwidth_2s1r/simulator.py)34
-rw-r--r--tests/mobility_eth0_bandwidth_2s1r/yoctosim.debug37
-rwxr-xr-xtests/mobility_eth0_latency_1s1r/mobility.py6
-rw-r--r--[-rwxr-xr-x]tests/mobility_eth0_latency_1s1r/platform.yaml (renamed from tests/mobility_eth0_latency_1s1r/simulator.py)33
-rwxr-xr-xtests/mobility_eth0_latency_2s1r/mobility.py7
-rw-r--r--[-rwxr-xr-x]tests/mobility_eth0_latency_2s1r/platform.yaml (renamed from tests/mobility_eth0_latency_2s1r/simulator.py)34
-rw-r--r--tests/mobility_eth0_latency_2s1r/yoctosim.debug51
-rwxr-xr-xtests/mobility_wlan0_bandwidth_1s1r/mobility.py7
-rw-r--r--[-rwxr-xr-x]tests/mobility_wlan0_bandwidth_1s1r/platform.yaml (renamed from tests/mobility_wlan0_bandwidth_1s1r/simulator.py)36
-rwxr-xr-xtests/mobility_wlan0_latency_1s1r/mobility.py7
-rw-r--r--tests/mobility_wlan0_latency_1s1r/platform.yaml37
-rwxr-xr-xtests/mobility_wlan0_latency_1s1r/simulator.py40
-rwxr-xr-xtests/run.py4
-rwxr-xr-xtests/run.sh4
61 files changed, 167 insertions, 753 deletions
diff --git a/esds/platform.py b/esds/platform.py
index 98adf08..508fdc4 100644
--- a/esds/platform.py
+++ b/esds/platform.py
@@ -182,7 +182,7 @@ class YAMLPlatformFile:
cb=general["breakpoints_callback"]
file=cb["file"]
path, ext=os.path.splitext(file)
- if not os.path.exists(file):
+ if not os.path.exists(os.path.join(self.location,file)):
self.parsing_error("File "+file+ " not found")
path, extension = os.path.splitext(file)
if extension != ".py":
diff --git a/tests/api_log_5n/platform.yaml b/tests/api_log_5n/platform.yaml
index 03e4416..c5e5f0a 100644
--- a/tests/api_log_5n/platform.yaml
+++ b/tests/api_log_5n/platform.yaml
@@ -4,12 +4,6 @@ nodes:
- all node.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 5bps 0s all
- txperfs:
- - all 5bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_log_5n/simulator.py b/tests/api_log_5n/simulator.py
deleted file mode 100755
index d9346cd..0000000
--- a/tests/api_log_5n/simulator.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/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()
diff --git a/tests/api_read_clock_2n/platform.yaml b/tests/api_read_clock_2n/platform.yaml
index f4493b1..c153050 100644
--- a/tests/api_read_clock_2n/platform.yaml
+++ b/tests/api_read_clock_2n/platform.yaml
@@ -4,12 +4,6 @@ nodes:
- all node.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 2bps 0s all
- txperfs:
- - all 2bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_read_clock_2n/simulator.py b/tests/api_read_clock_2n/simulator.py
deleted file mode 100755
index fc0e80d..0000000
--- a/tests/api_read_clock_2n/simulator.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((2,2),2)
-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")
-
-s.run()
diff --git a/tests/api_read_eth0_ncom_2s1r/platform.yaml b/tests/api_read_eth0_ncom_2s1r/platform.yaml
index b37d814..4b47dee 100644
--- a/tests/api_read_eth0_ncom_2s1r/platform.yaml
+++ b/tests/api_read_eth0_ncom_2s1r/platform.yaml
@@ -8,12 +8,6 @@ nodes:
- 2 receiver.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 3bps 0s all
- txperfs:
- - all 3bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_read_eth0_ncom_2s1r/simulator.py b/tests/api_read_eth0_ncom_2s1r/simulator.py
deleted file mode 100755
index 85a0671..0000000
--- a/tests/api_read_eth0_ncom_2s1r/simulator.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((3,3),3)
-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("sender")
-s.create_node("sender")
-s.create_node("receiver")
-
-s.run(interferences=False)
diff --git a/tests/api_read_order_ncom_1s2r/platform.yaml b/tests/api_read_order_ncom_1s2r/platform.yaml
index 5371cd9..1c98280 100644
--- a/tests/api_read_order_ncom_1s2r/platform.yaml
+++ b/tests/api_read_order_ncom_1s2r/platform.yaml
@@ -14,7 +14,4 @@ interfaces:
- all 1Bps 0s all
txperfs:
- all 1Bps 0s
- eth0:
- type: "wired"
- links:
- - all 1Bps 0s all \ No newline at end of file
+ \ No newline at end of file
diff --git a/tests/api_read_order_ncom_1s2r/simulator.py b/tests/api_read_order_ncom_1s2r/simulator.py
deleted file mode 100755
index 5c3418c..0000000
--- a/tests/api_read_order_ncom_1s2r/simulator.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((3,3),8)
-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}})
-
-# Order at which receivers and senders are instanciated should not matter on the result
-# both receivers should have ncom_wlan0 equals to 0 (since non-blocking calls are processed before the blocking one, it should be the case)
-s.create_node("receiver")
-s.create_node("sender")
-s.create_node("receiver")
-
-s.run(interferences=False)
diff --git a/tests/api_read_wlan0_ncom_2s1r/platform.yaml b/tests/api_read_wlan0_ncom_2s1r/platform.yaml
index f80f8e7..e44f077 100644
--- a/tests/api_read_wlan0_ncom_2s1r/platform.yaml
+++ b/tests/api_read_wlan0_ncom_2s1r/platform.yaml
@@ -14,7 +14,3 @@ interfaces:
- all 3bps 0s all
txperfs:
- all 3bps 0s
- eth0:
- type: "wired"
- links:
- - all 3bps 0s all \ No newline at end of file
diff --git a/tests/api_read_wlan0_ncom_2s1r/simulator.py b/tests/api_read_wlan0_ncom_2s1r/simulator.py
deleted file mode 100755
index 85a0671..0000000
--- a/tests/api_read_wlan0_ncom_2s1r/simulator.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((3,3),3)
-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("sender")
-s.create_node("sender")
-s.create_node("receiver")
-
-s.run(interferences=False)
diff --git a/tests/api_receivet0_eth0_1s1r/platform.yaml b/tests/api_receivet0_eth0_1s1r/platform.yaml
index d55f59e..72f9ccb 100644
--- a/tests/api_receivet0_eth0_1s1r/platform.yaml
+++ b/tests/api_receivet0_eth0_1s1r/platform.yaml
@@ -5,12 +5,6 @@ nodes:
- 1 receiver.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 1Bps 0s all
- txperfs:
- - all 1Bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_receivet0_eth0_1s1r/simulator.py b/tests/api_receivet0_eth0_1s1r/simulator.py
deleted file mode 100755
index ae5bbea..0000000
--- a/tests/api_receivet0_eth0_1s1r/simulator.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((2,2),8)
-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("sender")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_receivet0_eth0_1s1r/yoctosim.debug b/tests/api_receivet0_eth0_1s1r/yoctosim.debug
deleted file mode 100644
index 9d879f4..0000000
--- a/tests/api_receivet0_eth0_1s1r/yoctosim.debug
+++ /dev/null
@@ -1,43 +0,0 @@
-Python version 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0]
-Simulation started at 1654802960.7880125
-Number of nodes is 2
-Manual breakpoints list: []
-Breakpoints every Nones
------------------------------------------------
-Started since 0.02s
-Simulated time 0.000s (or more precisely 0s)
-Node number per state: pending=1 request=1
-Node sharing: n1=1
-Ids of node in timeout mode:
-Sorted events list:
-[[0 1.0 array([0, 1, 'eth0', 'Hello World!', 1, 1.0, 1, 0], dtype=object)
- 1]
- [1 2 array(1, dtype=object) 3]]
------------------------------------------------
-Started since 0.04s
-Simulated time 1.000s (or more precisely 1.0s)
-Node number per state: pending=1 request=1
-Node sharing: n1=1
-Ids of node in timeout mode:
-Sorted events list:
-[[1 1.5 array(1, dtype=object) 3]
- [0 2.0
- array([0, 1, 'eth0', 'Hello World!', 1, 1.0, 1, 1.0], dtype=object) 1]]
------------------------------------------------
-Started since 0.06s
-Simulated time 1.500s (or more precisely 1.5s)
-Node number per state: pending=1 request=1
-Node sharing: n1=1
-Ids of node in timeout mode:
-Sorted events list:
-[[0 2.0
- array([0, 1, 'eth0', 'Hello World!', 1, 1.0, 1, 1.0], dtype=object) 1]
- [1 2.0 array(1, dtype=object) 3]]
------------------------------------------------
-Started since 0.08s
-Simulated time 2.000s (or more precisely 2.0s)
-Node number per state: terminated=2
-Node sharing:
-Ids of node in timeout mode:
-Sorted events list:
-[]
diff --git a/tests/api_receivet_eth0_1s1r/platform.yaml b/tests/api_receivet_eth0_1s1r/platform.yaml
index d55f59e..72f9ccb 100644
--- a/tests/api_receivet_eth0_1s1r/platform.yaml
+++ b/tests/api_receivet_eth0_1s1r/platform.yaml
@@ -5,12 +5,6 @@ nodes:
- 1 receiver.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 1Bps 0s all
- txperfs:
- - all 1Bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_receivet_eth0_1s1r/simulator.py b/tests/api_receivet_eth0_1s1r/simulator.py
deleted file mode 100755
index ae5bbea..0000000
--- a/tests/api_receivet_eth0_1s1r/simulator.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((2,2),8)
-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("sender")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_receivet_eth0_1s1r/yoctosim.debug b/tests/api_receivet_eth0_1s1r/yoctosim.debug
deleted file mode 100644
index 9d879f4..0000000
--- a/tests/api_receivet_eth0_1s1r/yoctosim.debug
+++ /dev/null
@@ -1,43 +0,0 @@
-Python version 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0]
-Simulation started at 1654802960.7880125
-Number of nodes is 2
-Manual breakpoints list: []
-Breakpoints every Nones
------------------------------------------------
-Started since 0.02s
-Simulated time 0.000s (or more precisely 0s)
-Node number per state: pending=1 request=1
-Node sharing: n1=1
-Ids of node in timeout mode:
-Sorted events list:
-[[0 1.0 array([0, 1, 'eth0', 'Hello World!', 1, 1.0, 1, 0], dtype=object)
- 1]
- [1 2 array(1, dtype=object) 3]]
------------------------------------------------
-Started since 0.04s
-Simulated time 1.000s (or more precisely 1.0s)
-Node number per state: pending=1 request=1
-Node sharing: n1=1
-Ids of node in timeout mode:
-Sorted events list:
-[[1 1.5 array(1, dtype=object) 3]
- [0 2.0
- array([0, 1, 'eth0', 'Hello World!', 1, 1.0, 1, 1.0], dtype=object) 1]]
------------------------------------------------
-Started since 0.06s
-Simulated time 1.500s (or more precisely 1.5s)
-Node number per state: pending=1 request=1
-Node sharing: n1=1
-Ids of node in timeout mode:
-Sorted events list:
-[[0 2.0
- array([0, 1, 'eth0', 'Hello World!', 1, 1.0, 1, 1.0], dtype=object) 1]
- [1 2.0 array(1, dtype=object) 3]]
------------------------------------------------
-Started since 0.08s
-Simulated time 2.000s (or more precisely 2.0s)
-Node number per state: terminated=2
-Node sharing:
-Ids of node in timeout mode:
-Sorted events list:
-[]
diff --git a/tests/api_send0_eth0_1s1r/platform.yaml b/tests/api_send0_eth0_1s1r/platform.yaml
index d55f59e..72f9ccb 100644
--- a/tests/api_send0_eth0_1s1r/platform.yaml
+++ b/tests/api_send0_eth0_1s1r/platform.yaml
@@ -5,12 +5,6 @@ nodes:
- 1 receiver.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 1Bps 0s all
- txperfs:
- - all 1Bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_send0_eth0_1s1r/simulator.py b/tests/api_send0_eth0_1s1r/simulator.py
deleted file mode 100755
index ae5bbea..0000000
--- a/tests/api_send0_eth0_1s1r/simulator.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((2,2),8)
-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("sender")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_send_4interfaces_1s2r/simulator.py b/tests/api_send_4interfaces_1s2r/simulator.py
deleted file mode 100755
index f7ebbf6..0000000
--- a/tests/api_send_4interfaces_1s2r/simulator.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B_wlan0=np.full((3,3),8)
-B_wlan0[0,2]=0 # Sender cannot reach n2 on wlan0
-B_wlan1=np.full((3,3),8) # Sender can reach n1 AND n2 on wlan1
-
-B_eth0=np.full((3,3),8)
-B_eth1=np.full((3,3),16) # On eth1 sender can reach receiver twice faster than eth0
-
-L=np.full((3,3),0)
-s=esds.Simulator({"wlan0":{"bandwidth":B_wlan0, "latency":L, "is_wired":False},
- "wlan1":{"bandwidth":B_wlan1, "latency":L, "is_wired":False},
- "eth0":{"bandwidth":B_eth0, "latency":L, "is_wired":True},
- "eth1":{"bandwidth":B_eth1, "latency":L, "is_wired":True}})
-
-s.create_node("sender")
-s.create_node("receiver")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_send_eth0_1s1r/platform.yaml b/tests/api_send_eth0_1s1r/platform.yaml
index 6089a8d..c795e5a 100644
--- a/tests/api_send_eth0_1s1r/platform.yaml
+++ b/tests/api_send_eth0_1s1r/platform.yaml
@@ -5,12 +5,6 @@ nodes:
- 1 receiver.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 1Bps 0s all
- txperfs:
- - all 1Bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_send_eth0_1s1r/simulator.py b/tests/api_send_eth0_1s1r/simulator.py
deleted file mode 100755
index ae5bbea..0000000
--- a/tests/api_send_eth0_1s1r/simulator.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((2,2),8)
-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("sender")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_send_eth0_2s1r/platform.yaml b/tests/api_send_eth0_2s1r/platform.yaml
index 93e2f02..c68ead2 100644
--- a/tests/api_send_eth0_2s1r/platform.yaml
+++ b/tests/api_send_eth0_2s1r/platform.yaml
@@ -5,12 +5,6 @@ nodes:
- 2 receiver.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 1Bps 0s all
- txperfs:
- - all 1Bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_send_eth0_2s1r/simulator.py b/tests/api_send_eth0_2s1r/simulator.py
deleted file mode 100755
index 4cce1d0..0000000
--- a/tests/api_send_eth0_2s1r/simulator.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((3,3),8)
-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("sender")
-s.create_node("sender")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_send_eth0_3s1r/platform.yaml b/tests/api_send_eth0_3s1r/platform.yaml
index 7101548..a18f5bc 100644
--- a/tests/api_send_eth0_3s1r/platform.yaml
+++ b/tests/api_send_eth0_3s1r/platform.yaml
@@ -5,12 +5,6 @@ nodes:
- 3 receiver.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 1Bps 0s all
- txperfs:
- - all 1Bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_send_eth0_3s1r/simulator.py b/tests/api_send_eth0_3s1r/simulator.py
deleted file mode 100755
index 84c0de0..0000000
--- a/tests/api_send_eth0_3s1r/simulator.py
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((4,4),8)
-L=np.full((4,4),0)
-s=esds.Simulator({"wlan0":{"bandwidth":B, "latency":L, "is_wired":False}, "eth0":{"bandwidth":B, "latency":L, "is_wired":True}})
-
-s.create_node("sender")
-s.create_node("sender")
-s.create_node("sender")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_send_wlan0_1s2r/platform.yaml b/tests/api_send_wlan0_1s2r/platform.yaml
index 096d56a..c2e3b80 100644
--- a/tests/api_send_wlan0_1s2r/platform.yaml
+++ b/tests/api_send_wlan0_1s2r/platform.yaml
@@ -11,7 +11,3 @@ interfaces:
- all 1Bps 0s all
txperfs:
- all 1Bps 0s
- eth0:
- type: "wired"
- links:
- - all 1Bps 0s all \ No newline at end of file
diff --git a/tests/api_send_wlan0_1s2r/simulator.py b/tests/api_send_wlan0_1s2r/simulator.py
deleted file mode 100755
index e721a93..0000000
--- a/tests/api_send_wlan0_1s2r/simulator.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((3,3),8)
-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("sender")
-s.create_node("receiver")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_send_wlan0_2s1r/platform.yaml b/tests/api_send_wlan0_2s1r/platform.yaml
index 93e2f02..fb8d102 100644
--- a/tests/api_send_wlan0_2s1r/platform.yaml
+++ b/tests/api_send_wlan0_2s1r/platform.yaml
@@ -11,7 +11,3 @@ interfaces:
- all 1Bps 0s all
txperfs:
- all 1Bps 0s
- eth0:
- type: "wired"
- links:
- - all 1Bps 0s all \ No newline at end of file
diff --git a/tests/api_send_wlan0_2s1r/simulator.py b/tests/api_send_wlan0_2s1r/simulator.py
deleted file mode 100755
index 4cce1d0..0000000
--- a/tests/api_send_wlan0_2s1r/simulator.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((3,3),8)
-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("sender")
-s.create_node("sender")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_sendt_eth0_1s1r/platform.yaml b/tests/api_sendt_eth0_1s1r/platform.yaml
index d55f59e..72f9ccb 100644
--- a/tests/api_sendt_eth0_1s1r/platform.yaml
+++ b/tests/api_sendt_eth0_1s1r/platform.yaml
@@ -5,12 +5,6 @@ nodes:
- 1 receiver.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 1Bps 0s all
- txperfs:
- - all 1Bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_sendt_eth0_1s1r/simulator.py b/tests/api_sendt_eth0_1s1r/simulator.py
deleted file mode 100755
index ae5bbea..0000000
--- a/tests/api_sendt_eth0_1s1r/simulator.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((2,2),8)
-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("sender")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_sendt_wlan0_1s2r/platform.yaml b/tests/api_sendt_wlan0_1s2r/platform.yaml
index 096d56a..c2e3b80 100644
--- a/tests/api_sendt_wlan0_1s2r/platform.yaml
+++ b/tests/api_sendt_wlan0_1s2r/platform.yaml
@@ -11,7 +11,3 @@ interfaces:
- all 1Bps 0s all
txperfs:
- all 1Bps 0s
- eth0:
- type: "wired"
- links:
- - all 1Bps 0s all \ No newline at end of file
diff --git a/tests/api_sendt_wlan0_1s2r/simulator.py b/tests/api_sendt_wlan0_1s2r/simulator.py
deleted file mode 100755
index e721a93..0000000
--- a/tests/api_sendt_wlan0_1s2r/simulator.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((3,3),8)
-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("sender")
-s.create_node("receiver")
-s.create_node("receiver")
-
-s.run()
diff --git a/tests/api_wait_2n/platform.yaml b/tests/api_wait_2n/platform.yaml
index b6051a8..aa0d2cd 100644
--- a/tests/api_wait_2n/platform.yaml
+++ b/tests/api_wait_2n/platform.yaml
@@ -4,12 +4,6 @@ nodes:
- all node.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 2bps 0s all
- txperfs:
- - all 2bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_wait_2n/simulator.py b/tests/api_wait_2n/simulator.py
deleted file mode 100755
index fc0e80d..0000000
--- a/tests/api_wait_2n/simulator.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((2,2),2)
-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")
-
-s.run()
diff --git a/tests/api_wait_end_3n/platform.yaml b/tests/api_wait_end_3n/platform.yaml
index 2a5f416..bfd65ba 100644
--- a/tests/api_wait_end_3n/platform.yaml
+++ b/tests/api_wait_end_3n/platform.yaml
@@ -4,12 +4,6 @@ nodes:
- all node.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 2bps 0s all
- txperfs:
- - all 2bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/api_wait_end_3n/simulator.py b/tests/api_wait_end_3n/simulator.py
deleted file mode 100755
index 4d1763e..0000000
--- a/tests/api_wait_end_3n/simulator.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/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()
diff --git a/tests/breakpoints_auto_1n/platform.yaml b/tests/breakpoints_auto_1n/platform.yaml
index e8d4750..6d015b4 100644
--- a/tests/breakpoints_auto_1n/platform.yaml
+++ b/tests/breakpoints_auto_1n/platform.yaml
@@ -10,12 +10,6 @@ nodes:
- all node.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 2bps 0s all
- txperfs:
- - all 2bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/breakpoints_manual_1n/platform.yaml b/tests/breakpoints_manual_1n/platform.yaml
index 0860963..5b86f85 100644
--- a/tests/breakpoints_manual_1n/platform.yaml
+++ b/tests/breakpoints_manual_1n/platform.yaml
@@ -10,12 +10,6 @@ nodes:
- all node.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 2bps 0s all
- txperfs:
- - all 2bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/breakpoints_manual_1n/simulator.py b/tests/breakpoints_manual_1n/simulator.py
deleted file mode 100755
index dd12ed3..0000000
--- a/tests/breakpoints_manual_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((n,n),n)
-L=np.full((n,n),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=[1,2,3,10],breakpoint_callback=callback)
diff --git a/tests/breakpoints_manual_no_callback_1n/platform.yaml b/tests/breakpoints_manual_no_callback_1n/platform.yaml
index 43fd100..220f9b8 100644
--- a/tests/breakpoints_manual_no_callback_1n/platform.yaml
+++ b/tests/breakpoints_manual_no_callback_1n/platform.yaml
@@ -7,12 +7,6 @@ nodes:
- all node.py
interfaces:
- wlan0:
- type: "wireless"
- links:
- - all 2bps 0s all
- txperfs:
- - all 2bps 0s
eth0:
type: "wired"
links:
diff --git a/tests/breakpoints_manual_no_callback_1n/simulator.py b/tests/breakpoints_manual_no_callback_1n/simulator.py
deleted file mode 100755
index fe4b491..0000000
--- a/tests/breakpoints_manual_no_callback_1n/simulator.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-n=2
-B=np.full((n,n),n)
-L=np.full((n,n),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.run(breakpoints=[1,2,3,10])
diff --git a/tests/hidden_node_2s1r/simulator.py b/tests/hidden_node_2s1r/simulator.py
deleted file mode 100755
index c8dd094..0000000
--- a/tests/hidden_node_2s1r/simulator.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-B=np.full((3,3),8)
-
-# Hide the nodes from each others
-B[0,2]=0
-B[2,0]=0
-
-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("sender")
-s.create_node("receiver")
-s.create_node("sender")
-
-s.run()
diff --git a/tests/mobility_eth0_bandwidth_1s1r/mobility.py b/tests/mobility_eth0_bandwidth_1s1r/mobility.py
new file mode 100755
index 0000000..1b31e49
--- /dev/null
+++ b/tests/mobility_eth0_bandwidth_1s1r/mobility.py
@@ -0,0 +1,8 @@
+#!/usr/bin/env python
+
+def callback(simulator):
+ simulator.log("Network update!")
+ new_bw_wlan0=simulator.netmat["wlan0"]["bandwidth"]*2
+ new_bw_eth0=simulator.netmat["eth0"]["bandwidth"]*2
+ simulator.update_network({"wlan0":{"bandwidth":new_bw_wlan0, "latency":simulator.netmat["wlan0"]["latency"], "is_wired":False}, "eth0":{"bandwidth":new_bw_eth0, "latency":simulator.netmat["eth0"]["latency"], "is_wired":True}})
+
diff --git a/tests/mobility_eth0_bandwidth_1s1r/simulator.py b/tests/mobility_eth0_bandwidth_1s1r/platform.yaml
index 39ce86a..145baf4 100755..100644
--- a/tests/mobility_eth0_bandwidth_1s1r/simulator.py
+++ b/tests/mobility_eth0_bandwidth_1s1r/platform.yaml
@@ -1,9 +1,3 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
########## Scenario ##########
# Notations:
# - Remaining communication duration (last communication ends minus current simulated time) = C
@@ -22,17 +16,26 @@ import numpy as np
# |-------------------+------------+----------------+----------------------+---------------------------+--------------------------|
##############################
-B=np.full((2,2),8)
-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("sender")
-s.create_node("receiver")
+general:
+ breakpoints_every: 0.5
+ breakpoints_callback:
+ file: "mobility.py"
+ callback: "callback"
-def callback(simulator):
- simulator.log("Network update!")
- new_bw_wlan0=simulator.netmat["wlan0"]["bandwidth"]*2
- new_bw_eth0=simulator.netmat["eth0"]["bandwidth"]*2
- simulator.update_network({"wlan0":{"bandwidth":new_bw_wlan0, "latency":L, "is_wired":False}, "eth0":{"bandwidth":new_bw_eth0, "latency":L, "is_wired":True}})
+nodes:
+ count: 2
+ implementations:
+ - 0 sender.py
+ - 1 receiver.py
-s.run(breakpoints_every=1/2,breakpoint_callback=callback)
+interfaces:
+ wlan0:
+ type: "wireless"
+ links:
+ - all 1Bps 0s all
+ txperfs:
+ - all 1Bps 0s
+ eth0:
+ type: "wired"
+ links:
+ - all 1Bps 0s all \ No newline at end of file
diff --git a/tests/mobility_eth0_bandwidth_2s1r/mobility.py b/tests/mobility_eth0_bandwidth_2s1r/mobility.py
new file mode 100755
index 0000000..5c9101d
--- /dev/null
+++ b/tests/mobility_eth0_bandwidth_2s1r/mobility.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+def callback(simulator):
+ simulator.log("Network update!")
+ new_bw_eth0=simulator.netmat["eth0"]["bandwidth"]*2
+ simulator.update_network({"eth0":{"bandwidth":new_bw_eth0, "latency":simulator.netmat["eth0"]["latency"], "is_wired":True}})
+
diff --git a/tests/mobility_eth0_bandwidth_2s1r/simulator.py b/tests/mobility_eth0_bandwidth_2s1r/platform.yaml
index 9840692..6ebc1ad 100755..100644
--- a/tests/mobility_eth0_bandwidth_2s1r/simulator.py
+++ b/tests/mobility_eth0_bandwidth_2s1r/platform.yaml
@@ -1,9 +1,3 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
########## Scenario ##########
# Notations:
# - Remaining communication duration (last communication ends minus current simulated time) = C
@@ -24,18 +18,20 @@ import numpy as np
# |----------------------------------------+------------+----------------+----------------------+---------------------------+--------------------------|
##############################
-B=np.full((3,3),8)
-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("sender")
-s.create_node("sender")
-s.create_node("receiver")
+general:
+ breakpoints_every: 1
+ breakpoints_callback:
+ file: "mobility.py"
+ callback: "callback"
-def callback(simulator):
- simulator.log("Network update!")
- new_bw_wlan0=simulator.netmat["wlan0"]["bandwidth"]*2
- new_bw_eth0=simulator.netmat["eth0"]["bandwidth"]*2
- simulator.update_network({"wlan0":{"bandwidth":new_bw_wlan0, "latency":L, "is_wired":False}, "eth0":{"bandwidth":new_bw_eth0, "latency":L, "is_wired":True}})
+nodes:
+ count: 3
+ implementations:
+ - 0,1 sender.py
+ - 2 receiver.py
-s.run(breakpoints_every=1,breakpoint_callback=callback)
+interfaces:
+ eth0:
+ type: "wired"
+ links:
+ - all 1Bps 0s all \ No newline at end of file
diff --git a/tests/mobility_eth0_bandwidth_2s1r/yoctosim.debug b/tests/mobility_eth0_bandwidth_2s1r/yoctosim.debug
deleted file mode 100644
index b0e4327..0000000
--- a/tests/mobility_eth0_bandwidth_2s1r/yoctosim.debug
+++ /dev/null
@@ -1,37 +0,0 @@
-Python version 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0]
-Simulation started at 1654802959.3233912
-Number of nodes is 3
-Manual breakpoints list: []
-Breakpoints every 1s
------------------------------------------------
-Started since 0.04s
-Simulated time 0.000s (or more precisely 0s)
-Node number per state: pending=2 terminated=1
-Node sharing: n2=2
-Ids of node in timeout mode:
-Sorted events list:
-[[3 1 array(0, dtype=object) 0]
- [0 2.0 array([0, 2, 'eth0', 'Hello World!', 1, 2.0, 1, 0], dtype=object)
- 1]
- [0 2.0 array([1, 2, 'eth0', 'Hello World!', 1, 2.0, 1, 0], dtype=object)
- 1]]
------------------------------------------------
-Started since 0.04s
-Simulated time 1.000s (or more precisely 1s)
-Node number per state: pending=2 terminated=1
-Node sharing: n2=2
-Ids of node in timeout mode:
-Sorted events list:
-[[0 1.5
- array([0, 2, 'eth0', 'Hello World!', 1, 0.5, 0.5, 0], dtype=object) 1]
- [0 1.5
- array([1, 2, 'eth0', 'Hello World!', 1, 0.5, 0.5, 0], dtype=object) 1]
- [3 2 array(0, dtype=object) 0]]
------------------------------------------------
-Started since 0.05s
-Simulated time 1.500s (or more precisely 1.5s)
-Node number per state: terminated=3
-Node sharing:
-Ids of node in timeout mode:
-Sorted events list:
-[[3 2 array(0, dtype=object) 0]]
diff --git a/tests/mobility_eth0_latency_1s1r/mobility.py b/tests/mobility_eth0_latency_1s1r/mobility.py
new file mode 100755
index 0000000..cfefdb7
--- /dev/null
+++ b/tests/mobility_eth0_latency_1s1r/mobility.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+
+def callback(simulator):
+ simulator.log("Network update!")
+ new_lat_eth0=simulator.netmat["eth0"]["latency"]+1/2
+ simulator.update_network({"eth0":{"bandwidth":simulator.netmat["eth0"]["bandwidth"], "latency":new_lat_eth0, "is_wired":True}})
diff --git a/tests/mobility_eth0_latency_1s1r/simulator.py b/tests/mobility_eth0_latency_1s1r/platform.yaml
index 42ff85b..df1ff46 100755..100644
--- a/tests/mobility_eth0_latency_1s1r/simulator.py
+++ b/tests/mobility_eth0_latency_1s1r/platform.yaml
@@ -1,9 +1,3 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
########## Scenario ##########
# Notations:
# - Remaining communication duration (last communication ends minus current simulated time) = C
@@ -23,17 +17,20 @@ import numpy as np
# |-------------------+------------+----------------+----------------------+---------------------------+--------------------------|
##############################
-B=np.full((2,2),8)
-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}})
+general:
+ breakpoints_every: 0.5
+ breakpoints_callback:
+ file: "mobility.py"
+ callback: "callback"
-s.create_node("sender")
-s.create_node("receiver")
+nodes:
+ count: 2
+ implementations:
+ - 0 sender.py
+ - 1 receiver.py
-def callback(simulator):
- simulator.log("Network update!")
- new_lat_wlan0=simulator.netmat["wlan0"]["latency"]+1/2
- new_lat_eth0=simulator.netmat["eth0"]["latency"]+1/2
- simulator.update_network({"wlan0":{"bandwidth":B, "latency":new_lat_wlan0, "is_wired":False},"eth0":{"bandwidth":B, "latency":new_lat_eth0, "is_wired":True}})
-
-s.run(breakpoints_every=1/2,breakpoint_callback=callback)
+interfaces:
+ eth0:
+ type: "wired"
+ links:
+ - all 1Bps 0s all \ No newline at end of file
diff --git a/tests/mobility_eth0_latency_2s1r/mobility.py b/tests/mobility_eth0_latency_2s1r/mobility.py
new file mode 100755
index 0000000..99839b9
--- /dev/null
+++ b/tests/mobility_eth0_latency_2s1r/mobility.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+def callback(simulator):
+ simulator.log("Network update!")
+ B=simulator.netmat["eth0"]["bandwidth"]
+ new_lat_eth0=simulator.netmat["eth0"]["latency"]+1/2
+ simulator.update_network({"eth0":{"bandwidth":B, "latency":new_lat_eth0, "is_wired":True}})
diff --git a/tests/mobility_eth0_latency_2s1r/simulator.py b/tests/mobility_eth0_latency_2s1r/platform.yaml
index 17562de..b35ab2e 100755..100644
--- a/tests/mobility_eth0_latency_2s1r/simulator.py
+++ b/tests/mobility_eth0_latency_2s1r/platform.yaml
@@ -1,9 +1,3 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
########## Scenario ##########
# Notations:
# - Remaining communication duration (last communication ends minus current simulated time) = C
@@ -25,18 +19,20 @@ import numpy as np
# |----------------------------------------+------------+----------------+----------------------+---------------------------+--------------------------|
##############################
-B=np.full((3,3),8)
-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("sender")
-s.create_node("sender")
-s.create_node("receiver")
+general:
+ breakpoints_every: 1
+ breakpoints_callback:
+ file: "mobility.py"
+ callback: "callback"
-def callback(simulator):
- simulator.log("Network update!")
- new_lat_wlan0=simulator.netmat["wlan0"]["latency"]+1/2
- new_lat_eth0=simulator.netmat["eth0"]["latency"]+1/2
- simulator.update_network({"wlan0":{"bandwidth":B, "latency":new_lat_wlan0, "is_wired":False},"eth0":{"bandwidth":B, "latency":new_lat_eth0, "is_wired":True}})
+nodes:
+ count: 3
+ implementations:
+ - 0,1 sender.py
+ - 2 receiver.py
-s.run(breakpoints_every=1,breakpoint_callback=callback)
+interfaces:
+ eth0:
+ type: "wired"
+ links:
+ - all 1Bps 0s all \ No newline at end of file
diff --git a/tests/mobility_eth0_latency_2s1r/yoctosim.debug b/tests/mobility_eth0_latency_2s1r/yoctosim.debug
deleted file mode 100644
index efe50d9..0000000
--- a/tests/mobility_eth0_latency_2s1r/yoctosim.debug
+++ /dev/null
@@ -1,51 +0,0 @@
-Python version 3.10.5 (main, Jun 6 2022, 18:49:26) [GCC 12.1.0]
-Simulation started at 1654802960.9297695
-Number of nodes is 3
-Manual breakpoints list: []
-Breakpoints every 1s
------------------------------------------------
-Started since 0.08s
-Simulated time 0.000s (or more precisely 0s)
-Node number per state: pending=2 terminated=1
-Node sharing: n2=2
-Ids of node in timeout mode:
-Sorted events list:
-[[3 1 array(0, dtype=object) 0]
- [0 2.0 array([0, 2, 'eth0', 'Hello World!', 1, 2.0, 1, 0], dtype=object)
- 1]
- [0 2.0 array([1, 2, 'eth0', 'Hello World!', 1, 2.0, 1, 0], dtype=object)
- 1]]
------------------------------------------------
-Started since 0.08s
-Simulated time 1.000s (or more precisely 1s)
-Node number per state: pending=2 terminated=1
-Node sharing: n2=2
-Ids of node in timeout mode:
-Sorted events list:
-[[3 2 array(0, dtype=object) 0]
- [0 2.25
- array([0, 2, 'eth0', 'Hello World!', 1, 1.25, 0.5, 0], dtype=object) 1]
- [0 2.25
- array([1, 2, 'eth0', 'Hello World!', 1, 1.25, 0.5, 0], dtype=object) 1]]
------------------------------------------------
-Started since 0.08s
-Simulated time 2.000s (or more precisely 2s)
-Node number per state: pending=2 terminated=1
-Node sharing: n2=2
-Ids of node in timeout mode:
-Sorted events list:
-[[0 2.3
- array([0, 2, 'eth0', 'Hello World!', 1, 0.30000000000000004, 0.1, 0],
- dtype=object) 1]
- [0 2.3
- array([1, 2, 'eth0', 'Hello World!', 1, 0.30000000000000004, 0.1, 0],
- dtype=object) 1]
- [3 3 array(0, dtype=object) 0]]
------------------------------------------------
-Started since 0.09s
-Simulated time 2.300s (or more precisely 2.3s)
-Node number per state: terminated=3
-Node sharing:
-Ids of node in timeout mode:
-Sorted events list:
-[[3 3 array(0, dtype=object) 0]]
diff --git a/tests/mobility_wlan0_bandwidth_1s1r/mobility.py b/tests/mobility_wlan0_bandwidth_1s1r/mobility.py
new file mode 100755
index 0000000..4f5a7a4
--- /dev/null
+++ b/tests/mobility_wlan0_bandwidth_1s1r/mobility.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+def callback(simulator):
+ simulator.log("Network update!")
+ L=simulator.netmat["wlan0"]["latency"]
+ new_bw_wlan0=simulator.netmat["wlan0"]["bandwidth"]*2
+ simulator.update_network({"wlan0":{"bandwidth":new_bw_wlan0, "latency":L, "is_wired":False}})
diff --git a/tests/mobility_wlan0_bandwidth_1s1r/simulator.py b/tests/mobility_wlan0_bandwidth_1s1r/platform.yaml
index 7fce9e9..c0231a8 100755..100644
--- a/tests/mobility_wlan0_bandwidth_1s1r/simulator.py
+++ b/tests/mobility_wlan0_bandwidth_1s1r/platform.yaml
@@ -1,9 +1,3 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
########## Scenario ##########
# Notations:
# - Remaining communication duration (last communication ends minus current simulated time) = C
@@ -22,18 +16,22 @@ import numpy as np
# |-------------------+------------+----------------+----------------------+---------------------------+--------------------------|
##############################
-B=np.full((2,2),8)
-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("sender")
-s.create_node("receiver")
-
-def callback(simulator):
- simulator.log("Network update!")
- new_bw_wlan0=simulator.netmat["wlan0"]["bandwidth"]*2
- new_bw_eth0=simulator.netmat["eth0"]["bandwidth"]*2
- simulator.update_network({"wlan0":{"bandwidth":new_bw_wlan0, "latency":L, "is_wired":False}, "eth0":{"bandwidth":new_bw_eth0, "latency":L, "is_wired":True}})
+general:
+ breakpoints_every: 0.5
+ breakpoints_callback:
+ file: "mobility.py"
+ callback: "callback"
+nodes:
+ count: 2
+ implementations:
+ - 0 sender.py
+ - 1 receiver.py
-s.run(breakpoints_every=1/2,breakpoint_callback=callback)
+interfaces:
+ wlan0:
+ type: "wireless"
+ links:
+ - all 1Bps 0s all
+ txperfs:
+ - all 1Bps 0s
diff --git a/tests/mobility_wlan0_latency_1s1r/mobility.py b/tests/mobility_wlan0_latency_1s1r/mobility.py
new file mode 100755
index 0000000..bb245e7
--- /dev/null
+++ b/tests/mobility_wlan0_latency_1s1r/mobility.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+def callback(simulator):
+ simulator.log("Network update!")
+ B=simulator.netmat["wlan0"]["bandwidth"]
+ new_lat_wlan0=simulator.netmat["wlan0"]["latency"]+1/2
+ simulator.update_network({"wlan0":{"bandwidth":B, "latency":new_lat_wlan0, "is_wired":False}})
diff --git a/tests/mobility_wlan0_latency_1s1r/platform.yaml b/tests/mobility_wlan0_latency_1s1r/platform.yaml
new file mode 100644
index 0000000..ba70d98
--- /dev/null
+++ b/tests/mobility_wlan0_latency_1s1r/platform.yaml
@@ -0,0 +1,37 @@
+########## Scenario ##########
+# Notations:
+# - Remaining communication duration (last communication ends minus current simulated time) = C
+# - Last communication duration (previous row) = U
+# - Last remaining data size (previous row) = D
+# - Current remaining data (current row) = R
+# - Initial data size (first row) = I
+# - Bandwidth = BW
+# - Latency = L
+# |-------------------+------------+----------------+----------------------+---------------------------+--------------------------|
+# | Simulated time(s) | Latency(s) | Bandwidth(bps) | Remaining data (bit) | Communication duration(s) | Communication ends at(s) |
+# |-------------------+------------+----------------+----------------------+---------------------------+--------------------------|
+# | 0 | 0 | 8 | 8 | 1 | 1 |
+# | 0.5 | 0 | 16 | C/U*D = 4 | R/I * L + R/BW = 0.25 | 0.75 |
+# | 0.75 | 0 | 16 | | | |
+# |-------------------+------------+----------------+----------------------+---------------------------+--------------------------|
+##############################
+
+general:
+ breakpoints_every: 0.5
+ breakpoints_callback:
+ file: "mobility.py"
+ callback: "callback"
+
+nodes:
+ count: 2
+ implementations:
+ - 0 sender.py
+ - 1 receiver.py
+
+interfaces:
+ wlan0:
+ type: "wireless"
+ links:
+ - all 1Bps 0s all
+ txperfs:
+ - all 1Bps 0s \ No newline at end of file
diff --git a/tests/mobility_wlan0_latency_1s1r/simulator.py b/tests/mobility_wlan0_latency_1s1r/simulator.py
deleted file mode 100755
index 92668f7..0000000
--- a/tests/mobility_wlan0_latency_1s1r/simulator.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env python
-
-# Load ESDS
-import esds
-import numpy as np
-
-########## Scenario ##########
-# Notations:
-# - Remaining communication duration (last communication ends minus current simulated time) = C
-# - Last communication duration (previous row) = U
-# - Last remaining data size (previous row) = D
-# - Current remaining data (current row) = R
-# - Initial data size (first row) = I
-# - Bandwidth = BW
-# - Latency = L
-# |-------------------+------------+----------------+----------------------+---------------------------+--------------------------|
-# | Simulated time(s) | Latency(s) | Bandwidth(bps) | Remaining data (bit) | Communication duration(s) | Communication ends at(s) |
-# |-------------------+------------+----------------+----------------------+---------------------------+--------------------------|
-# | 0 | 0 | 8 | 8 | 1 | 1 |
-# | 0.5 | 0.5 | 8 | C/U*D = 4 | R/I * L + R/BW = 0.75 | 1.25 |
-# | 1 | 1 | 8 | C/U*D = 1.33 | R/I * L + R/BW = 0.33 | 1.33 |
-# | 1.33 | 1 | 8 | | | |
-# |-------------------+------------+----------------+----------------------+---------------------------+--------------------------|
-##############################
-
-B=np.full((2,2),8)
-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("sender")
-s.create_node("receiver")
-
-def callback(simulator):
- simulator.log("Network update!")
- new_lat_wlan0=simulator.netmat["wlan0"]["latency"]+1/2
- new_lat_eth0=simulator.netmat["eth0"]["latency"]+1/2
- simulator.update_network({"wlan0":{"bandwidth":B, "latency":new_lat_wlan0, "is_wired":False},"eth0":{"bandwidth":B, "latency":new_lat_eth0, "is_wired":True}})
-
-
-s.run(breakpoints_every=1/2,breakpoint_callback=callback)
diff --git a/tests/run.py b/tests/run.py
index 0af8d1c..043441a 100755
--- a/tests/run.py
+++ b/tests/run.py
@@ -10,12 +10,12 @@ tests_path = os.path.dirname(os.path.realpath(__file__))
for file in os.listdir(tests_path):
current_test_path=os.path.join(tests_path,file)
if os.path.isdir(current_test_path):
- simulator_path=os.path.join(current_test_path,"simulator.py")
+ platform_path=os.path.join(current_test_path,"platform.yaml")
out_path=os.path.join(current_test_path,"out")
print("- %-40s%s " % (file,"=>"),end='')
try:
start_at=time.time()
- out=subprocess.check_output([sys.executable, simulator_path],stderr=subprocess.STDOUT,timeout=tests_timeout,encoding="utf-8")
+ out=subprocess.check_output(["esds", "run", platform_path],stderr=subprocess.STDOUT,timeout=tests_timeout,encoding="utf-8")
out_expected=open(out_path).read()
end_at=time.time()
if out_expected != out:
diff --git a/tests/run.sh b/tests/run.sh
index 1a98c5d..4d30c7f 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -11,9 +11,7 @@ for test in ${tests}
do
printf "%-50s%s %s" "- $(basename $test)" "=>"
cd $test
- testcmd="${pythonexec} simulator.py"
- [ -e "platform.yaml" ] && testcmd="esds run platform.yaml"
- echo $testcmd
+ testcmd="esds run platform.yaml"
timeout $test_timeout ${testcmd} &> "$out"
# Ensure timeout