Skip to content

MITM use this library as proxy for tests (initiator ↔ client-rs ↔ target) #36

@Masorubka1

Description

@Masorubka1

MITM proxy for iSCSI tests

Summary: Run existing iSCSI test suites through our library acting as a TCP MITM proxy, to capture/compare PDUs and inject faults.

Why
• Reuse libiscsi/iscsi-test-cu & open-iscsi without patches.
• Capture real PDU streams; reproduce races/edge cases.
• Build “golden traces” vs real targets for regression.

MVP
• TCP proxy (northbound initiator ↔ proxy ↔ southbound target).
• Parse/emit iSCSI PDUs using our types.
• Per-connection maps: ITT bi-map, StatSN generator; adjust ExpStatSN.
• Transparent data path (no re-chunk), ERL=0, single connection.
• Structured JSON logs (+ optional payload redaction).

Rewrite rules (MVP)
• CmdSN/MaxCmdSN/ExpCmdSN: pass-through.
• StatSN (target→init): generated by proxy; update ExpStatSN northbound.
• ITT: stable bi-map proxy⇄real. TTT: pass-through.
• DataSN/BufferOffset: pass-through. Immediate/Final/DataSegLen: pass-through unless faulted.
• Login/Text: forward; log and optionally pin negotiated params (e.g., MRDSL).

Fault hooks (initial)
• Drop/delay/duplicate Data-In/R2T/Responses; toggle Final/Immediate.

Done when
• Basic libiscsi tests run through proxy unmodified.
• Golden trace replay matches (except rewritten fields).
• At least 3 fault cases demonstrably trigger expected failures.

Out of scope (MVP): SNACK/ERL>0, MCS, iSER, CHAP beyond pass-through.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions