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

Tlsfuzzer external tests #17340

Closed
wants to merge 3 commits into from
Closed

Conversation

beldmit
Copy link
Member

@beldmit beldmit commented Dec 22, 2021

This is a WIP PR to add TLSFuzzer external testing to openssl

Checklist
  • documentation is added or updated
  • tests are added or updated

@beldmit beldmit changed the title Tlsfuzzer ext [WIP] Tlsfuzzer ext Dec 22, 2021
@beldmit beldmit added approval: review pending This pull request needs review by a committer branch: 3.0 Merge to openssl-3.0 branch branch: master Merge to master branch labels Dec 23, 2021
@beldmit beldmit changed the title [WIP] Tlsfuzzer ext Tlsfuzzer external tests Dec 23, 2021
@beldmit
Copy link
Member Author

beldmit commented Dec 23, 2021

Now I switched off the failing tests.

This PR adds some tests using the TLSFuzzer test framework. Currently it's basically an infrastructure PR, but it will be extended to run more tests.

TLSFuzzer is more flexible than s_client/s_server utilities. It is extensively used in Red Hat TLS testing, and there were (and will be) a lot of issues found by it.

Could you please give a feedback whether we are interested in this test suite?

@mattcaswell
Copy link
Member

Could you please give a feedback whether we are interested in this test suite?

I think it would be good to have this.

We have typically used the external tests as regression tests and only infrequently do we update the submodules and bring the external tests up to date. The more coverage we can get for regression testing the better IMO.

@beldmit
Copy link
Member Author

beldmit commented Dec 23, 2021

@beldmit
Copy link
Member Author

beldmit commented Jan 3, 2022

check_update failure seems irrelevant. Ping @levitte (?)

@beldmit
Copy link
Member Author

beldmit commented Jan 3, 2022

Ready for review. Ping @t8m @mattcaswell @tomato42

After this PR is merged, I will significantly extend the set of the tests.

Copy link
Contributor

@tomato42 tomato42 left a comment

Choose a reason for hiding this comment

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

For first, example tests, I'd say use of test-tls13-conversation.py and test-conversation.py would be better, as they are a). simple, and b). pass.

@beldmit
Copy link
Member Author

beldmit commented Jan 3, 2022

Current state of the tests is agreed with @tomato42. If they pass, the PR should be ready to merge. It could (and will) be extended later with other test cases.

@t8m t8m added the triaged: feature The issue/pr requests/adds a feature label Jan 3, 2022
@t8m
Copy link
Member

t8m commented Jan 3, 2022

IMO this does not belong to 3.0 branch. As this is a completely new test case.

@beldmit
Copy link
Member Author

beldmit commented Jan 3, 2022

@t8m I'd suggest add this to master and decide if it should be added to 3.0 separately

Copy link
Contributor

@paulidale paulidale left a comment

Choose a reason for hiding this comment

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

The stable release update policy says that this should not go into 3.0. This would need to be raised at an OTC call and a vote taken to permit it into 3.0.

@paulidale paulidale added approval: done This pull request has the required number of approvals and removed branch: 3.0 Merge to openssl-3.0 branch labels Jan 4, 2022
@beldmit
Copy link
Member Author

beldmit commented Jan 4, 2022

No problem, I'm more disturbed by possible regressions during refactoring

Comment on lines +20 to +23
if [ "$SRCTOP" != "$BLDTOP" ] ; then
echo "Out of tree builds not supported with TLSFuzzer test!"
exit 1
fi
Copy link
Member

Choose a reason for hiding this comment

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

Is there any particular reason why out of tree builds are not supported with this test? It was necessary to do with the gost test because it did not support multiple paths for include directories, however here I do not see any compilation depending on the OpenSSL sources. Or am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, there is no real reason for that.

plan skip_all => "TLSFuzzer tests not available on Windows or VMS"
if $^O =~ /^(VMS|MSWin32)$/;
plan skip_all => "TLSFuzzer tests not supported in out of tree builds"
if bldtop_dir() ne srctop_dir();
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps the test should be also skipped if the tlsfuzzer submodule is not present. Similarly to how some other external test check presence of the external sources.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure - we have submodules to ensure the presence of the sources, don't we?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but you might want to run just some of the external tests. Of course you can always selectively run the individual tests, but... But yeah the gost external test recipe does not check for the presence of the gost sources either.

@openssl-machine
Copy link
Collaborator

24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually.

@beldmit
Copy link
Member Author

beldmit commented Jan 5, 2022

Merged. Many thanks!

To be continued...

@beldmit beldmit closed this Jan 5, 2022
openssl-machine pushed a commit that referenced this pull request Jan 5, 2022
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #17340)
openssl-machine pushed a commit that referenced this pull request Jan 5, 2022
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #17340)
openssl-machine pushed a commit that referenced this pull request Jan 5, 2022
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #17340)
@bernd-edlinger
Copy link
Member

Hi, I see test failure of dayly "coverage" test:

------------------------------------------------------------------
Testing OpenSSL using TLSFuzzer:
   CWD:                /home/runner/work/openssl/openssl/test-runs/test_external_tlsfuzzer
   SRCTOP:             /home/runner/work/openssl/openssl
   BLDTOP:             /home/runner/work/openssl/openssl
   OPENSSL_ROOT_DIR:   /home/runner/work/openssl/openssl
   Python:             /usr/bin/python
   TESTDATADIR:        /home/runner/work/openssl/openssl/test/recipes/95-test_external_tlsfuzzer_data
------------------------------------------------------------------
/usr/bin/python: can't open file 'tests/scripts_retention.py': [Errno 2] No such file or directory
../../util/wrap.pl sh ../../test/recipes/95-test_external_tlsfuzzer_data/tls-fuzzer-cert.sh => 2
not ok 1 - running TLSFuzzer tests
# ------------------------------------------------------------------------------
#   Failed test 'running TLSFuzzer tests'
#   at test/recipes/95-test_external_tlsfuzzer.t line 27.
# Looks like you failed 1 test of 1.95-test_external_tlsfuzzer.t ....... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 

what does that mean?

@beldmit
Copy link
Member Author

beldmit commented Jan 7, 2022

I suspect lack of the submodules added for this test, speaking frankly.

@t8m
Copy link
Member

t8m commented Jan 7, 2022

I suspect lack of the submodules added for this test, speaking frankly.

@beldmit would you please fix it? I'd recommend also adding the skip of the test in the test recipe if the submodule is not present.

@beldmit
Copy link
Member Author

beldmit commented Jan 7, 2022

I can't do it before Monday, sorry

t8m pushed a commit to t8m/openssl that referenced this pull request Nov 2, 2022
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from openssl#17340)

(cherry picked from commit cccbb4f)
t8m pushed a commit to t8m/openssl that referenced this pull request Nov 2, 2022
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from openssl#17340)

(cherry picked from commit db87f89)
t8m pushed a commit to t8m/openssl that referenced this pull request Nov 2, 2022
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from openssl#17340)

(cherry picked from commit e66c417)
openssl-machine pushed a commit that referenced this pull request Nov 9, 2022
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #17340)

(cherry picked from commit cccbb4f)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
openssl-machine pushed a commit that referenced this pull request Nov 9, 2022
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #17340)

(cherry picked from commit db87f89)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
openssl-machine pushed a commit that referenced this pull request Nov 9, 2022
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #17340)

(cherry picked from commit e66c417)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: done This pull request has the required number of approvals approval: review pending This pull request needs review by a committer branch: master Merge to master branch triaged: feature The issue/pr requests/adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants