wolfssh/apps/wolfsshd/test
Andrew Hutchings a9c7ebc36d Fix SCP server side
SCP on the server side would get an EAGAIN around the 128KB mark, which
would trigger an error. That error in-turn would cause two attempts to
close the file, which would segfault.

Also fix inverted error return status on scpclient.
2025-02-19 11:13:42 +00:00
..
README.md add test case 2024-08-05 13:31:47 -06:00
create_authorized_test_file.sh
create_sshd_config.sh add additional x509 connection test 2024-01-26 14:01:11 -07:00
error_return.sh fix return value for test shell scripts 2024-01-29 16:40:35 -07:00
run_all_sshd_tests.sh Fix SCP server side 2025-02-19 11:13:42 +00:00
ssh_kex_algos.sh add debug print out with test case 2025-01-30 17:42:44 -07:00
sshd_bad_sftp_test.sh keep trailing delimiter with SFTP open 2024-10-04 14:59:40 -06:00
sshd_exec_test.sh fix return value for test shell scripts 2024-01-29 16:40:35 -07:00
sshd_forcedcmd_test.sh test setting different wolfssl version for test 2024-10-11 16:23:20 -06:00
sshd_large_sftp_test.sh add large sftp file transfer test case 2024-02-15 09:32:58 -07:00
sshd_login_grace_test.sh print out log on fail and remove print out from alarm 2024-01-19 09:22:13 -07:00
sshd_scp_fail.sh Fix SCP server side 2025-02-19 11:13:42 +00:00
sshd_term_close_test.sh add regression test for closing down child on SSH connection issue 2024-11-26 12:01:23 -07:00
sshd_term_size_test.sh test setting different wolfssl version for test 2024-10-11 16:23:20 -06:00
sshd_window_full_test.sh test setting different wolfssl version for test 2024-10-11 16:23:20 -06:00
sshd_x509_test.sh test setting different wolfssl version for test 2024-10-11 16:23:20 -06:00
start_sshd.sh
test_configuration.c All the filesystem-related W* macros accept a filesystem context pointer as first parameter, to make portability better. 2023-07-21 11:53:40 +02:00

README.md

wolfSSHd Tests

These are seprate 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