Skip to content

[TEST] Add parser unit tests for scapy_recon plugin malformed and edge-case output #2007

Description

@Nitanshu715

Summary

The scapy_recon plugin parses live host discovery output but has no dedicated
parser test file covering malformed or edge-case input. Issue #1431 tracks this
but has had no linked PR for 12+ days.

Problem

plugins/scapy_recon/parser.py has no test coverage for:

  • Empty output (no hosts discovered)
  • Malformed/partial lines
  • Mixed stdout with irrelevant noise
  • Output with unusual whitespace or encoding

Without these tests, silent regressions in the parser can go undetected.

Proposed Fix

Add testing/unit/plugins/test_scapy_recon_parser.py covering:

  • Normal output with one or more live hosts
  • Empty string input
  • Completely malformed input
  • Lines with missing fields
  • Parser does not raise exceptions on any input

Acceptance Criteria

  • All edge-case inputs return a list (never crash)
  • Findings from valid output are correctly structured
  • Tests run with pytest in under 1 second (no real network calls)

Self-assignment

I'd like to work on this. Can I get assigned? @utksh1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions