Commit Graph

4 Commits (10d97e151fbab0c8d06be441cdc8c2e121bca65d)

Author SHA1 Message Date
John Safranek 46795b1ef2 tests: cover the app-driven sftp and shell paths
The -A cases in scp.test reach the exec callback and the scp handoff.
These drive the rest: the subsystem callback with the sftp accept, the
shell callback in echo mode, and both accepts on a blocking server.

- sftp.test connects to an -A server blocking and non-blocking
- sshclient.test runs a terminal session and a command session against
  an -A server
- scp.test copies from a blocking -A server, where wolfSSH_SCP_accept()
  completes in one call rather than through the retry loop
2026-09-15 09:31:16 -07:00
John Safranek 50ce6135f7 Quote the client test's paths and use printf for escapes
The paths are built from pwd, so an unquoted use split on a build
directory with a space in it, and the cleanup's rm -rf then deleted
whatever the first word named.

- Quote work_dir and every path derived from it
- Pass the directory to rm after --
- Replace the two echo -e calls, dash prints a literal -e
2026-08-26 16:53:23 -05:00
John Safranek abf8c206a6 Skip the client app test in a forced non-blocking build
The echoserver needs -N under WOLFSSH_TEST_BLOCK, and even with it leaves
a failed write queued while it waits on the peer, so a session stalls.
scp.test and get-put.test skip the build too.
2026-08-26 16:53:23 -05:00
John Safranek 23899eda85 Build and test the wolfssh client app in CI
- --enable-sshclient defaults to no, so the app was built only by the
  configs that use --enable-all, and never under the multi-compiler
  warning flags. Add it to the multi-compiler matrix.
- Add scripts/sshclient.test, run by make check. It covers the client's
  sessions and the -E log file against the echoserver.
- The script is not gated on BUILD_SSHCLIENT. It exits 77 when the
  client app or the echoserver isn't there, so every build runs it and
  the ones without the app report it as a skip.
- Check the client and the echoserver by asking each for its usage
  message, not by looking for the file. Both are libtool wrapper
  scripts in the build tree, and a wrapper outlives a reconfigure that
  drops the program it wraps, then runs only far enough to say so.
- The echoserver runs in echo mode and the client's stdin comes from a
  fifo written a piece at a time, so the session carries data and ends
  on its own. Each client run has a watchdog.
- Rename sshd-test.yml's job to cover both apps. That workflow builds
  the client app along with wolfsshd.
- Check that the command reaches the server, now that the client sends
  it rather than discarding it.
- Make the SINGLE_THREADED guard a preprocessor #error. The runtime
  err_sys() only caught the misconfiguration in an autotools build that
  got as far as running; the #error catches it at compile time for the
  IDE and plain Makefile builds too.
- Treat WS_WANT_READ and WS_WANT_WRITE out of wolfSSH_worker() as a
  clean shutdown. The socket is non-blocking, so the peer having
  nothing ready is not a session failure.
2026-08-26 16:53:23 -05:00