[riot-notifications] [RIOT-OS/RIOT] tools/iotlab: several improvements (#16501)

Alexandre Abadie notifications at github.com
Thu May 27 09:12:48 CEST 2021

The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.

### Contribution description

This PR ticks several items reported in #9694:

- It adds some logic to handle IOTLAB_NODE set with a comma separated form (e.g  saclay,m3,1). This is a common form when using the IoT-LAB CLI tools
- It adds checks to verify that iotlabcli/iotlabsshcli Python packages are installed (the logic is taken from riotgen-installed target)
- Better handles non supported boards to ignore IOTLAB_NODE: with incompatible archis, the logic is skipped with a warning printed
- It renames the deprecated `flash-m3` and `reset-m3` subcommands of iotlab-ssh (used with iotlab-a8-m3 boards) to the new `flash` and `reset` subcommands. Note that older versions of iotlab-ssh doesn't work anymore and only the latest version can be used (1.0.2), so this is a harmless change, it just remove a deprecation warning.

Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes

### Testing procedure

- Verify that the comma separated form returns the right IoT-LAB node:

$ make BOARD=iotlab-m3 -C examples/hello-world IOTLAB_NODE=saclay,m3,1 info-iotlab-node --no-print-directory 

- Verify that the tools installed checks are working as expected:

$ pip uninstall iotlabcli
$ make BOARD=iotlab-m3 -C examples/hello-world IOTLAB_NODE=saclay,m3,1 flash --no-print-directory 
'iotlab-experiment' command is not available please consider installing it from https://pypi.python.org/pypi/iotlabcli
/work/riot/RIOT/dist/testbed-support/makefile.iotlab.single.inc.mk:64: *** .  Stop.

iotlabsshcli is required with iotlab-a8-m3 board for flash/reset targets:
$ pip uninstall iotlabsshcli
$ make BOARD=iotlab-a8-m3 -C examples/hello-world IOTLAB_NODE=saclay,a8,1 flash --no-print-directory 
'iotlab-ssh' command is not available please consider installing it from https://pypi.python.org/pypi/iotlabsshcli
/work/riot/RIOT/dist/testbed-support/makefile.iotlab.single.inc.mk:73: *** .  Stop.
$ make BOARD=iotlab-a8-m3 -C examples/hello-world IOTLAB_NODE=saclay,a8,1 reset --no-print-directory 
'iotlab-ssh' command is not available please consider installing it from https://pypi.python.org/pypi/iotlabsshcli
/work/riot/RIOT/dist/testbed-support/makefile.iotlab.single.inc.mk:73: *** .  Stop.

- Verify that for unsupported boards (such as native) a warning is displayed but the build continues:

$ BUILD_IN_DOCKER=1 make -C examples/hello-world IOTLAB_NODE=auto --no-print-directory 
Board "native" incompatible with IOTLAB_NODE variable
Launching build container using image "riot/riotbuild:latest".
docker run --rm --tty --user $(id -u) -v '/usr/share/zoneinfo/Europe/Paris:/etc/localtime:ro' -v '/work/riot/RIOT:/data/riotbuild/riotbase:delegated' -e 'RIOTBASE=/data/riotbuild/riotbase' -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' -e 'BUILD_DIR=/data/riotbuild/riotbase/build' -e 'RIOTPROJECT=/data/riotbuild/riotbase' -e 'RIOTCPU=/data/riotbuild/riotbase/cpu' -e 'RIOTBOARD=/data/riotbuild/riotbase/boards' -e 'RIOTMAKE=/data/riotbuild/riotbase/makefiles'        -w '/data/riotbuild/riotbase/examples/hello-world/' 'riot/riotbuild:latest' make     
Building application "hello-world" for "native" with MCU "native".

"make" -C /data/riotbuild/riotbase/boards/native
"make" -C /data/riotbuild/riotbase/boards/native/drivers
"make" -C /data/riotbuild/riotbase/core
"make" -C /data/riotbuild/riotbase/cpu/native
"make" -C /data/riotbuild/riotbase/cpu/native/periph
"make" -C /data/riotbuild/riotbase/cpu/native/stdio_native
"make" -C /data/riotbuild/riotbase/drivers
"make" -C /data/riotbuild/riotbase/drivers/periph_common
"make" -C /data/riotbuild/riotbase/sys
"make" -C /data/riotbuild/riotbase/sys/auto_init
   text	   data	    bss	    dec	    hex	filename
  26181	    624	  47744	  74549	  12335	/data/riotbuild/riotbase/examples/hello-world/bin/native/hello-world.elf

- Verify no deprecation warning is printed when flashing/resetting an iotlab-a8-m3:

$ BUILD_IN_DOCKER=1 make BOARD=iotlab-a8-m3 -C examples/hello-world IOTLAB_NODE=auto flash-only term --no-print-directory 
iotlab-ssh --jmespath='keys(values(@)[0])[0]' --format='lambda ret: exit(int(ret))'  flash --list saclay,a8,110 /work/riot/RIOT/examples/hello-world/bin/iotlab-a8-m3/hello-world.bin
ssh -oProxyCommand='ssh abadie at saclay.iot-lab.info -W %h:%p' -oStrictHostKeyChecking=no -t root at node-a8-110.saclay.iot-lab.info 'socat - open:/dev/ttyA8_M3,b500000,echo=0,raw' 
main(): This is RIOT! (Version: 2021.07-devel-278-g540e9d-pr/tools/iotlab_comma_separated_form)
Hello World!
You are running RIOT on a(n) iotlab-a8-m3 board.
This board features a(n) stm32 MCU.
$ BUILD_IN_DOCKER=1 make BOARD=iotlab-a8-m3 -C examples/hello-world IOTLAB_NODE=auto reset --no-print-directory
iotlab-ssh --jmespath='keys(values(@)[0])[0]' --fmt='int'  reset --list saclay,a8,110

Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output

### Issues/PRs references

This PR is based on #16491 

Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.

You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * tools/testbed: use IOTLAB_NODE=auto instead of auto-ssh
  * fixup! tools/testbed: use IOTLAB_NODE=auto instead of auto-ssh
  * fixup! tools/testbed: use IOTLAB_NODE=auto instead of auto-ssh
  * tools/iotlab-testbed: handle IOTLAB_NODE in comma separated form
  * tools/iotlab-testbed: check iotlab cli tools are installed
  * tools/testbed-iotlab: better handle unsupported archis
  * tools/iotlab-testbed: rename deprecated flash/reset-m3 subcommands

-- File Changes --

    M Makefile.include (10)
    A dist/testbed-support/makefile.iotlab.archi.inc.mk (20)
    M dist/testbed-support/makefile.iotlab.single.inc.mk (94)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210527/03b82d64/attachment.htm>

More information about the notifications mailing list