Skip to content

Commit

Permalink
Skip cert validator unit test for darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-koppuru committed Sep 6, 2022
1 parent 698ad36 commit c38006a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/crypto/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"runtime"
"strings"
"testing"

Expand Down Expand Up @@ -129,6 +130,15 @@ invalidCert
)

func TestIsSignedByUnknownAuthority(t *testing.T) {
// We need to add this check as newer version of macos require the adding trusted certs manually to test for this,
// through `security add-trusted-cert`, so we are only able to run this test on linux for now.
// This is a known issue here: https://github.com/golang/go/issues/52010
// Refer to https://go-review.googlesource.com/c/go/+/353132 and https://github.com/helm/helm/pull/11160
// Follow up tracking issue for us to fix: https://github.com/aws/eks-anywhere/issues/3267
if runtime.GOOS == "darwin" {
t.Skipf("Skipping as this test will fail on darwin because newer versions require this cert " +
"to be added to the system trust store")
}
certSvr, err := runTestServerWithCert(serverCert, serverKey)
if err != nil {
t.Fatalf("starting test server with certs: %v", err)
Expand Down

0 comments on commit c38006a

Please sign in to comment.