Skip to content

Commit

Permalink
Add more spire tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Peyton Walters committed Jan 7, 2020
1 parent a2b8779 commit 08d783a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions internal/common/spiretrustsource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ func TestInitalLoad(t *testing.T) {
assert.Equal(t, "blog", certs[0].Subject.CommonName)
}

func TestInvalidURI(t *testing.T) {
_, err := NewSpireTrustSource(map[string]string{
"spirffe://example.org": "",
}, "certs/")
require.Error(t, err)
}

func TestInvalidDomain(t *testing.T) {
_, err := NewSpireTrustSource(map[string]string{
"spiffe://example.org/test": "",
}, "certs/")
require.Error(t, err)
}

func TestWriteCerts(t *testing.T) {
appFS = afero.NewMemMapFs()

Expand Down

0 comments on commit 08d783a

Please sign in to comment.