wolfssh/apps/wolfsshd/test
John Safranek 4ca96ec6cb wolfsshd: name the large SFTP files per run
sshd_large_sftp_test.sh puts its pid in both the local and the remote
file name, and removes them from an EXIT trap.

- the remote name was fixed in the daemon user's home, one directory
  for the whole host, so two runs uploaded to the same path and each
  compared its own file against the other's upload
- 4.4G apiece, and the transfer runs under "set -e", so a failed run
  left both behind
2026-09-17 15:04:26 +02:00
..
README.md
create_authorized_test_file.sh
create_sshd_config.sh wolfsshd: scope a test run's ports and daemons 2026-09-17 15:04:26 +02:00
error_return.sh tests: save sshd test scripts' dir in TESTDIR 2026-08-20 10:28:20 -07:00
port_lease.sh wolfsshd: lease a port block to one run only 2026-09-17 15:04:26 +02:00
run_all_sshd_tests.sh wolfsshd: remove the temp config dir on exit 2026-09-17 15:04:26 +02:00
ssh_kex_algos.sh Use wolfssh-options in the test scripts 2026-08-19 16:55:00 -07:00
sshd_bad_sftp_test.sh tests: save sshd test scripts' dir in TESTDIR 2026-08-20 10:28:20 -07:00
sshd_bad_subsystem_test.sh wolfsshd: refuse sessions it cannot serve 2026-09-15 21:55:50 -07:00
sshd_dash_d_test.ps1 wolfsshd: Cover -D option parsing on Windows in CI 2026-09-10 15:27:50 -07:00
sshd_empty_password_test.sh Use wolfssh-options in the test scripts 2026-08-19 16:55:00 -07:00
sshd_exec_test.sh tests: save sshd test scripts' dir in TESTDIR 2026-08-20 10:28:20 -07:00
sshd_forcedcmd_test.sh tests: guard stop_wolfsshd so it cannot fail its caller 2026-08-20 10:28:20 -07:00
sshd_large_sftp_test.sh wolfsshd: name the large SFTP files per run 2026-09-17 15:04:26 +02:00
sshd_login_grace_test.ps1 Enforce LoginGraceTime in wolfsshd on Windows and make the grace flag per-connection 2026-07-07 12:43:08 -05:00
sshd_login_grace_test.sh Enforce LoginGraceTime in wolfsshd on Windows and make the grace flag per-connection 2026-07-07 12:43:08 -05:00
sshd_match_overlap_test.sh Compose sshd_config Match blocks per keyword 2026-08-25 14:30:39 -06:00
sshd_mldsa_composite_test.sh Add remaining ML-DSA composite signature algorithms 2026-08-10 14:51:37 -07:00
sshd_ossh_cert_test.sh wolfsshd: issue the test certificates per run 2026-09-17 15:04:26 +02:00
sshd_permitroot_forced_cmd.sh F-6700: Add PermitRootLogin prohibit-password and forced-commands-only modes 2026-07-31 15:44:47 -07:00
sshd_permitroot_prohibit_password.sh F-6700: Add PermitRootLogin prohibit-password and forced-commands-only modes 2026-07-31 15:44:47 -07:00
sshd_permitroot_test.sh Gate wolfsshd PermitRootLogin on resolved UID 0 2026-07-21 12:26:48 -05:00
sshd_port_lease_test.sh wolfsshd: test the port block allocator 2026-09-17 15:04:26 +02:00
sshd_privdrop_fail_test.sh wolfsshd: tighten the run registry and ports 2026-09-17 15:04:26 +02:00
sshd_privdrop_preload.c wolfsshd: fail closed when a per-connection privilege drop fails 2026-07-20 19:07:27 -05:00
sshd_scp_fail.sh tests: save sshd test scripts' dir in TESTDIR 2026-08-20 10:28:20 -07:00
sshd_sftp_idle_cpu_test.sh tests: pick the sshd child that arrived 2026-09-03 11:29:54 -05:00
sshd_stdin_eof_test.sh Handle the EOF status in apps and examples 2026-08-31 11:53:29 -05:00
sshd_stdin_stall_test.sh Tighten the stdin-stall bound 2026-08-31 11:53:29 -05:00
sshd_term_close_test.sh Fix sshd test flakiness and orphan daemon 2026-06-15 22:05:50 -07:00
sshd_term_size_test.sh wolfsshd: name the tmux session per test run 2026-09-17 15:04:26 +02:00
sshd_window_full_test.sh
sshd_x509_test.sh CI: add code coverage workflow, misc script updates 2026-08-21 11:30:40 -07:00
sshd_x509_upn_fail.sh CI: add code coverage workflow, misc script updates 2026-08-21 11:30:40 -07:00
start_sshd.sh wolfsshd: keep the registry when grep fails 2026-09-17 15:04:26 +02:00
test_configuration.c use wolfSSH_ prefix on wolfSSH specific config's HostKeyStore, HostKeyStoreSubject, HostKeyStoreFlags 2026-09-05 01:32:02 -07:00
wolfssh_options.sh Use wolfssh-options in the test scripts 2026-08-19 16:55:00 -07:00

README.md

wolfSSHd Tests

These are separate from the tests in scripts directory because of the need for 'sudo' when starting up an SSHd server to test against.

Running Tests

To run all tests do:

$ cd apps/wolfsshd/test/

$ sudo ./run_all_sshd_tests.sh <user>
Running all wolfSSHd tests
Starting up local wolfSSHd for tests on 127.0.0.1:22222
SSHD running on PID 7979
sshd_exec_test.sh ... PASSED
Shutting down test wolfSSHd
Stopping SSHD, killing pid 7979
All tests ran, 1 passed, 0 skipped

To run a specific test do:

startup wolfSSHd

$ cd ./apps/wolfsshd

$ sudo ./wolfsshd -D -d -f ./test/sshd_config_test
[PID 8049]: [SSHD] parsing config file ./test/sshd_config_test
[PID 8049]: [SSHD] Setting login grace time to 600
[PID 8049]: [SSHD] Turning off privilege separation!
[PID 8049]: [SSHD] Starting wolfSSH SSHD application
[PID 8049]: Entering wolfSSH_CTX_new()
[PID 8049]: Entering CtxInit()
[PID 8049]: Leaving wolfSSH_CTX_new(), ctx = 0x5574747f3520
[PID 8049]: Entering wolfSSH_CTX_SetBanner()
[PID 8049]:   setting banner to: "wolfSSHD
"
...
...
...

point the test to the host/port if needed

$ cd ./apps/wolfsshd/test

$ ./sshd_exec_test.sh 127.0.0.1 22222

Adding Tests

New tests should be added to a new .sh file if not related to any of the existing tests. The test should then be called from run_all_sshd_tests.sh once added, for example:

run_test "new_test.sh"

This would be added before the call to stop the SSHd server stop_wolfsshd and after the test files have been setup:

 48 # setup
 49 set -e
 50 ./create_authorized_test_file.sh
 51 ./create_sshd_config.sh
 52 set +e