Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardsn committed Nov 4, 2024
1 parent 166a04e commit 04656ae
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions pki/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,12 @@ func TestValidator_AddTruststore(t *testing.T) {

t.Run("missing CA", func(t *testing.T) {
noRootStore := store.Certificates()[:2]
t.Run("softfail", func(t *testing.T) {
val, err := newValidator(Config{Softfail: true})
require.NoError(t, err)

assert.NoError(t, val.AddTruststore(noRootStore))
})
t.Run("hardfail", func(t *testing.T) {
val, err := newValidator(Config{Softfail: false})
require.NoError(t, err)
val, err := newValidator(Config{Softfail: true})
require.NoError(t, err)

err = val.AddTruststore(noRootStore)
err = val.AddTruststore(noRootStore)

assert.ErrorContains(t, err, "certificate's issuer is not in the trust store")
})
assert.ErrorContains(t, err, "certificate's issuer is not in the trust store")
})
}

Expand Down

0 comments on commit 04656ae

Please sign in to comment.