• src/ssh/test/mock_io.c mo

    From Deuc¿@VERT to Git commit to main/sbbs/m on Monday, March 23, 2026 20:49:00
    https://gitlab.synchro.net/main/sbbs/-/commit/23dfeca99d7c104ccbc3af28
    Modified Files:
    src/ssh/test/mock_io.c mock_io.h test_conn.c
    Log Message:
    Rewrite mock I/O to socketpair(); add 19 conn edge case tests

    Replace circular buffer + condvar mock I/O with Unix socketpair().
    Blocking read/write with natural close-unblocks-peer behavior
    eliminates timed waits and condvar signaling complexity.

    Fix conn_cleanup to close pipes before dssh_session_stop() Ä with
    socketpair I/O, condvar broadcasts cannot unblock a blocking read();
    only closing the peer fd does. Fixes hangs in test_session_stop and test_session_start_twice.

    New test coverage (88 conn tests, up from 69):
    - Session poll WRITE readiness and timeout=0 for all event types
    - Session write/write_ext after EOF, window=0, max_packet clamping
    - Raw channel write after close, write TOOLONG
    - Raw channel poll WRITE and timeout=0
    - dssh_channel_accept_raw path
    - Reject with long description (truncation)
    - Signal interleave clamping (stdout and stderr readable limits)
    - dssh_session_read_signal when no signal pending
    - Accept with negative timeout (blocking, unblocked by terminate)
    - Demux parse errors: short payload, truncated CHANNEL_OPEN,
    truncated CHANNEL_REQUEST

    ssh-conn.c branch coverage: 64.71%  72.79% (544 branches)

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Wednesday, March 25, 2026 00:49:00
    https://gitlab.synchro.net/main/sbbs/-/commit/acc4d3d556c46a87e0dff7fa
    Modified Files:
    src/ssh/test/mock_io.c mock_io.h test_auth.c
    Log Message:
    ssh-auth.c coverage: fix test infra bugs, 12 new tests (86%  95%)

    Fixed two infrastructure bugs that were silently breaking many tests:

    1. direct_server_test() closed both ends of c2s pipe before calling
    auth_server_impl(), so the server could never read injected messages.
    Fix: close only the write end (new mock_io_close_c2s_write()).

    2. dclient tests where the client callback succeeded would hang because
    the server thread exited without closing s2c, leaving the client
    blocked on recv. Fix: close_s2c flag on dclient_server_arg.

    New tests: bad_prefix_in_loop, changereq_alloc, pk_ok_alloc, pk_sig_unknown_algo, pk_verify_alloc, get_methods_malloc, get_methods_trunc_payload, get_methods_ctrl_char,
    changereq_lang_overflow, get_methods_unexpected,
    get_methods_msg_alloc, changereq_prompt_overflow.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net