示例#1
0
def test_task03(rpl_nodes):
    pinger = rpl_nodes[-1]

    _, root_addr = global_addr(rpl_nodes[0].ifconfig_list())
    res = ping6(pinger, root_addr, count=100, packet_size=50, interval=100)
    assert res["stats"]["packet_loss"] < 20
    check_pktbuf(*rpl_nodes)
示例#2
0
def test_task03(rpl_nodes):
    pinger = rpl_nodes[-1]

    _, root_addr = global_addr(rpl_nodes[0].ifconfig_list())
    res = ping6(pinger, root_addr, count=100, packet_size=50, interval=100)
    assert res["stats"]["packet_loss"] < 20
    time.sleep(10)
    for node in rpl_nodes:
        assert pktbuf(node).is_empty()
示例#3
0
def test_task04(rpl_nodes):
    nodes = rpl_nodes
    for client, server in [(nodes[0], nodes[-1]), (nodes[-1], nodes[0])]:
        server.udp_server_start(1337)
        _, server_addr = global_addr(server.ifconfig_list())

        client.udp_client_send(server_addr,
                               1337,
                               count=100,
                               delay_ms=100,
                               payload=50)
        packet_loss = server.udp_server_check_output(count=100, delay_ms=100)
        assert packet_loss < 10
        server.udp_server_stop()
    check_pktbuf(*rpl_nodes)
示例#4
0
def test_task05(rpl_nodes):
    nodes = rpl_nodes
    for client, server in [(nodes[0], nodes[-1]), (nodes[-1], nodes[0])]:
        server.udp_server_start(1337)
        _, server_addr = global_addr(server.ifconfig_list())

        client.udp_client_send(server_addr,
                               1337,
                               count=100,
                               delay_ms=1000,
                               payload=2048)
        packet_loss = server.udp_server_check_output(count=100, delay_ms=100)
        if packet_loss >= 10:
            pytest.xfail(
                "packet_loss {} >= 10. This is an experimental task, see also "
                # pylint: disable=C0301
                "https://github.com/RIOT-OS/Release-Specs/issues/142#issuecomment-561677974"  # noqa: E501
                .format(packet_loss))
        assert packet_loss < 10
        server.udp_server_stop()
    check_pktbuf(*rpl_nodes)