-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Increase Unit Test Code Coverage #2272
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
Conversation
notifications/http_test.go
Outdated
// first make sure that the default transport gives x509 untrusted cert error | ||
events := []Event{} | ||
err := sink.Write(events...) | ||
if !strings.Contains(err.Error(), "x509") { | ||
if !strings.Contains(err.Error(), "x509") && !strings.Contains(err.Error(), "OpenSSL error") { |
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.
What configuration is this seen under? Is this when using a modified version of Go which uses openssl?
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.
Yes that is the error which is returned in case of modified version of Go which uses open ssl.
When using the unmodified version of go the error that is returned is
"x509: certificate signed by unknown authority"
and while using the modified version the error that is returned is
"SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca"
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.
Maybe this test should really look for "unknown authority" or "unknown ca" then.
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.
Agreed. Will change this check to that.
Codecov Report
@@ Coverage Diff @@
## master #2272 +/- ##
===========================================
- Coverage 61.57% 50.24% -11.34%
===========================================
Files 125 128 +3
Lines 11397 11817 +420
===========================================
- Hits 7018 5937 -1081
- Misses 3493 5114 +1621
+ Partials 886 766 -120
Continue to review full report at Codecov.
|
ef59b88
to
0b9dcac
Compare
@naveedjamil could you rebase this? |
Unit test coverge was increased to cover the usages of crypto. This helps to ensure that everything is working fine with fips mode enabled. Also updated sha1 to sha256 in registry/storage/driver/testsuites/testsuites.go because sha1 is not supported in fips mode. Signed-off-by: Naveed Jamil <naveed.jamil@tenpearl.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Codecov Report
@@ Coverage Diff @@
## master #2272 +/- ##
==========================================
- Coverage 60.74% 58.67% -2.07%
==========================================
Files 102 104 +2
Lines 8077 8434 +357
==========================================
+ Hits 4906 4949 +43
- Misses 2519 2823 +304
- Partials 652 662 +10
Continue to review full report at Codecov.
|
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.
LGTM
Hi @naveedjamil , Will this create issue in FIPS compliance? |
Unit test coverge was increased to cover the usages of crypto. This helps to ensure that everything is working fine with fips mode enabled.
Also updated sha1 to sha256 in registry/storage/driver/testsuites/testsuites.go because sha1 is not supported in fips mode.
Signed-off-by: Naveed Jamil naveed.jamil@tenpearls.com