Skip to content

Small Test Reorganization#951

Open
ejohnstown wants to merge 1 commit intowolfSSL:masterfrom
ejohnstown:reorg-test
Open

Small Test Reorganization#951
ejohnstown wants to merge 1 commit intowolfSSL:masterfrom
ejohnstown:reorg-test

Conversation

@ejohnstown
Copy link
Copy Markdown
Contributor

  1. Collect all the test function wrappers in internal.c to one location at the end of the file.
  2. Update API test to check other algos if RSA or ECDSA are disabled.
  3. Update regression test to test RSA or ECDSA, and will print a message if both are disabled.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Reorganizes internal test wrappers and updates test expectations to be resilient when certain cryptographic algorithms are compiled out.

Changes:

  • Consolidates WOLFSSH_TEST_INTERNAL wrapper functions in src/internal.c to a single block at the end of the file.
  • Updates API tests to assert algorithm availability based on compile-time feature macros.
  • Updates regression test key selection to prefer RSA, fall back to ECDSA, and emit a message when neither is available.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/regress.c Adds RSA/ECDSA conditional key setup for the idempotent buffer test.
tests/api.c Makes wolfSSH_CheckAlgoName() assertions conditional on algorithm enablement macros.
src/internal.c Moves internal test wrapper functions into one consolidated block at EOF.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/regress.c Outdated
Comment thread tests/regress.c Outdated
padelsbach
padelsbach previously approved these changes Apr 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

tests/regress.c:1656

  • This change skips TestClientBuffersIdempotent() entirely when WOLFSSH_NO_RSA is set, even if ECDSA is still enabled. The PR description says the regression should test RSA or ECDSA and only report/skip when both are disabled; consider selecting RSA key files when RSA is enabled, otherwise using the existing ECC key files (e.g., gretel-key-ecc.*) when ECDSA is enabled, and only skipping when neither is available.
#ifndef WOLFSSH_NO_RSA
/* Ensure client buffer cleanup tolerates multiple invocations after allocs. */
static void TestClientBuffersIdempotent(void)
{
    int ret;

    ret = ClientUsePubKey("keys/gretel-key-rsa.pub");
    AssertIntEQ(ret, 0);
    ret = ClientSetPrivateKey("keys/gretel-key-rsa.pem");
    AssertIntEQ(ret, 0);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/api.c Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/regress.c Outdated
Comment thread tests/regress.c Outdated
Comment thread tests/regress.c Outdated
1. Collect all the test function wrappers in internal.c to one location
   at the end of the file.
2. Update API test to check other algos if RSA or ECDSA are disabled.
3. Added guarded tests TestClientBuffersIdempotent() for WOLFSSH_NO_RSA
   and WOLFSSH_NO_ECDSA_SHA2_NISTP256. If both are set, the test is
   skipped.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ejohnstown ejohnstown requested a review from Copilot April 23, 2026 22:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants