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

[Unittesting P4] tests #565

merged 14 commits into from Sep 2, 2019


Copy link

commented Aug 24, 2019

This adds testing and utilities/helpers. As like all the unittesting patch series this changes should not change actual behaviour.

Should be applied after P3 (#564 ).
Hint: easer review doing commit by commit.

spiccinini added 14 commits Aug 22, 2019
lime.config: add config.get_uci_cursor and set_uci_cursor
Sets and returns a uci context.
All calls to libuci:cursor() must be replaced with get_uci_cursor
in order to allow the code to be tested in unittests.
testing: add setup_test_uci and teardown_test_uci
This methods must be used to create a clean uci environment for
each test. The uci environment is created in a temporary directory
in /tmp and empty config files are created. To delete this environment
teardown_test_uci must be called after each test.
lime.config: use config.log instead of print
So it can be turned off inside unittests.
lime.utils: add getBoardAsTable() returning a lua map of board.json
getBoardAsTable returns /etc/board.json by default but it for testing
it can be modified changing utils.BOARD_JSON_PATH or even

@spiccinini spiccinini changed the base branch from master to fix/bat-hosts Sep 2, 2019

@spiccinini spiccinini changed the base branch from fix/bat-hosts to master Sep 2, 2019

@gmarcos87 gmarcos87 self-requested a review Sep 2, 2019

@gmarcos87 gmarcos87 merged commit 2d65a76 into libremesh:master Sep 2, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.