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 P5] fake iwinfo and wireless tests #566

Merged
merged 2 commits into from Sep 2, 2019

Conversation

@spiccinini
Copy link
Contributor

commented Aug 24, 2019

Should be applied after P4 (#565 ).
Hint: easer review doing commit by commit.

spiccinini added 2 commits Aug 22, 2019
testing: add fake iwinfo lib with many testing helpers
The methods implemented are: scanlist, channel, assoclist, hwmodelist.
Also helper functions inside iwinfo.fake like iwinfo.fake.load_from_uci
are provided for testing purposes. Refer to tests/test_iwinfo.lua for
usage examples.lua for usage examples.
@@ -111,8 +111,10 @@ function network.setup_rp_filter()

sysctl_options = sysctl_options .. "net.ipv4.conf.default.rp_filter=2\nnet.ipv4.conf.all.rp_filter=2\n";
sysctl_file = io.open(sysctl_file_path, "w");
sysctl_file:write(sysctl_options);
sysctl_file:close();
if sysctl_file ~= nil then

This comment has been minimized.

Copy link
@nicopace

nicopace Aug 25, 2019

Member

Shouldn't it do something if the file doesn't exist? like notify or something?

This comment has been minimized.

Copy link
@spiccinini

spiccinini Aug 25, 2019

Author Contributor

I wrote it this way because I think that this should only happen inside the unit testing environment (not having permissions to write to /etc) and we don't want to get a notification in this case. I can add a comment to clarify the intention as I think like you that it is unexpected to read that without an error report.

This comment has been minimized.

Copy link
@nicopace

nicopace Aug 25, 2019

Member

The if statement looks a little strange, that's all.

packages/lime-system/tests/test_lime_network.lua Outdated Show resolved Hide resolved
test_utils.enable_asserts()

assert.is.equal("1500", uci:get("network", "lan", "mtu"))
assert.is.equal("static", uci:get("network", "lan", "proto"))

This comment has been minimized.

Copy link
@nicopace

nicopace Aug 25, 2019

Member

Is this a default value? it is not self-documented, at least for me...

This comment has been minimized.

Copy link
@spiccinini

spiccinini Sep 2, 2019

Author Contributor

Yes, it is the default, also not documented.

@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 588a567 into libremesh:master Sep 2, 2019

1 check passed

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