Skip to content
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

Add a test for the UI API #2040

Closed
wants to merge 2 commits into from
Closed

Add a test for the UI API #2040

wants to merge 2 commits into from

Conversation

levitte
Copy link
Member

@levitte levitte commented Dec 7, 2016

Checklist
  • tests are added or updated
  • CLA is signed
Description of change

The best way to test the UI interface is currently by using an openssl
command that uses password_callback. The only one that does this is
'genrsa'.
Since password_callback uses a UI method derived from UI_OpenSSL(), it
ensures that one gets tested well enough as well.

@levitte
Copy link
Member Author

levitte commented Dec 7, 2016

I expect this test to fail on all MacOS X builds that aren't BUILDONLY.

Copy link
Contributor

@richsalz richsalz left a comment

Choose a reason for hiding this comment

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

also to backport test to 1.1.0 if you want.

@levitte levitte added 1.1.0 branch: master Merge to master branch labels Dec 7, 2016
@levitte
Copy link
Member Author

levitte commented Dec 7, 2016

Yes, I do, just forgot to lable properly...

The best way to test the UI interface is currently by using an openssl
command that uses password_callback.  The only one that does this is
'genrsa'.
Since password_callback uses a UI method derived from UI_OpenSSL(), it
ensures that one gets tested well enough as well.
@levitte
Copy link
Member Author

levitte commented Dec 8, 2016

Actually, no... this wasn't a good enough test. I didn't notice that when password_callback notices a default password, it simply returns it instead of exercising UI... I can make sure to get a proper test in two ways:

  1. Make it so password_callback goes through the motions with UI, even with a default password present.
  2. Create test/uitest.c that does this.

Me, I'm tempted to go for the first option. It's our live code, might as well exercise it, ... and it's easier.

@levitte
Copy link
Member Author

levitte commented Dec 8, 2016

So I decided to change password_callback... as a side effect, it became a bit clearer what it does when.

@levitte
Copy link
Member Author

levitte commented Dec 8, 2016

@richsalz, this requires a re-approval on your part... or someone else in the team.

@levitte
Copy link
Member Author

levitte commented Dec 8, 2016

+0.3% coverage? Cool :-)

@levitte
Copy link
Member Author

levitte commented Dec 8, 2016

The Travis failures is exactly what I expected, and show that his test does what it's supposed to do.

@richsalz
Copy link
Contributor

richsalz commented Dec 8, 2016

+1

levitte added a commit that referenced this pull request Dec 8, 2016
The best way to test the UI interface is currently by using an openssl
command that uses password_callback.  The only one that does this is
'genrsa'.
Since password_callback uses a UI method derived from UI_OpenSSL(), it
ensures that one gets tested well enough as well.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #2040)
levitte added a commit that referenced this pull request Dec 8, 2016
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #2040)
levitte added a commit that referenced this pull request Dec 8, 2016
The best way to test the UI interface is currently by using an openssl
command that uses password_callback.  The only one that does this is
'genrsa'.
Since password_callback uses a UI method derived from UI_OpenSSL(), it
ensures that one gets tested well enough as well.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #2040)
(cherry picked from commit 17ac8ea)
levitte added a commit that referenced this pull request Dec 8, 2016
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #2040)
(cherry picked from commit 57c0f37)
@levitte
Copy link
Member Author

levitte commented Dec 8, 2016

Merged

@levitte levitte closed this Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants