Skip to content

Commit

Permalink
riotctrl_shell.tests: provide case for multiple interfaces with stats
Browse files Browse the repository at this point in the history
(cherry picked from commit 92957e5)
  • Loading branch information
miri64 committed Jul 15, 2020
1 parent 8923701 commit f22559e
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions dist/pythonlibs/riotctrl_shell/tests/test_netif_list_parse.py
Expand Up @@ -364,3 +364,49 @@ def test_ifconfig_list_parser6():
assert "mcs" not in res["7"]
assert len(res["7"]["ipv6_addrs"]) == 1
assert len(res["7"]["ipv6_groups"]) == 3


def test_ifconfig_list_parser7():
cmd_output = """
Iface 8 HWaddr: 45:5B Channel: 26 NID: 0x23
Long HWaddr: 00:5A:45:50:0A:00:45:5B
L2-PDU:102 MTU:1280 HL:64 RTR
6LO IPHC
Source address length: 8
Link type: wireless
inet6 addr: fe80::25a:4550:a00:455b scope: link VAL
inet6 group: ff02::2
inet6 group: ff02::1
inet6 group: ff02::1:ff00:455b
Statistics for Layer 2
RX packets 0 bytes 0
TX packets 2 (Multicast: 2) bytes 43
TX succeeded 3 errors 0
Statistics for IPv6
RX packets 0 bytes 0
TX packets 2 (Multicast: 2) bytes 128
TX succeeded 2 errors 0
Iface 7 HWaddr: B6:4F:A1:0E:8F:CC
L2-PDU:1500 MTU:1500 HL:64 RTR
Source address length: 6
Link type: wired
inet6 addr: fe80::b44f:a1ff:fe0e:8fcc scope: link VAL
inet6 group: ff02::2
inet6 group: ff02::1
inet6 group: ff02::1:ff0e:8fcc
Statistics for Layer 2
RX packets 4 bytes 480
TX packets 3 (Multicast: 3) bytes 210
TX succeeded 3 errors 0
Statistics for IPv6
RX packets 4 bytes 424
TX packets 3 (Multicast: 3) bytes 168
TX succeeded 3 errors 0"""
parser = riotctrl_shell.netif.IfconfigListParser()
res = parser.parse(cmd_output)
assert len(res) == 2
assert "7" in res
assert "8" in res

0 comments on commit f22559e

Please sign in to comment.