Skip to content

Commit

Permalink
Add error checks to cryptogen/ca/ca_test
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
  • Loading branch information
sykesm authored and Brett Logan committed May 23, 2020
1 parent 4a5238c commit 640dce3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/cryptogen/ca/ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,15 @@ func TestGenerateSignCertificate(t *testing.T) {
ous := []string{"TestOU", "PeerOU"}
cert, err = rootCA.SignCertificate(certDir, testName, ous, nil, &priv.PublicKey,
x509.KeyUsageDigitalSignature, []x509.ExtKeyUsage{})
assert.NoError(t, err)
assert.Contains(t, cert.Subject.OrganizationalUnit, ous[0])
assert.Contains(t, cert.Subject.OrganizationalUnit, ous[1])

// make sure sans are correctly set
sans := []string{testName2, testIP}
cert, err = rootCA.SignCertificate(certDir, testName, nil, sans, &priv.PublicKey,
x509.KeyUsageDigitalSignature, []x509.ExtKeyUsage{})
assert.NoError(t, err)
assert.Contains(t, cert.DNSNames, testName2)
assert.Contains(t, cert.IPAddresses, net.ParseIP(testIP).To4())

Expand Down

0 comments on commit 640dce3

Please sign in to comment.