Skip to content

Commit

Permalink
use t.Fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
dovholuknf committed Nov 14, 2024
1 parent 3ae7857 commit 28c221e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
9 changes: 4 additions & 5 deletions ziti/cmd/pki/pki_create_ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package pki
import (
"fmt"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -38,7 +37,7 @@ func TestTrustDomain(t *testing.T) {
ca.SetArgs(rootCaArgs)
pkiErr := ca.Execute()
if pkiErr != nil {
logrus.Fatal(pkiErr)
t.Fatal(pkiErr)
}

bundle, e := testPki.GetCA(name)
Expand All @@ -61,7 +60,7 @@ func TestNoTrustDomain(t *testing.T) {
ca.SetArgs(rootCaArgs)
pkiErr := ca.Execute()
if pkiErr != nil {
logrus.Fatal(pkiErr)
t.Fatal(pkiErr)
}

bundle, e := testPki.GetCA(name)
Expand All @@ -85,7 +84,7 @@ func TestTrustDomainSpiffeAppended(t *testing.T) {
ca.SetArgs(rootCaArgs)
pkiErr := ca.Execute()
if pkiErr != nil {
logrus.Fatal(pkiErr)
t.Fatal(pkiErr)
}

bundle, e := testPki.GetCA(name)
Expand All @@ -109,7 +108,7 @@ func TestTrustDomainWithPath(t *testing.T) {
ca.SetArgs(rootCaArgs)
pkiErr := ca.Execute()
if pkiErr != nil {
logrus.Fatal(pkiErr)
t.Fatal(pkiErr)
}

bundle, e := testPki.GetCA(name)
Expand Down
9 changes: 4 additions & 5 deletions ziti/cmd/pki/pki_create_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package pki
import (
"fmt"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -38,7 +37,7 @@ func TestClientCertNoSpiffeIdFromIntermediate(t *testing.T) {
svr.SetArgs(args)
svrErr := svr.Execute()
if svrErr != nil {
logrus.Fatal(svrErr)
t.Fatal(svrErr)
}

bundle, e := testPki.GetBundle(intCaNameWithoutSpiffeIdName, name)
Expand All @@ -62,7 +61,7 @@ func TestClientCertSpiffeIdFromIntermediate(t *testing.T) {
svr.SetArgs(addSpiffeArg("/some/path", args))
svrErr := svr.Execute()
if svrErr != nil {
logrus.Fatal(svrErr)
t.Fatal(svrErr)
}

bundle, e := testPki.GetBundle(intCaNameWithSpiffeIdName, name)
Expand All @@ -88,7 +87,7 @@ func TestClientCertNoSpiffeIdFromIntermediateAddSpiffeId(t *testing.T) {
svr.SetArgs(addSpiffeArg(sid, args))
svrErr := svr.Execute()
if svrErr != nil {
logrus.Fatal(svrErr)
t.Fatal(svrErr)
}

bundle, e := testPki.GetBundle(intCaNameWithoutSpiffeIdName, name)
Expand All @@ -113,7 +112,7 @@ func TestClientCertSpiffeIdFromIntermediateAddSpiffeId(t *testing.T) {
svr.SetArgs(addSpiffeArg(sid, args))
svrErr := svr.Execute()
if svrErr != nil {
logrus.Fatal(svrErr)
t.Fatal(svrErr)
}

bundle, e := testPki.GetBundle(intCaNameWithSpiffeIdName, name)
Expand Down
3 changes: 1 addition & 2 deletions ziti/cmd/pki/pki_create_intermediate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package pki
import (
"fmt"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -39,7 +38,7 @@ func TestSpiffedSetFromCa(t *testing.T) {
intermediateCmd.SetArgs(intermediateArgs)
pkiErr := intermediateCmd.Execute()
if pkiErr != nil {
logrus.Fatal(pkiErr)
t.Fatal(pkiErr)
}

bundle, e := testPki.GetCA(name)
Expand Down
9 changes: 4 additions & 5 deletions ziti/cmd/pki/pki_create_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package pki
import (
"fmt"
"github.com/google/uuid"
"github.com/sirupsen/logrus"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -40,7 +39,7 @@ func TestServerCertNoSpiffeIdFromIntermediate(t *testing.T) {
svr.SetArgs(args)
svrErr := svr.Execute()
if svrErr != nil {
logrus.Fatal(svrErr)
t.Fatal(svrErr)
}

bundle, e := testPki.GetBundle(intCaNameWithoutSpiffeIdName, name)
Expand Down Expand Up @@ -71,7 +70,7 @@ func TestServerCertSpiffeIdFromIntermediate(t *testing.T) {
svr.SetArgs(addSpiffeArg("/some/path", args))
svrErr := svr.Execute()
if svrErr != nil {
logrus.Fatal(svrErr)
t.Fatal(svrErr)
}

bundle, e := testPki.GetBundle(intCaNameWithSpiffeIdName, name)
Expand Down Expand Up @@ -105,7 +104,7 @@ func TestServerCertNoSpiffeIdFromIntermediateAddSpiffeId(t *testing.T) {
svr.SetArgs(addSpiffeArg(sid, args))
svrErr := svr.Execute()
if svrErr != nil {
logrus.Fatal(svrErr)
t.Fatal(svrErr)
}

bundle, e := testPki.GetBundle(intCaNameWithoutSpiffeIdName, name)
Expand All @@ -132,7 +131,7 @@ func TestServerCertSpiffeIdFromIntermediateAddSpiffeId(t *testing.T) {
svr.SetArgs(addSpiffeArg(sid, args))
svrErr := svr.Execute()
if svrErr != nil {
logrus.Fatal(svrErr)
t.Fatal(svrErr)
}

bundle, e := testPki.GetBundle(intCaNameWithSpiffeIdName, name)
Expand Down

0 comments on commit 28c221e

Please sign in to comment.