Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

pytest: add capability to log nodes to file #182

Merged
merged 2 commits into from
Aug 5, 2020

Conversation

miri64
Copy link
Member

@miri64 miri64 commented Jul 31, 2020

Sometimes you need a clean, direct log from the nodes and not whatever filtered stuff comes out of pexpect. This provides the capability to do that with the pytest framework for the release tests.

Requires RIOT-OS/RIOT#14664 to actually work.

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested, works as expected, ACK but lets wait for the dependency to get into master before merging.

pytest 04-single-hop-6lowpan-icmp/test_spec04.py -k=01 --non-RC --log-file-fmt=test.log; cat test.log
========================================================== test session starts ==========================================================
platform linux -- Python 3.6.9, pytest-5.4.3, py-1.9.0, pluggy-0.13.1 -- /home/francisco/.virtualenvs/release/bin/python3
cachedir: .pytest_cache
rootdir: /home/francisco/workspace/Release-Specs, inifile: setup.cfg
plugins: cov-2.10.0
collected 10 items / 9 deselected / 1 selected

04-single-hop-6lowpan-icmp/test_spec04.py::test_task01[nodes0] PASSED                                                             [100%]

------------------------------ generated xml file: /home/francisco/workspace/Release-Specs/test-report.xml ------------------------------
============================================== 1 passed, 9 deselected in 124.37s (0:02:04) ==============================================
> ifconfig
Iface  6  HWaddr: 0B:97  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK

          Long HWaddr: 56:AD:FC:65:10:6B:11:14
           TX-Power: 0dBm  State: IDLE  max. Retrans.: 3  CSMA Retries: 4
          AUTOACK  ACK_REQ  CSMA  L2-PDU:102  MTU:1280  HL:64  RTR
          6LO  IPHC
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::54ad:fc65:106b:1114  scope: link  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff6b:1114

          Statistics for Layer 2
            RX packets 0  bytes 0
            TX packets 2 (Multicast: 2)  bytes 86
            TX succeeded 2 errors 0
          Statistics for IPv6
            RX packets 0  bytes 0
            TX packets 2 (Multicast: 2)  bytes 128
            TX succeeded 2 errors 0

> ifconfig 6 set channel 26
success: set channel on interface 6 to 26
>
> ifconfig
Iface  6  HWaddr: 0F:87  Channel: 26  Page: 0  NID: 0x23  PHY: O-QPSK

          Long HWaddr: 52:BD:FC:65:10:6B:11:14
           TX-Power: 0dBm  State: IDLE  max. Retrans.: 3  CSMA Retries: 4
          AUTOACK  ACK_REQ  CSMA  L2-PDU:102  MTU:1280  HL:64  RTR
          6LO  IPHC
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::50bd:fc65:106b:1114  scope: link  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff6b:1114

          Statistics for Layer 2
            RX packets 2  bytes 86
            TX packets 3 (Multicast: 3)  bytes 129
            TX succeeded 3 errors 0
          Statistics for IPv6
            RX packets 2  bytes 128
            TX packets 3 (Multicast: 3)  bytes 192
            TX succeeded 3 errors 0

> ifconfig 6 set channel 26
success: set channel on interface 6 to 26
> ping6 fe80::54ad:fc65:106b:1114 -c 1000 -i 20 -s 0 -W 1000
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=0 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=1 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=2 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=3 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=4 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=5 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=6 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=7 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=8 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=9 ttl=64 rssi=-46 dBm
...
...
...
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=990 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=991 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=992 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=993 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=994 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=995 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=996 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=997 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=998 ttl=64 rssi=-46 dBm
8 bytes from fe80::54ad:fc65:106b:1114%6: icmp_seq=999 ttl=64 rssi=-46 dBm

--- fe80::54ad:fc65:106b:1114 PING statistics ---
1000 packets transmitted, 1000 packets received, 0% packet loss
> pktbuf
packet buffer: first byte: 0x200018a0, last byte: 0x200030a0 (size: 6144)
  position of last byte used: 296
~ unused: 0x200018a0 (next: (nil), size: 6144) ~
> pktbuf
packet buffer: first byte: 0x200018a0, last byte: 0x200030a0 (size: 6144)
  position of last byte used: 248
~ unused: 0x200018a0 (next: (nil), size: 6144) ~

@miri64
Copy link
Member Author

miri64 commented Aug 5, 2020

ACK but lets wait for the dependency to get into master before merging.

Given that Murdock currently is out of order, I wait with a rebase in case you want to merge #173 first

@miri64 miri64 force-pushed the pytest/enh/log-nodes-to-file branch from 203ba10 to 39f43c0 Compare August 5, 2020 15:46
@miri64
Copy link
Member Author

miri64 commented Aug 5, 2020

Rebased to current master, now that RIOT-OS/RIOT#14664 is merged

@miri64 miri64 merged commit 07eee58 into RIOT-OS:master Aug 5, 2020
@miri64 miri64 deleted the pytest/enh/log-nodes-to-file branch August 5, 2020 20:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants