From 82fb96588e151967775c1740a3e882da9a955dfd Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Tue, 19 May 2020 17:45:15 -0700 Subject: [PATCH] Fix unit tests. --- kms/apiv1/options_test.go | 2 +- kms/kms_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kms/apiv1/options_test.go b/kms/apiv1/options_test.go index 645b63b1..47ba3ec0 100644 --- a/kms/apiv1/options_test.go +++ b/kms/apiv1/options_test.go @@ -13,7 +13,7 @@ func TestOptions_Validate(t *testing.T) { {"nil", nil, false}, {"softkms", &Options{Type: "softkms"}, false}, {"cloudkms", &Options{Type: "cloudkms"}, false}, - {"awskms", &Options{Type: "awskms"}, true}, + {"awskms", &Options{Type: "awskms"}, false}, {"pkcs11", &Options{Type: "pkcs11"}, true}, {"unsupported", &Options{Type: "unsupported"}, true}, } diff --git a/kms/kms_test.go b/kms/kms_test.go index f377072f..f3d2f61f 100644 --- a/kms/kms_test.go +++ b/kms/kms_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/smallstep/certificates/kms/apiv1" + "github.com/smallstep/certificates/kms/awskms" "github.com/smallstep/certificates/kms/cloudkms" "github.com/smallstep/certificates/kms/softkms" ) @@ -27,8 +28,8 @@ func TestNew(t *testing.T) { }{ {"softkms", false, args{ctx, apiv1.Options{Type: "softkms"}}, &softkms.SoftKMS{}, false}, {"default", false, args{ctx, apiv1.Options{}}, &softkms.SoftKMS{}, false}, + {"awskms", false, args{ctx, apiv1.Options{Type: "awskms"}}, &awskms.KMS{}, false}, {"cloudkms", true, args{ctx, apiv1.Options{Type: "cloudkms"}}, &cloudkms.CloudKMS{}, true}, // fails because not credentials - {"awskms", false, args{ctx, apiv1.Options{Type: "awskms"}}, nil, true}, // not yet supported {"pkcs11", false, args{ctx, apiv1.Options{Type: "pkcs11"}}, nil, true}, // not yet supported {"fail validation", false, args{ctx, apiv1.Options{Type: "foobar"}}, nil, true}, }