diff --git a/kms/pkcs11/other_test.go b/kms/pkcs11/other_test.go index 79d734e7..a0d810f4 100644 --- a/kms/pkcs11/other_test.go +++ b/kms/pkcs11/other_test.go @@ -28,6 +28,7 @@ func mustPKCS11(t TBTesting) *PKCS11 { for i := range testCerts { testCerts[i].Certificates = nil } + teardown(t, k) setup(t, k) return k } diff --git a/kms/pkcs11/pkcs11_test.go b/kms/pkcs11/pkcs11_test.go index 029beb66..ebecb7d0 100644 --- a/kms/pkcs11/pkcs11_test.go +++ b/kms/pkcs11/pkcs11_test.go @@ -33,7 +33,7 @@ func TestNew(t *testing.T) { k.Close() }) p11Configure = func(config *crypto11.Config) (P11, error) { - if strings.Index(config.Path, "fail") >= 0 { + if strings.Contains(config.Path, "fail") { return nil, errors.New("an error") } return k.p11, nil