Skip to content

Comments

Cleanup Network Tests and Network Test Module#565

Merged
pisuke merged 27 commits intofaucetsdn:masterfrom
noursaidi:issue516-network-test
Aug 4, 2020
Merged

Cleanup Network Tests and Network Test Module#565
pisuke merged 27 commits intofaucetsdn:masterfrom
noursaidi:issue516-network-test

Conversation

@noursaidi
Copy link
Collaborator

PR to clean up the network tests and network test module. Summary of changes:

  • Remove depreciated code from current network module
  • Merged pull request Issue337 multicastnetworktest #505 (multicast network test)
  • Re-added network module into Travis CI test.
    • the min_send test always passes and the info_broadcast always the same message for now. I'm not sure if it's possible to test fail/skip as any network traffic from the faux device triggers a pass.
  • Remove NTP test module and subset/ntp combined into existing network module
  • Remove mac_oui test module and subset/connection directory, combined into existing network module

@noursaidi noursaidi requested review from grafnu and pisuke July 29, 2020 23:48
RUN $AG update && $AG install -y telnetd && $AG install xinetd nginx

COPY subset/ntp/NTPClient NTPClient
COPY subset/network/NTPClient NTPClient
Copy link
Collaborator

Choose a reason for hiding this comment

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

this shouldn't still be in subset/ -- it should be moved to docker/include/network

there should be no dependency on the subset/ folder from faux

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@grafnu I was planning to address the dependancy as a separate PR as it involved other test modules too. I'll update to pick up the network module changes here

interfaces:
faux-1:
opts: brute broadcast_client ntpv4
opts: brute broadcast_client ntpv4 arp
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this enabled for everything? Whatever it's for, that's not the right way... If it's truly always required then it should be the default behavior, otherwise all three of these should not have it (what's the point?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, that would have been a much better, thanks. This is related to the min_send test which always passes, but might have a different summary depending if there are any ARP packets. As there seems to be some chance it might not, this periodically sends ARP packets so the result is always as expected.

@codecov
Copy link

codecov bot commented Jul 30, 2020

Codecov Report

Merging #565 into master will decrease coverage by 0.50%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #565      +/-   ##
==========================================
- Coverage   80.78%   80.28%   -0.51%     
==========================================
  Files          22       22              
  Lines        3753     3753              
==========================================
- Hits         3032     3013      -19     
- Misses        721      740      +19     
Flag Coverage Δ
#aux 73.79% <ø> (ø)
#base 75.25% <ø> (-0.06%) ⬇️
#dhcp 72.12% <ø> (-0.50%) ⬇️
#many 72.04% <ø> (ø)
#modules 23.58% <ø> (ø)
#topo 72.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
daq/gateway.py 90.00% <0.00%> (-4.74%) ⬇️
daq/runner.py 87.05% <0.00%> (-1.69%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e38c4a2...445393d. Read the comment docs.

@noursaidi noursaidi requested a review from grafnu July 30, 2020 09:07
Copy link
Collaborator

@pisuke pisuke left a comment

Choose a reason for hiding this comment

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

All looks good to me, thanks!

bin/bacnet_discover loop &
fi

if [ -n "${options[curl]}" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

curl should still be optional since it's not default behavior for every case

@noursaidi
Copy link
Collaborator Author

Thanks @grafnu for reviewing again, I'd appreciate your input because I'm not sure what the best way to proceed is.

The issue I'm trying to resolve is a an unpredictable result summary in the Travis report output from the general network tests (communication_type and min_send).

From 7 test_aux runs I've done, 2 have failed . One was due to one faux device not sending ARP packets, the other not sending unicast packets. This respective changed the report summary by omitting a few words. I may be wrong, but I don't think this can be predicted.

Therefore I think 'arpsend' and 'curl' (or alternative to send a data packet) is needed as default behavior for test_aux only, but not for the faux devices generally, to ensure predictable behavior.

Alternatively, as these tests rely on reading monitor.pcap, For 2/3 of the faux devices I could add pre-prepared packet capture files and configure the test module to read that instead of the actual monitor scan. That way can at least have some test of skip/fail conditions. The test would still run normally on one of the faux devices. Not ideal, might be better than three tests with the same result.

Do you think there is a better way?

@pisuke
Copy link
Collaborator

pisuke commented Aug 3, 2020

@grafnu does @noursaidi 's suggestion sound good in the short term to get this PR merged?

@noursaidi
Copy link
Collaborator Author

@pisuke @grafnu I was thinking that instead I could add a configuration to enable/disable the sub tests from module_config, and disable the problematic general network tests in the Travis CI tests. This means the coverage of testing in Travis CI remains identical after this PR as it did before.

I do think it is important to have proper coverage of all test, and then this can be discussed and addressed properly in a separate issue/PR rather.

@grafnu
Copy link
Collaborator

grafnu commented Aug 3, 2020 via email

@noursaidi
Copy link
Collaborator Author

Really appreciate your thoughts and feedback @grafnu, thanks. I've restored curl and made xarp an option as as suggested.

Here is a run of 12 test_aux runs, passes 11. https://travis-ci.com/github/noursaidi/daq/builds/178423661.

'curl' default was overkill, only faux-3 needed something to periodically send data. The other 2 had NTP which satisfies this.

@noursaidi noursaidi requested a review from grafnu August 4, 2020 17:29
if [ -n "${options[curl]}" ]; then
echo Starting curl loop.
(while true; do curl -o - http://google.com; sleep 1; done) &
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: blank line after this block

@grafnu
Copy link
Collaborator

grafnu commented Aug 4, 2020 via email

@grafnu grafnu self-assigned this Aug 4, 2020
@pisuke pisuke merged commit 4886fec into faucetsdn:master Aug 4, 2020
frgitdaq pushed a commit to frgitdaq/daq that referenced this pull request Aug 10, 2020
* removed depreciated code and moved ntp and macoui tests into network module
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.

3 participants