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

11-lorawan: add RIOTCtrl tests for GNRC LoRaWAN #201

Closed
wants to merge 10 commits into from

Conversation

jia200x
Copy link
Member

@jia200x jia200x commented Jan 14, 2021

Contribution description

This PR adds the RIOTCtrl counterpart for #199. This test is using a TTN account and MQTT in order to check uplink and downlink messages, besides activations from the Network Server.
I plan to migrate the existing semtech LoRaMAC tests as soon as possible in order to also use these mechanisms, but I gave priority to GNRC LoRaWAN because it had no autotests.

Test procedure

Check github workflow output

Related issues/PRs

#199

@jia200x jia200x requested review from miri64 and fjmolinas January 14, 2021 17:13
conftest.py Outdated Show resolved Hide resolved
jia200x added a commit to jia200x/RIOT that referenced this pull request Jan 14, 2021
This commit injects some LoRaWAN secrets into `tox` in order to avoid
exposing LoRaWAN keys when running RIOT-OS/Release-Specs#201
@jia200x jia200x force-pushed the pr/riotctrl/11-lorawan branch from 8540fd5 to df089ae Compare January 14, 2021 20:45
conftest.py Outdated Show resolved Hide resolved
conftest.py Outdated Show resolved Hide resolved
conftest.py Outdated Show resolved Hide resolved
@jia200x
Copy link
Member Author

jia200x commented Jan 14, 2021

since RIOT-OS/RIOT#15774 got merged, this one can be merged after the Hard Feature Freeze, since it won't affect the RIOT repo

@jia200x
Copy link
Member Author

jia200x commented Jan 14, 2021

well, now with RIOT-OS/RIOT#15775 I can get rid of the hardcoded parameters here :)

@miri64
Copy link
Member

miri64 commented Jan 14, 2021

this one can be merged after the Hard Feature Freeze, since it won't affect the RIOT repo

The drawback is that these won't run automatically in RC1 then.

@jia200x
Copy link
Member Author

jia200x commented Jan 14, 2021

The drawback is that these won't run automatically in RC1 then.

I'm already on it. Let's see if we sneak it in ;)

@jia200x jia200x force-pushed the pr/riotctrl/11-lorawan branch from b47994f to fa49ec7 Compare January 14, 2021 23:13
@jia200x
Copy link
Member Author

jia200x commented Jan 14, 2021

I implemented and amended directly both suggestions:

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

______________________________________________________________________________________ summary ______________________________________________________________________________________
  test: commands succeeded
  flake8: commands succeeded
  pylint: commands succeeded
  congratulations :)

@jia200x jia200x force-pushed the pr/riotctrl/11-lorawan branch from fa49ec7 to 84b731c Compare January 14, 2021 23:15
11-lorawan/README.md Outdated Show resolved Hide resolved
conftest.py Outdated Show resolved Hide resolved
conftest.py Outdated Show resolved Hide resolved
@miri64
Copy link
Member

miri64 commented Jan 15, 2021

Huh??! the self tests are not executed, I just realised oO

@miri64
Copy link
Member

miri64 commented Jan 15, 2021

Ah, #200 fixes it.

@miri64
Copy link
Member

miri64 commented Jan 15, 2021

Please rebase to include #200.

testutils/pytest.py Outdated Show resolved Hide resolved
@jia200x jia200x force-pushed the pr/riotctrl/11-lorawan branch from 84b731c to 73b9c8c Compare January 15, 2021 08:21
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

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

Some non-compulsory improvement suggestions.

11-lorawan/test_spec11.py Outdated Show resolved Hide resolved
11-lorawan/test_spec11.py Outdated Show resolved Hide resolved
11-lorawan/test_spec11.py Outdated Show resolved Hide resolved
11-lorawan/test_spec11.py Outdated Show resolved Hide resolved
11-lorawan/test_spec11.py Outdated Show resolved Hide resolved
11-lorawan/test_spec11.py Outdated Show resolved Hide resolved
@jia200x
Copy link
Member Author

jia200x commented Jan 15, 2021

I will create the release branch now. For some reason LORAWAN_NWK_SKEY is not picked up (see https://github.com/RIOT-OS/RIOT/runs/1705350413?check_suite_focus=true).

Anyway, we can still run this test from our local setup. If we make it run, in worst case we create an RC2.

11-lorawan/test_spec11.py Outdated Show resolved Hide resolved
@jia200x
Copy link
Member Author

jia200x commented Jan 18, 2021

should I squash? :)

@jia200x jia200x mentioned this pull request Jan 18, 2021
88 tasks
@miri64
Copy link
Member

miri64 commented Jan 18, 2021

should I squash? :)

Yes please :-)

@miri64
Copy link
Member

miri64 commented Jan 18, 2021

Still needs tests for the new functionality added to testutils though.

@fjmolinas
Copy link
Contributor

@fjmolinas fjmolinas force-pushed the pr/riotctrl/11-lorawan branch from 9e2fb6d to b1e85cb 38 minutes ago

Yes, they were. According to that, it was pushed from "9e2fb6d". This is the HEAD in #201 (comment)

Then maybe they just didn't show up on github? And so I though there where none?

@jia200x
Copy link
Member Author

jia200x commented Apr 26, 2021

Feel free to force push and remove my changes if you prefer, I don't care/mind, just wanted to get this in

I'm also OK, if your test are passing let's just keep those

@fjmolinas
Copy link
Contributor

@fjmolinas fjmolinas force-pushed the pr/riotctrl/11-lorawan branch from 9e2fb6d to b1e85cb 38 minutes ago

Yes, they were. According to that, it was pushed from "9e2fb6d". This is the HEAD in #201 (comment)

Then maybe they just didn't show up on github? And so I though there where none?

But that's weird because I fetched the branch just an hour ago...

@fjmolinas
Copy link
Contributor

@fjmolinas fjmolinas force-pushed the pr/riotctrl/11-lorawan branch from 9e2fb6d to b1e85cb 38 minutes ago

Yes, they were. According to that, it was pushed from "9e2fb6d". This is the HEAD in #201 (comment)

Well... then I do not understand what happened...

@fjmolinas
Copy link
Contributor

@fjmolinas fjmolinas force-pushed the pr/riotctrl/11-lorawan branch from 9e2fb6d to b1e85cb 38 minutes ago

Yes, they were. According to that, it was pushed from "9e2fb6d". This is the HEAD in #201 (comment)

Well... then I do not understand what happened...

But sorry for overstepping then.

@jia200x
Copy link
Member Author

jia200x commented Apr 26, 2021

But sorry for overstepping then.

No problem! I think it was a GH issue.
Anyway, let's take your approach. I find it cleaner.

I will simply squash then

@jia200x jia200x force-pushed the pr/riotctrl/11-lorawan branch from 17a0cb1 to 383ac0e Compare April 26, 2021 17:39
@jia200x
Copy link
Member Author

jia200x commented Apr 26, 2021

done!

@fjmolinas
Copy link
Contributor

@jia200x do we need to set environment variables for the GitHub actions to lunch this properly?

@fjmolinas
Copy link
Contributor

@jia200x do you think you could setup a README for this as well? For what needs to be setup for me to run this locally?

@jia200x
Copy link
Member Author

jia200x commented Apr 27, 2021

I pushed some commits that depend on #216. Using the new .devdata.env file:

tox -- -k "spec11" --non-RC

11-lorawan/test_spec11.py::test_task05[nodes0-otaa] PASSED                                                                                                                                   [ 50%]
11-lorawan/test_spec11.py::test_task06[nodes0-abp] PASSED                                                                                                                                    [100%]

RIOTBASE and friends are read now from the env file.

@fjmolinas
Copy link
Contributor

I pushed some commits that depend on #216. Using the new .devdata.env file:

tox -- -k "spec11" --non-RC

11-lorawan/test_spec11.py::test_task05[nodes0-otaa] PASSED                                                                                                                                   [ 50%]
11-lorawan/test_spec11.py::test_task06[nodes0-abp] PASSED                                                                                                                                    [100%]

RIOTBASE and friends are read now from the env file.

Either you did not push, or github is acting funny again.

@fjmolinas
Copy link
Contributor

I pushed some commits that depend on #216. Using the new .devdata.env file:

tox -- -k "spec11" --non-RC

11-lorawan/test_spec11.py::test_task05[nodes0-otaa] PASSED                                                                                                                                   [ 50%]
11-lorawan/test_spec11.py::test_task06[nodes0-abp] PASSED                                                                                                                                    [100%]

RIOTBASE and friends are read now from the env file.

Won't we need to change the gitub actions with this?

@jia200x
Copy link
Member Author

jia200x commented Apr 27, 2021

I think GH is acting funny again :(

commit deb67ee0da0de8f39f9057fcea17a68f7dd9b447 (HEAD -> pr/riotctrl/11-lorawan, origin/pr/riotctrl/11-lorawan)
Author: Jose Alamos <[email protected]>
Date:   Tue Apr 27 14:31:58 2021 +0200

    fixup! pytest/conftest: add fixtures for GNRC LoRaWAN tests

@jia200x
Copy link
Member Author

jia200x commented Apr 27, 2021

Won't we need to change the gitub actions with this?

We shouldn't, since GH actions doesn't pass the environment variables using this file

@jia200x jia200x closed this Apr 27, 2021
@jia200x jia200x deleted the pr/riotctrl/11-lorawan branch April 27, 2021 15:40
Jnae pushed a commit to Jnae/RIOT that referenced this pull request May 8, 2021
This commit injects some LoRaWAN secrets into `tox` in order to avoid
exposing LoRaWAN keys when running RIOT-OS/Release-Specs#201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants