Skip to content

test(plugins): add parser unit tests for scapy_recon plugin (#1431)#1710

Open
Khanvilkarshravani27 wants to merge 2 commits into
utksh1:mainfrom
Khanvilkarshravani27:add-scapy-recon-parser-tests
Open

test(plugins): add parser unit tests for scapy_recon plugin (#1431)#1710
Khanvilkarshravani27 wants to merge 2 commits into
utksh1:mainfrom
Khanvilkarshravani27:add-scapy-recon-parser-tests

Conversation

@Khanvilkarshravani27

Copy link
Copy Markdown

Description

Adds a dedicated parser unit test suite for the scapy_recon plugin to protect parser behaviour from regressions.

The new test file (testing/backend/test_scapy_recon_parser.py) includes 38 tests that cover:

  • Metadata contract: Validates metadata.json structure, required fields, engine binary, and output parser type.
  • Normal ARP output: Verifies correct IP + MAC extraction, finding keys, category, severity, description, and remediation.
  • ICMP output: Verifies hosts with no MAC address default to "Unknown".
  • Edge cases: Ensures the parser handles single hosts, empty inputs, whitespace-only, malformed strings, mixed valid/noise lines, and large subnet outputs (50 hosts) without crashing.

Related Issues

Closes #1431

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Testing (Adds missing parser test coverage for an existing plugin)

How Has This Been Tested?

Ran the test suite locally using pytest to ensure all new and existing tests pass:

python -m pytest testing/backend/test_scapy_recon_parser.py -v --noconftest

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

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.

[PLUGINS] Add parser unit tests for scapy_recon plugin

1 participant