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

[filter-fdb] Call Filter FDB Main From Within Test Code #1051

Merged

Conversation

tahmed-dev
Copy link
Contributor

@tahmed-dev tahmed-dev commented Aug 13, 2020

Code coverage requires that python code be run with the same process.
Current test code was invoking filter fdb via shell which launches
new process and so coverage is not available. This PR calls
the main method from within test code.

signed-off-by: Tamer Ahmed tamer.ahmed@microsoft.com

- What I did
Change how main function is invoked

- How I did it
code refactor

- How to verify it
unit test passes

- Previous command output (if the output of a command-line utility has changed)
N/A
- New command output (if the output of a command-line utility has changed)
N/A

Code coverage requires that python code be run with the same process.
Current test code was invoking filter fdb via shell which launches
new process and so coverage is not available. This PR calles
the main method from within test code.

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
@lguohan
Copy link
Contributor

lguohan commented Aug 13, 2020

can you fix the build error?

@lguohan
Copy link
Contributor

lguohan commented Aug 13, 2020

in this case, it probably better to move this script as a console script.

check out here. https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html

@tahmed-dev tahmed-dev force-pushed the taahme/filter-fdb-call-script-from-test branch from ea01c88 to 6d507f5 Compare August 14, 2020 21:47
@lgtm-com
Copy link

lgtm-com bot commented Aug 14, 2020

This pull request introduces 4 alerts when merging ede5e98 into a15b6bf - view on LGTM.com

new alerts:

  • 2 for Unused local variable
  • 1 for Unreachable 'except' block
  • 1 for Unused import

@lguohan
Copy link
Contributor

lguohan commented Aug 14, 2020

looks like build failure.

@lgtm-com
Copy link

lgtm-com bot commented Aug 15, 2020

This pull request introduces 1 alert when merging 5a77fca93fc2671f01da4a8767caf8e94e9d5937 into 37f131e - view on LGTM.com

new alerts:

  • 1 for Unused import

@tahmed-dev tahmed-dev force-pushed the taahme/filter-fdb-call-script-from-test branch from 5a77fca to 3a00245 Compare August 15, 2020 01:12
@lguohan lguohan merged commit 8768580 into sonic-net:master Aug 15, 2020
tahmed-dev added a commit to tahmed-dev/sonic-utilities that referenced this pull request Sep 1, 2020
Code coverage requires that python code be run with the same process.
Current test code was invoking filter fdb via shell which launches
new process and so coverage is not available. This PR calls
the main method from within test code.

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
yxieca pushed a commit that referenced this pull request Sep 3, 2020
* [filter-fdb] Call Filter FDB Main From Within Test Code (#1051)

Code coverage requires that python code be run with the same process.
Current test code was invoking filter fdb via shell which launches
new process and so coverage is not available. This PR calls
the main method from within test code.

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>

* [filter-fdb] Fix Filter FDB With IPv6 Present in Config DB (#1059)

Filter fdb was wiping out IPv4 entries when both IPv4 and IPv6
are associated with VLan interface. The reason is IPv6 network
was overwriting IPv4 network. This pr add support to filter
both IPv4 and IPv6 addresses

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
abdosi pushed a commit that referenced this pull request Sep 3, 2020
Code coverage requires that python code be run with the same process.
Current test code was invoking filter fdb via shell which launches
new process and so coverage is not available. This PR calls
the main method from within test code.

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants