Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

tests/net/gnrc_mac_timeout: add automated test #19639

Merged
merged 1 commit into from
May 23, 2023

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented May 21, 2023

Contribution description

in ##19636 (and more precisely in da854bb), I noticed that this test could be automated quite easily.

Testing procedure

  • Green CI (Murdock should run the test on native)
  • Tested on iotlab-m3 and nrf52dk remotely on IoT-LAB and it works as expected:
  • iotlab-m3:
$ make -C tests/net/gnrc_mac_timeout/ flash test BOARD=iotlab-m3 IOTLAB_NODE=auto
make: Entering directory '/work/riot/RIOT/tests/net/gnrc_mac_timeout'
Building application "tests_gnrc_mac_timeout" for "iotlab-m3" with MCU "stm32".

"make" -C /work/riot/RIOT/pkg/cmsis/ 
"make" -C /work/riot/RIOT/boards/common/init
"make" -C /work/riot/RIOT/boards/iotlab-m3
"make" -C /work/riot/RIOT/boards/common/iotlab
"make" -C /work/riot/RIOT/core
"make" -C /work/riot/RIOT/core/lib
"make" -C /work/riot/RIOT/cpu/stm32
"make" -C /work/riot/RIOT/cpu/cortexm_common
"make" -C /work/riot/RIOT/cpu/cortexm_common/periph
"make" -C /work/riot/RIOT/cpu/stm32/periph
"make" -C /work/riot/RIOT/cpu/stm32/stmclk
"make" -C /work/riot/RIOT/cpu/stm32/vectors
"make" -C /work/riot/RIOT/drivers
"make" -C /work/riot/RIOT/drivers/periph_common
"make" -C /work/riot/RIOT/sys
"make" -C /work/riot/RIOT/sys/auto_init
"make" -C /work/riot/RIOT/sys/div
"make" -C /work/riot/RIOT/sys/event
"make" -C /work/riot/RIOT/sys/evtimer
"make" -C /work/riot/RIOT/sys/fmt
"make" -C /work/riot/RIOT/sys/frac
"make" -C /work/riot/RIOT/sys/isrpipe
"make" -C /work/riot/RIOT/sys/libc
"make" -C /work/riot/RIOT/sys/luid
"make" -C /work/riot/RIOT/sys/malloc_thread_safe
"make" -C /work/riot/RIOT/sys/net/gnrc
"make" -C /work/riot/RIOT/sys/net/gnrc/link_layer/mac
"make" -C /work/riot/RIOT/sys/net/gnrc/netapi
"make" -C /work/riot/RIOT/sys/net/gnrc/netif
"make" -C /work/riot/RIOT/sys/net/gnrc/netif/hdr
"make" -C /work/riot/RIOT/sys/net/gnrc/netreg
"make" -C /work/riot/RIOT/sys/net/gnrc/pkt
"make" -C /work/riot/RIOT/sys/net/gnrc/pktbuf
"make" -C /work/riot/RIOT/sys/net/gnrc/pktbuf_static
"make" -C /work/riot/RIOT/sys/net/gnrc/priority_pktqueue
"make" -C /work/riot/RIOT/sys/net/link_layer/csma_sender
"make" -C /work/riot/RIOT/sys/net/link_layer/l2util
"make" -C /work/riot/RIOT/sys/net/netif
"make" -C /work/riot/RIOT/sys/newlib_syscalls_default
"make" -C /work/riot/RIOT/sys/pm_layered
"make" -C /work/riot/RIOT/sys/preprocessor
"make" -C /work/riot/RIOT/sys/random
"make" -C /work/riot/RIOT/sys/stdio_uart
"make" -C /work/riot/RIOT/sys/test_utils/interactive_sync
"make" -C /work/riot/RIOT/sys/test_utils/print_stack_usage
"make" -C /work/riot/RIOT/sys/tsrb
"make" -C /work/riot/RIOT/sys/ztimer
   text	   data	    bss	    dec	    hex	filename
  15236	    176	  10324	  25736	   6488	/work/riot/RIOT/tests/net/gnrc_mac_timeout/bin/iotlab-m3/tests_gnrc_mac_timeout.elf
iotlab-node --jmespath='keys(@)[0]' --format='lambda ret: exit(int(ret))'  --list saclay,m3,10 --flash /work/riot/RIOT/tests/net/gnrc_mac_timeout/bin/iotlab-m3/tests_gnrc_mac_timeout.bin
r
ssh -t [email protected] 'socat - tcp:m3-10.saclay.iot-lab.info:20000' 
READY
s
START
main(): This is RIOT! (Version: 2023.07-devel-418-ga28f6)
Testing gnrc_mac timeout module (start time = 3369 ms)
Set timeout_1, should be expired at 4369 ms)
Set timeout_2, should be expired at 5907 ms)
Set timeout_3, should be expired at 6840 ms)
Are the reception times of all 3 msgs close to the supposed values?

If yes, the tests were successful
{ "threads": [{ "name": "main", "stack_size": 1536, "stack_used": 424}]}
At   4369 ms received msg 1: timeout_1 (set at 3369 ms) expired, supposed to be 4369 ms!
At   4369 ms: timeout_1 is not running.
At   4369 ms: timeout_2 is running.
At   4369 ms: timeout_3 is running.
At   5907 ms received msg 2: timeout_2 (set at 3369 ms) expired, supposed to be 5907 ms!
At   5907 ms: timeout_1 is not running.
At   5907 ms: timeout_2 is not running.
At   5907 ms: timeout_3 is running.
At   6840 ms received msg 3: timeout_3 (set at 3369 ms) expired, supposed to be 6840 ms!
At   6840 ms: timeout_1 is not running.
At   6840 ms: timeout_2 is not running.
At   6840 ms: timeout_3 is not running.

make: Leaving directory '/work/riot/RIOT/tests/net/gnrc_mac_timeout'
  • nrf52dk:
$ make -C tests/net/gnrc_mac_timeout/ flash test BOARD=nrf52dk IOTLAB_NODE=auto
make: Entering directory '/work/riot/RIOT/tests/net/gnrc_mac_timeout'
Building application "tests_gnrc_mac_timeout" for "nrf52dk" with MCU "nrf52".

"make" -C /work/riot/RIOT/pkg/cmsis/ 
"make" -C /work/riot/RIOT/boards/common/init
"make" -C /work/riot/RIOT/boards/nrf52dk
"make" -C /work/riot/RIOT/boards/common/nrf52xxxdk
"make" -C /work/riot/RIOT/core
"make" -C /work/riot/RIOT/core/lib
"make" -C /work/riot/RIOT/cpu/nrf52
"make" -C /work/riot/RIOT/cpu/cortexm_common
"make" -C /work/riot/RIOT/cpu/cortexm_common/periph
"make" -C /work/riot/RIOT/cpu/nrf52/periph
"make" -C /work/riot/RIOT/cpu/nrf52/vectors
"make" -C /work/riot/RIOT/cpu/nrf5x_common
"make" -C /work/riot/RIOT/cpu/nrf5x_common/periph
"make" -C /work/riot/RIOT/drivers
"make" -C /work/riot/RIOT/drivers/periph_common
"make" -C /work/riot/RIOT/sys
"make" -C /work/riot/RIOT/sys/auto_init
"make" -C /work/riot/RIOT/sys/div
"make" -C /work/riot/RIOT/sys/event
"make" -C /work/riot/RIOT/sys/evtimer
"make" -C /work/riot/RIOT/sys/fmt
"make" -C /work/riot/RIOT/sys/frac
"make" -C /work/riot/RIOT/sys/isrpipe
"make" -C /work/riot/RIOT/sys/libc
"make" -C /work/riot/RIOT/sys/luid
"make" -C /work/riot/RIOT/sys/malloc_thread_safe
"make" -C /work/riot/RIOT/sys/net/gnrc
"make" -C /work/riot/RIOT/sys/net/gnrc/link_layer/mac
"make" -C /work/riot/RIOT/sys/net/gnrc/netapi
"make" -C /work/riot/RIOT/sys/net/gnrc/netif
"make" -C /work/riot/RIOT/sys/net/gnrc/netif/hdr
"make" -C /work/riot/RIOT/sys/net/gnrc/netreg
"make" -C /work/riot/RIOT/sys/net/gnrc/pkt
"make" -C /work/riot/RIOT/sys/net/gnrc/pktbuf
"make" -C /work/riot/RIOT/sys/net/gnrc/pktbuf_static
"make" -C /work/riot/RIOT/sys/net/gnrc/priority_pktqueue
"make" -C /work/riot/RIOT/sys/net/link_layer/csma_sender
"make" -C /work/riot/RIOT/sys/net/link_layer/l2util
"make" -C /work/riot/RIOT/sys/net/netif
"make" -C /work/riot/RIOT/sys/newlib_syscalls_default
"make" -C /work/riot/RIOT/sys/preprocessor
"make" -C /work/riot/RIOT/sys/random
"make" -C /work/riot/RIOT/sys/stdio_uart
"make" -C /work/riot/RIOT/sys/test_utils/interactive_sync
"make" -C /work/riot/RIOT/sys/test_utils/print_stack_usage
"make" -C /work/riot/RIOT/sys/tsrb
"make" -C /work/riot/RIOT/sys/ztimer
   text	   data	    bss	    dec	    hex	filename
  15092	    168	  10348	  25608	   6408	/work/riot/RIOT/tests/net/gnrc_mac_timeout/bin/nrf52dk/tests_gnrc_mac_timeout.elf
iotlab-node --jmespath='keys(@)[0]' --format='lambda ret: exit(int(ret))'  --list saclay,nrf52dk,10 --flash /work/riot/RIOT/tests/net/gnrc_mac_timeout/bin/nrf52dk/tests_gnrc_mac_timeout.bin
r
ssh -t [email protected] 'socat - tcp:nrf52dk-10.saclay.iot-lab.info:20000' 
Help: Press s to start test, r to print it is ready
Help: Press s to start test, r to print it is ready
READY
s
START
main(): This is RIOT! (Version: 2023.07-devel-419-g02aa7-pr/tests/net_gnrc_mac_timeout_add_test)
Testing gnrc_mac timeout module (start time = 3077 ms)
Set timeout_1, should be expired at 4077 ms)
Set timeout_2, should be expired at 5615 ms)
Set timeout_3, should be expired at 6548 ms)
Are the reception times of all 3 msgs close to the supposed values?

If yes, the tests were successful
{ "threads": [{ "name": "main", "stack_size": 1536, "stack_used": 424}]}
At   4085 ms received msg 1: timeout_1 (set at 3077 ms) expired, supposed to be 4077 ms!
At   4085 ms: timeout_1 is not running.
At   4085 ms: timeout_2 is running.
At   4085 ms: timeout_3 is running.
At   5635 ms received msg 2: timeout_2 (set at 3077 ms) expired, supposed to be 5615 ms!
At   5635 ms: timeout_1 is not running.
At   5635 ms: timeout_2 is not running.
At   5635 ms: timeout_3 is running.
At   6575 ms received msg 3: timeout_3 (set at 3077 ms) expired, supposed to be 6548 ms!
At   6575 ms: timeout_1 is not running.
At   6575 ms: timeout_2 is not running.
At   6575 ms: timeout_3 is not running.

make: Leaving directory '/work/riot/RIOT/tests/net/gnrc_mac_timeout'

Issues/PRs references

@aabadie aabadie requested a review from miri64 as a code owner May 21, 2023 14:44
@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 21, 2023
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label May 21, 2023
@riot-ci
Copy link

riot-ci commented May 21, 2023

Murdock results

✔️ PASSED

da67b11 tests/net/gnrc_mac_timeout: add automated test

Success Failures Total Runtime
17 0 17 01m:46s

Artifacts

@kaspar030 kaspar030 added the CI: run tests If set, CI server will run tests on hardware for the labeled PR label May 23, 2023
Copy link
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

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

ACK.

@kaspar030
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented May 23, 2023

🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@aabadie
Copy link
Contributor Author

aabadie commented May 23, 2023

bors merge

bors bot added a commit that referenced this pull request May 23, 2023
19618: cpu/stm32: fix riotboot settings for L4 and WB r=aabadie a=gschorcht

### Contribution description

This PR fixes the `riotboot` configuration for L4 and WB.

The family is not called `stm32l4` or `stm32wb` but `l4` and `wb`. That is, the `riotboot` configuration didn't work at all. Furthermore, a minimum `RIOTBOOT_LEN` of `0x2000` is required for L4.

Found when investigating the compilation errors for `bootloaders/riotboot_serial` in PR #19576.

### Testing procedure

1. Green CI.
2. Use the following commands:
    ```
    BOARD=nucleo-l496zg make -C tests/riotboot info-debug-variable-RIOTBOOT_HDR_LEN
    BOARD=p-nucleo-wb55 make -C tests/riotboot info-debug-variable-RIOTBOOT_HDR_LEN
    ```
    In master these commands give
    ```
    0x400
    ```
    With this PR these commands give
    ```
    0x200
    ```
    as expected.
3. Use the following commands:
    ```
    BOARD=nucleo-l496zg make -C tests/riotboot info-debug-variable-RIOTBOOT_LEN
    BOARD=p-nucleo-wb55 make -C tests/riotboot info-debug-variable-RIOTBOOT_LEN
    ```
    In master these commands give
    ```
    0x1000
    ```
    With this PR these commands give
    ```
    0x2000
    ```
    as expected.

### Issues/PRs references


19636: sys: model ecc, evtimer, pipe and shell_lock in kconfig r=aabadie a=aabadie



19639: tests/net/gnrc_mac_timeout: add automated test r=aabadie a=aabadie



Co-authored-by: Gunar Schorcht <[email protected]>
Co-authored-by: Alexandre Abadie <[email protected]>
@bors
Copy link
Contributor

bors bot commented May 23, 2023

This PR was included in a batch that was canceled, it will be automatically retried

bors bot added a commit that referenced this pull request May 23, 2023
19620: dist/tools/openocd: fix parsing of flash bank base r=aabadie a=maribu

### Contribution description

Since [80fc9fabc66a0bc767467fa14c703e5a9f340cd3] the format of the `flash list` command changed to a more human readable multi-line variant. Technically, the change is white-space only. Still, the current approach of parsing them with awk, sed and cut doesn't like the new multi-line format. The parsing is now delegated into a python script that is compatible across OpenOCD versions.

[80fc9fabc66a0bc767467fa14c703e5a9f340cd3]: openocd-org/openocd@80fc9fa


19636: sys: model ecc, evtimer, pipe and shell_lock in kconfig r=aabadie a=aabadie



19639: tests/net/gnrc_mac_timeout: add automated test r=aabadie a=aabadie



Co-authored-by: Marian Buschsieweke <[email protected]>
Co-authored-by: Alexandre Abadie <[email protected]>
@bors
Copy link
Contributor

bors bot commented May 23, 2023

Build failed (retrying...):

@bors
Copy link
Contributor

bors bot commented May 23, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit a272abb into RIOT-OS:master May 23, 2023
@aabadie aabadie deleted the pr/tests/net_gnrc_mac_timeout_add_test branch May 24, 2023 12:23
@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants