-
Notifications
You must be signed in to change notification settings - Fork 21
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
testutils: add helpers for running Release Specs #79
Conversation
Add test 03-single-hop-ipv6-icmp tasks
Would be good to |
ok, I think it might make sense to give it a look now so other maintainers can run this test :) |
05-single-hop-route/task02.py
Outdated
|
||
os.chdir(os.path.join(riotbase, "tests/gnrc_udp")) | ||
|
||
#Create IoTLAB experiment (TODO: Return addresses) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the TODO would make the function more complicated than it needs to be. Keeping it seperated within get_nodes_addresses()
makes the API simpler.
The encoding parameter was only introduced with python 3.5, but e.g. Ubuntu 16.04 still uses python 3.4
testutils: several improvements
task06: provide test scripts
testutils.mixins: use assignment instead of equality
task04.common: fix for new emptiness check
task04.[78]: fix iotlab_cmd
Yes, but we should maybe make use of RIOT-OS/RIOT#10431 (or something similar that utilizes python's native testing features) to better be able to integrate it into whatever test framework we decide on later. |
@jia200x, I used the scripts provided by this PR to perform some checks on 2019.01-RC1. It is useful indeed but there are problems:
from iotlabcli.auth import get_user_credentials
from iotlabcli.rest import Api
from iotlabcli.experiment import (submit_experiment, wait_experiment,
stop_experiment, exp_resources)
def submit_iotlab_experiment(nodes, name='test', duration=60):
api = Api(*get_user_credentials())
resources = exp_resources(nodes)
return submit_experiment(api, name, duration, [resources])['id']
def wait_iotlab_experiment(exp_id):
ret = wait_experiment(Api(*get_user_credentials()), exp_id)
return ret
def stop_iotlab_experiment(exp_id):
ret = stop_experiment(Api(*get_user_credentials()), exp_id)
return ret
if __name__ == '__main__':
nodes = ['m3-1.saclay.iot-lab.info', 'samr21-1.saclay.iot-lab.info']
exp_id = submit_iotlab_experiment(nodes)
print(wait_iotlab_experiment(exp_id))
# Do stuff
stop_iotlab_experiment(exp_id)
Instead of having all this in a single PR (+1385 lines of pure Python, no comments, no docstring, etc), I would suggest to first refine the initial design and once done, adapt each task incrementally. Locally, I also had to make some changes that could be useful in the end (added a script for the task 4.9 + adapted a few things). |
I think some stuff here can ported and cross-contaminated with what I started in RIOT-OS/RIOT#10431 |
@aabadie thanks for the feedback!
Will fix
Roger
I was not away of the Python package. It makes sense indeed to use it.
Good catch
👍
Yes, I agree it needs more documentation.
I like that approach and would indeed benefit to have that TestCase wrapper here as well. |
BTW I just noticed. The tool should also make sure it is on the actual RC that is tested, so that people do not accidentally test |
I was able to run all of the IOT lab tests in 06 automatically. I PR'd my changes against this branch in jia200x#11 . I strongly believe that we should use a proper testing framework for this (pytest??). Reworking task01.py felt like reinventing the wheel yet again. |
Thanks for the changes!
Definitively. The original intention was to provide some scripts to automatically run tests (this included the IoTLAB helpers and stuff). But would never replace an actual test framework. |
I talked IRL with @jia200x. This is useful automating and I think should be merged in. It needs a bit of love which I am willing to give. |
Somebody care to approve? My opinion is that these specs are at such an "embryonic" state that there is not much point in working contributions to perfection before merge. |
I thought we don't merge because there is parallel work on the testing framework in RIOT upstream happening... |
I should clarify I don't want to merge this. Many things are outdated. I just wanted to take it over and Jose seemed to agree. I think it may be a bit of time before RIOT will see the testing framework improvements and sometimes it is better to just get it done then strip it later... (like I am doing with the philip tests in RIOT) |
#155 was merged so I guess this can be closed :-). |
This PR adds some helpers to help developers run Release Specs more efficiently.
This is still in an alpha state, but can be used for running some tests. As you can see there's a lot of code duplication (among other stuff). This is part of the work to be done. All feedback and contributions are welcome!!
I'm providing 4 scripts for running
05-single-hop-udp
tests. It's required before hand to configure TUN/TAP interface fornative
and to have an IoT-LAB account with already authenticated iotlab-cli tools.