Skip to content

Commit f5da31b

Browse files
ejohnstownphilljj
authored andcommitted
tests: make every sshd test selectable
run_all_sshd_tests.sh validates --match and --exclude against test_cases plus a new extra_test_cases naming the tests called in place, and every call goes through one should_skip(). A match runs its test where it sits, with the daemon it needs around it, so one path now serves the whole suite. test_cases named 12 of the 32 tests the runner drives. - gate the x509, UPN and ML-DSA daemon starts on the match, so selecting another test does not start them - take the bulk skip for the tests needing a local daemon only on a full run, where its fixed count is right - reject an unrecognized --exclude, and a --match that reached no call site: a local-only name selects nothing against an external host, which would otherwise exit 0 having run no test at all - keep every test call inside one compound, so RUN_COMPLETE still fails a run that a shell expansion error cut short, and abort naming any run_test call listed in neither array - verified in the container: a full run gives 32 run, 30 passed, 2 skipped, and --match sshd_chroot_fail_test.sh gives 1 run, 1 passed, starting only the daemon that test needs
1 parent 7e41ce2 commit f5da31b

2 files changed

Lines changed: 235 additions & 115 deletions

File tree

‎apps/wolfsshd/test/README.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,20 @@ after the test files have been setup:
8080
52 set +e
8181
```
8282

83+
The name also has to be listed in one of the two arrays at the top of
84+
run_all_sshd_tests.sh, or the run aborts with an error naming it. Use
85+
`test_cases` if the test runs against the shared daemon, in which case the loop
86+
over that array calls it and nothing else is needed. Use `extra_test_cases` if
87+
the test needs setup of its own -- a different daemon config, its own daemon, or
88+
the shared daemon stopped first -- and keep the `run_test` call where that setup
89+
happens. Both arrays drive `--match` and `--exclude`, so a test that is missing
90+
from them cannot be selected or skipped from the command line.
91+
92+
## Selecting Tests
93+
94+
`--match <name>` runs a single test and `--exclude <name>` drops one from a full
95+
run. Both take any name from the list the runner prints when it is given a name or an
96+
option it does not recognize, and an unrecognized name is an error rather than a
97+
silent no-op. `--match` runs the test where it sits in the suite, with the
98+
daemon it needs set up around it.
99+

0 commit comments

Comments
 (0)