Skip to content

Add TCP transport E2E tests for device-profiler #367

@groupsky

Description

@groupsky

Description

Add E2E test coverage for device-profiler TCP transport mode.

Context

PR #366 adds comprehensive E2E tests for device-profiler but only covers serial RTU transport. The device-profiler supports TCP transport via --port host:port format, but this is currently untested in E2E.

Test Scenarios

TCP Connection

  • Start TCP-based emulator (or use netcat/socat TCP bridge)
  • Run profiler with TCP address format
ya-modbus-profile --port localhost:5020 --slave-id 1 --type holding --start 0 --end 10
  • Verify successful register scanning over TCP

TCP Port Validation

  • Test valid port numbers (1-65535)
  • Test invalid port numbers (0, 65536, negative)
  • Test invalid format (missing colon, missing port, etc.)

TCP-Specific Errors

  • Connection refused (no server listening)
  • Connection timeout
  • Host not found

Implementation

Add tests to tests/e2e/tests/05-device-profiler.bats:

Acceptance Criteria

  • TCP connection test passes
  • TCP port validation tests pass
  • TCP error scenarios handled gracefully
  • Tests use existing fixtures/helpers
  • Tests clean up resources in teardown

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:lowLow priority taskscope:device-profilerIssues related to the device-profiler packagescope:testingIssues related to testing infrastructuretestingTesting improvements and additionstype:testingTesting improvements or additions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions