Increase Unit Test Code Coverage

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>
This commit is contained in:
Naveed Jamil 2017-05-15 20:34:14 +05:00 committed by Derek McGowan
parent 244d5246c2
commit efdba4f210
No known key found for this signature in database
GPG key ID: F58C5D0A4405ACDB
4 changed files with 141 additions and 5 deletions

View file

@ -10,10 +10,10 @@ import (
"net/http/httptest"
"reflect"
"strconv"
"strings"
"testing"
"github.com/docker/distribution/manifest/schema1"
"strings"
)
// TestHTTPSink mocks out an http endpoint and notifies it under a couple of
@ -70,7 +70,7 @@ func TestHTTPSink(t *testing.T) {
// 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(), "unknown ca") {
t.Fatal("TLS server with default transport should give unknown CA error")
}
if err := sink.Close(); err != nil {