test(plugins): add parser unit tests for scapy_recon plugin (#1431)#1710
Open
Khanvilkarshravani27 wants to merge 2 commits into
Open
test(plugins): add parser unit tests for scapy_recon plugin (#1431)#1710Khanvilkarshravani27 wants to merge 2 commits into
Khanvilkarshravani27 wants to merge 2 commits into
Conversation
utksh1
requested changes
Jul 7, 2026
utksh1
left a comment
Owner
There was a problem hiding this comment.
Some of the scapy_recon parser tests are useful, but this PR is too bloated and mixes in unrelated parser_sandbox changes.\n\n1. Remove the unrelated backend/sandbox changes.\n2. Trim the test suite to the meaningful parser regression cases instead of large volumes of repetitive shape assertions.\n3. Keep the PR focused on the parser behavior only.\n\nPlease resubmit a smaller, more targeted test PR.
6e64234 to
ff9e761
Compare
Collaborator
Author
|
Hi @utksh1, Thanks for the feedback — all points are now addressed:
Let me know if you'd like any further changes. |
Cover the scapy_recon plugin parser.py with targeted behavioural tests: - Metadata contract: file existence, valid JSON, required fields, engine binary, target/type field declarations - ARP output: host count, IP+MAC extraction, finding keys, category, severity, description content, metadata consistency, remediation - ICMP output: host count, IP extraction, Unknown-MAC default - Single-host edge case: IP+MAC in result and description - Malformed/empty input: empty string, whitespace-only, no UP: lines, mixed noise lines, malformed UP: lines, missing MAC separator No changes to backend source; test file only.
665225c to
7e6f02f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a dedicated parser unit test suite for the
scapy_reconplugin to protect parser behaviour from regressions.The new test file (
testing/backend/test_scapy_recon_parser.py) includes 38 tests that cover:metadata.jsonstructure, required fields, engine binary, and output parser type."Unknown".Related Issues
Closes #1431
Type of Change
How Has This Been Tested?
Ran the test suite locally using pytest to ensure all new and existing tests pass:
Checklist