Add a build option probe for the test scripts - #1180
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated build-options probe executable (apps/wolfssh-options) and updates multiple test scripts to gate on exact, greppable option tokens (via grep -qx) instead of parsing usage output, config.log, daemon logs, or algorithm lists. This centralizes “what features are enabled” into a single, build-derived source of truth and removes usage/help text that existed solely for script consumption.
Changes:
- Introduces
apps/wolfssh-optionsto print enabled build/feature macros (one per line) for consumption by scripts. - Converts several scripts to use the probe for feature gating (CLIENT/TEST_BLOCK/SYMLINK_CHECK/FPKI/OSSH_CERTS/SFTP/SCP/DEBUG/SSHCLIENT/MLDSA87_ES384, etc.) and adds clean skips where tests previously failed outright when features were absent.
- Removes help/usage text in example programs that was present only to support script grepping.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/sftp.test | Uses apps/wolfssh-options to gate CLIENT and TEST_BLOCK behaviors. |
| scripts/scp.test | Uses apps/wolfssh-options to gate TEST_BLOCK and SYMLINK_CHECK-dependent cases. |
| scripts/get-put.test | Uses apps/wolfssh-options to gate CLIENT and TEST_BLOCK early. |
| scripts/fwd.test | Uses apps/wolfssh-options to gate TEST_BLOCK skip logic. |
| scripts/external.test | Uses apps/wolfssh-options to gate TEST_BLOCK skip logic. |
| examples/client/client.c | Removes usage text used only for script grepping; minor usage formatting. |
| apps/wolfsshd/wolfsshd.c | Removes usage text used only for script grepping; minor usage formatting. |
| apps/wolfsshd/test/sshd_x509_upn_fail.sh | Gates FPKI-dependent test using apps/wolfssh-options. |
| apps/wolfsshd/test/sshd_scp_fail.sh | Adds SCP availability gate/skip using apps/wolfssh-options. |
| apps/wolfsshd/test/sshd_ossh_cert_test.sh | Gates OSSH_CERTS support using apps/wolfssh-options. |
| apps/wolfsshd/test/sshd_large_sftp_test.sh | Adds SFTP availability gate/skip using apps/wolfssh-options. |
| apps/wolfsshd/test/sshd_empty_password_test.sh | Gates password-backend presence using apps/wolfssh-options. |
| apps/wolfsshd/test/sshd_bad_sftp_test.sh | Adds SFTP availability gate/skip using apps/wolfssh-options. |
| apps/wolfsshd/test/ssh_kex_algos.sh | Uses apps/wolfssh-options for SSHCLIENT/DEBUG gating; improves safe printing. |
| apps/wolfsshd/test/run_all_sshd_tests.sh | Adds tree-wide probe caching; gates MLDSA composite test on MLDSA87_ES384. |
| apps/wolfssh-options.c | New probe program emitting enabled build options (one per line). |
| apps/include.am | Builds the new apps/wolfssh-options program in the build tree. |
| .gitignore | Ignores the new apps/wolfssh-options build artifact. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1180
Scan targets checked: wolfssh-bugs, wolfssh-src
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
Test scripts sniff the build by grepping usage text, config.log and daemon logs. This prints the enabled build options for them to check instead.
The scripts now read the build options from the probe instead of grepping usage text, config.log and daemon logs. Drops the usage lines only tests read.
a8a79fa to
fe160ff
Compare
grep -qxinstead of grepping usage text,config.log, daemon logs, or the client's algorithm list.sftp.test,get-put.test,scp.test,fwd.test,external.test,run_all_sshd_tests.sh,ssh_kex_algos.sh,sshd_ossh_cert_test.sh,sshd_x509_upn_fail.sh,sshd_empty_password_test.sh.sshd_bad_sftp_test.sh,sshd_large_sftp_test.shandsshd_scp_fail.shhad no skip and failed outright without SFTP or SCP; they now skip.MLDSA87_ES384, since the ECDSA half can be missing on its own.wolfsshdand the symlink note in the example client.