No unit tests for transport modules (TCP, SSH, TLS) #55
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The following transport modules have no dedicated unit tests:
src/shared/transport_tcp.c— TCP socket creation, binding, accepting, connecting, cleanupsrc/shared/transport_ssh.c— SSH destination parsing, socketpair, fork/exec of sshsrc/shared/transport_tls.c— SSL context creation, certificate loading, TLS handshakeThese modules contain complex logic (network I/O, forking, SSL) that would benefit from testing. The lack of tests means regressions in connectivity or security setup may go undetected.
Location
src/shared/transport_tcp.c,src/shared/transport_ssh.c,src/shared/transport_tls.cSuggested Fix
Add unit tests for at least:
transport_tcp.c:server_create()validation,client_create()validation, boundary casestransport_ssh.c:parse_remote_dest()for valid/invalid SSH destinations, edge casestransport_tls.c: SSL context creation with valid/invalid certificates (can use self-signed test certs)For SSH and TLS, consider mocking the network layer or using loopback/localhost tests that don't require external dependencies.
Severity
Medium
Category
Quality