-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in redirection of unit test outputs #3528
Fix bug in redirection of unit test outputs #3528
Conversation
The test code does not build with this PR. From the Travis logs:
|
Also needs:
|
This was previously reported in #2311. There's also a proposed patch in that report, but please note that we cannot legally accept that patch, or a patch derived from it, without an explicit permission grant from its author, so you need to write your patch independently. We also haven't confirmed that this patch works. I would prefer a different approach. Instead of modifying
And close |
@gilles-peskine-arm, I'm very sorry, can you please clarify why the changes I made modify the behaviour of the program at all? Wouldn't your proposed solution need the tests themselves also to reference verbose_out? |
The test code never references I haven't looked at your patch too closely. It clearly does modify the behavior of the program since |
I must have been blind. Would something like this be portable enough? |
Does this need more work? @danh-arm @gilles-peskine-arm |
@gufe44 |
@hanno-arm Isn't this a problem on the development branch? I have only looked so far. I think the tests making use of psa_crypto.c fail to gather entropy with mbedtls_entropy_func. Tests pass if test_suite_entropy has been run before and tests/seedfile was created (or if make test is run twice). |
@gufe44 @hanno-arm Indeed there's a gotcha in our test suites: if Historically this has mostly worked invisibly because the other test suites that call the entropy module come after Another failure reason is when the seedfile is too small. The size of the seedfile is determined by Enough people have gotten bitten by this that we should fix it rather than document it. #3575 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution, the patch looks good to me.
There's a trivial style issue remaining but it doesn't block the PR. Feel free to push a commit or leave things as they are.
Apologies for mistakenly blaming your PR for one of the CI failures. As far as I see, they're known issues in the CI, but I'd be grateful if @mpg or @gilles-peskine-arm could double-check and confirm for the latest run, as they're more familiar with this these days.
Thank you for your review and for pointing out the remaining style issue. Are there any concerns about portability or backporting to LTS branches? |
Avoid replacing handle. stdout is defined as a macro on several platforms. Signed-off-by: gufe44 <gu981@protonmail.com>
@gufe44 Have you checked whether the underlying issue is present in 2.7 and 2.16? |
Yes. The relevant functions were already present mostly in the same files. |
Otherwise it builds and tests fine on OpenBSD, builds fine on NetBSD but (edit: fixed in #3540) gets stuck in mbedtls_mpi_gen_prime (corner case limb size) of test_suite_mpi (both stable/x86_64).