summaryrefslogtreecommitdiff
path: root/tests/api_receivet0_eth0_1s1r
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-09-09 13:16:42 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2022-09-09 13:16:42 +0200
commitcfa677a0c678f742203aea601c6368768e5467da (patch)
treebe42cf52fc912a6ca78d334039d47cfb591e9e43 /tests/api_receivet0_eth0_1s1r
parent57f020e09d738e283520e8cfc88b4cdd1aeaa551 (diff)
Debug synchronization + add return code
Diffstat (limited to 'tests/api_receivet0_eth0_1s1r')
-rw-r--r--tests/api_receivet0_eth0_1s1r/out2
-rw-r--r--tests/api_receivet0_eth0_1s1r/receiver.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/tests/api_receivet0_eth0_1s1r/out b/tests/api_receivet0_eth0_1s1r/out
index b9f63cd..0116a1d 100644
--- a/tests/api_receivet0_eth0_1s1r/out
+++ b/tests/api_receivet0_eth0_1s1r/out
@@ -1,5 +1,5 @@
[t=0.000,src=n0] Send 1 bytes to n1 on eth0
-[t=0.000,src=n1] Receive failed code=-1
+[t=0.000,src=n1] Receive failed code=RCode.TIMEOUT_EXPIRE
[t=1.000,src=n1] Receive 1 bytes on eth0
[t=1.000,src=n1] Received: Hello World!
[t=1.000,src=esds] Simulation ends
diff --git a/tests/api_receivet0_eth0_1s1r/receiver.py b/tests/api_receivet0_eth0_1s1r/receiver.py
index e57c460..021b854 100644
--- a/tests/api_receivet0_eth0_1s1r/receiver.py
+++ b/tests/api_receivet0_eth0_1s1r/receiver.py
@@ -1,9 +1,10 @@
#!/usr/bin/env python
+from esds import RCode
def receivet(node,timeout):
##### Simple receive
code, data=node.receivet("eth0",timeout)
- msg="Received: "+data if code == 0 else "Receive failed code="+str(code)
+ msg="Received: "+data if code == RCode.SUCCESS else "Receive failed code="+str(code)
node.log(msg)
def execute(api):