Add extra testcase

This commit is contained in:
Louis Taylor 2018-07-25 17:41:05 +01:00
parent db5383051e
commit 474c8ed27f
No known key found for this signature in database
GPG Key ID: 8E81A6DAE13E7098

View File

@ -42,6 +42,17 @@ func TestValidateCertificateForACMEIssuer(t *testing.T) {
KeyAlgorithm: v1alpha1.RSAKeyAlgorithm,
},
},
"certificate with incorrect keyAlgorithm for ACME": {
spec: &v1alpha1.CertificateSpec{
CommonName: "testcn",
SecretName: "abc",
IssuerRef: validIssuerRef,
KeyAlgorithm: v1alpha1.ECDSAKeyAlgorithm,
},
errs: []*field.Error{
field.Invalid(fldPath.Child("keyAlgorithm"), v1alpha1.ECDSAKeyAlgorithm, "ACME key algorithm must be RSA"),
},
},
}
for n, s := range scenarios {
t.Run(n, func(t *testing.T) {