Skip to content

munet: fix --pcaps=all - #78

Merged
choppsv1 merged 1 commit into
LabNConsulting:mainfrom
liambrady:liambrady/pcap_fix
Oct 9, 2025
Merged

choppsv1 merged 1 commit into
LabNConsulting:mainfrom
liambrady:liambrady/pcap_fix

Conversation

@liambrady

Copy link
Copy Markdown
Contributor

Fix a bug where self.switches.keys() does not have the split() method, and as a result, throws an error when 'all' is passed instead of the specific networks or interfaces.

Note that 'all' will include all networks with this fix but does not start pcaps for specific interfaces. Interfaces must still be specified as NODE:INTF.

Fix a bug where self.switches.keys() does not have the split() method,
and as a result, throws an error when 'all' is passed instead of the
specific networks/interfaces.

Note that 'all' will include all networks, but does not start pcaps for
specific interfaces. Interfaces must still be specified as NODE:INTF.

Signed-off-by: Liam Brady <lbrady@labn.net>
@liambrady
liambrady requested a review from choppsv1 October 8, 2025 19:39
@liambrady liambrady added the bug Something isn't working label Oct 8, 2025
@codecov

codecov Bot commented Oct 8, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.88%. Comparing base (dd8547a) to head (20b4816).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
munet/native.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
- Coverage   59.17%   58.88%   -0.29%     
==========================================
  Files          19       19              
  Lines        5832     5833       +1     
==========================================
- Hits         3451     3435      -16     
- Misses       2381     2398      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread munet/native.py
pcapopt = set(pcapopt.split(",")) if pcapopt else set()
if 'all' in pcapopt:
pcapopt.remove('all')
pcapopt.update(self.switches.keys())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

how about this instead:

if pcapopt == "all":
    pcapopt = self.switches.keys()
else
    pcapopt = [x.strip() for x in pcapopt.split(',')]

for pcap in pcapopt:
    ...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

btw, we should be able to have all the modified lines tested, so 100% not 40% (of patched lines) :)

@choppsv1
choppsv1 merged commit 04ffb73 into LabNConsulting:main Oct 9, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants