Skip to content

Add a build option probe for the test scripts - #1180

Merged
padelsbach merged 2 commits into
wolfSSL:masterfrom
ejohnstown:build-options-probe
Aug 19, 2026
Merged

Add a build option probe for the test scripts#1180
padelsbach merged 2 commits into
wolfSSL:masterfrom
ejohnstown:build-options-probe

Conversation

@ejohnstown

Copy link
Copy Markdown
Contributor
  • Test scripts gate on it with grep -qx instead of grepping usage text, config.log, daemon logs, or the client's algorithm list.
  • Converted: 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.sh and sshd_scp_fail.sh had no skip and failed outright without SFTP or SCP; they now skip.
  • ML-DSA gate now checks the composite algorithm MLDSA87_ES384, since the ECDSA half can be missing on its own.
  • Drops the usage lines that existed only for scripts to grep: the FPKI block in wolfsshd and the symlink note in the example client.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-options to 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 wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread apps/wolfssh-options.c
Comment thread apps/wolfssh-options.c
Comment thread apps/wolfsshd/test/sshd_x509_upn_fail.sh Outdated
Comment thread apps/wolfssh-options.c
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.
@ejohnstown
ejohnstown force-pushed the build-options-probe branch from a8a79fa to fe160ff Compare August 19, 2026 23:06
Comment thread apps/wolfsshd/test/wolfssh_options.sh
@padelsbach
padelsbach merged commit 754317b into wolfSSL:master Aug 19, 2026
163 checks passed
@ejohnstown
ejohnstown deleted the build-options-probe branch August 19, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants