Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardsn committed Nov 1, 2024
1 parent faf6381 commit c5daef3
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 @@ -205,20 +205,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 c5daef3

Please sign in to comment.