summaryrefslogtreecommitdiff
path: root/tests/api_send_eth0_3s1r/receiver.py
blob: 4516d7a319e5af385384620b36f089755df86dee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python

def receive(node, n):
    for i in range(0,n):
        code, data=node.receive("eth0")
        msg="Received: "+data if code == 0 else "Receive failed code="+str(code)
        node.log(msg)

def execute(api):
    # Receive the first 3 send that should end at 3s
    receive(api,3)
    # Receive the first 3 send that should end at 7s
    receive(api,3)
    # Receive the first 3 send that should end at 12s
    receive(api,3)
    # Receive the first 3 send that should end at 18s
    receive(api,3)
    # Should ends at 23s
    receive(api,1)