These 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.
transport_ssh.c: parse_remote_dest() for valid/invalid SSH destinations, edge cases
transport_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
## Description
The following transport modules have no dedicated unit tests:
- `src/shared/transport_tcp.c` — TCP socket creation, binding, accepting, connecting, cleanup
- `src/shared/transport_ssh.c` — SSH destination parsing, socketpair, fork/exec of ssh
- `src/shared/transport_tls.c` — SSL context creation, certificate loading, TLS handshake
These 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.c`
## Suggested Fix
Add unit tests for at least:
1. `transport_tcp.c`: `server_create()` validation, `client_create()` validation, boundary cases
2. `transport_ssh.c`: `parse_remote_dest()` for valid/invalid SSH destinations, edge cases
3. `transport_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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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