summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-07-14 14:07:52 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2022-07-14 14:07:52 +0200
commite0dbebe31d4288f3636ef3871f45429b86b1d737 (patch)
tree76574caae6ba69f42e304276f09e636845b9a3e9 /tests
parent9671fc21eea14b6128c5f85208df4be0529c69d1 (diff)
Go back to commit 1eee1ac8
Diffstat (limited to 'tests')
-rw-r--r--tests/api_send_eth0_1s1r/out7
-rw-r--r--tests/api_send_eth0_1s1r/receiver.py4
-rw-r--r--tests/api_send_eth0_1s1r/sender.py6
3 files changed, 13 insertions, 4 deletions
diff --git a/tests/api_send_eth0_1s1r/out b/tests/api_send_eth0_1s1r/out
index 9168e55..8768500 100644
--- a/tests/api_send_eth0_1s1r/out
+++ b/tests/api_send_eth0_1s1r/out
@@ -8,8 +8,11 @@
[t=3.000,src=n1] Turned off
[t=4.000,src=n1] Turned on
[t=5.000,src=n1] Receive failed code=-1
-[t=5.000,src=n1] Turned off
[t=18.000,src=n0] End transmission
[t=18.000,src=n0] Send 15 bytes to n1 on eth0
+[t=33.000,src=n1] Receive 15 bytes on eth0
[t=33.000,src=n0] End transmission
-[t=33.000,src=esds] Simulation ends
+[t=33.000,src=n0] Send 15 bytes to n1 on eth0
+[t=35.000,src=n1] Turned off
+[t=35.000,src=n0] End transmission
+[t=35.000,src=esds] Simulation ends
diff --git a/tests/api_send_eth0_1s1r/receiver.py b/tests/api_send_eth0_1s1r/receiver.py
index d2a3656..ae1169c 100644
--- a/tests/api_send_eth0_1s1r/receiver.py
+++ b/tests/api_send_eth0_1s1r/receiver.py
@@ -17,6 +17,10 @@ def execute(api):
code, data=api.receivet("eth0",1)
msg="Received: "+data if code == 0 else "Receive failed code="+str(code)
api.log(msg)
+ ##### Ensure communication get aborted on turned off for the sender
+ api.wait(28) # Goto t=33s
+ api.wait(2) # Goto t=35s
api.turn_off()
+
diff --git a/tests/api_send_eth0_1s1r/sender.py b/tests/api_send_eth0_1s1r/sender.py
index 8abb5e7..c62625b 100644
--- a/tests/api_send_eth0_1s1r/sender.py
+++ b/tests/api_send_eth0_1s1r/sender.py
@@ -6,5 +6,7 @@ def execute(api):
api.wait(1) # Goto t=3s
api.send("eth0","Hello World!",15,1) # Communication should not be aborted even if receiver turned_off (e.g UDP)
api.log("End transmission") # Should be printed at t=18s
- api.send("eth0","Hello World!",15,1) # Now receiver is off
- api.log("End transmission") # Should be printed at t=33s \ No newline at end of file
+ api.send("eth0","Hello World!",15,1) # Now receiver is off (but send should continue)
+ api.log("End transmission") # Should be printed at t=33s
+ api.send("eth0","Hello World!",15,1,receiver_required=True) # Now receiver is off and send should be interrupted
+ api.log("End transmission") # Should be printed at t=35s (receiver turned off at t=35s)