diff --git a/router/xgress_edge/certchecker_test.go b/router/xgress_edge/certchecker_test.go index 469821073..8741666cf 100644 --- a/router/xgress_edge/certchecker_test.go +++ b/router/xgress_edge/certchecker_test.go @@ -8,13 +8,13 @@ import ( "crypto/x509" "crypto/x509/pkix" "github.com/openziti/channel/v2" - "github.com/openziti/ziti/common/eid" - "github.com/openziti/ziti/router/internal/edgerouter" - "github.com/openziti/ziti/router/env" "github.com/openziti/foundation/v2/tlz" "github.com/openziti/foundation/v2/versions" "github.com/openziti/identity" "github.com/openziti/transport/v2" + "github.com/openziti/ziti/common/eid" + "github.com/openziti/ziti/router/env" + "github.com/openziti/ziti/router/internal/edgerouter" "github.com/pkg/errors" "github.com/stretchr/testify/require" "math/big" @@ -50,7 +50,7 @@ func Test_CertExpirationChecker(t *testing.T) { req := require.New(t) certChecker, _ := newCertChecker() - now := time.Now() + now := time.Now().UTC() notAfter := now.AddDate(0, 0, 7) certChecker.id.Cert().Leaf.NotAfter = notAfter @@ -210,7 +210,7 @@ func Test_CertExpirationChecker(t *testing.T) { req := require.New(t) certChecker, _ := newCertChecker() - now := time.Now() + now := time.Now().UTC() notAfter := now.AddDate(0, 0, 7) certChecker.id.ServerCert()[0].Leaf.NotAfter = notAfter diff --git a/tests/addressable_terminators_test.go b/tests/addressable_terminators_test.go index 648250a97..c524ee0f3 100644 --- a/tests/addressable_terminators_test.go +++ b/tests/addressable_terminators_test.go @@ -19,9 +19,9 @@ package tests import ( - "github.com/openziti/ziti/controller/xt_smartrouting" "github.com/openziti/sdk-golang/ziti" "github.com/openziti/sdk-golang/ziti/edge" + "github.com/openziti/ziti/controller/xt_smartrouting" "github.com/pkg/errors" "net" "strings" @@ -142,7 +142,9 @@ func Test_AddressableTerminatorSameIdentity(t *testing.T) { listener.(edge.SessionListener).SetErrorEventHandler(errorHandler) defer func() { _ = listener.Close() }() - context2 := ziti.NewContext(identity.config) + context2, err := ziti.NewContext(identity.config) + ctx.Req.NoError(err) + listener2, err := context2.ListenWithOptions(service.Name, &ziti.ListenOptions{ BindUsingEdgeIdentity: true, ConnectTimeout: 5 * time.Second, diff --git a/tests/data_flow_close_test.go b/tests/data_flow_close_test.go index 20bbb775c..b613169c1 100644 --- a/tests/data_flow_close_test.go +++ b/tests/data_flow_close_test.go @@ -22,8 +22,8 @@ package tests import ( "errors" "fmt" - "github.com/openziti/ziti/common/eid" "github.com/openziti/sdk-golang/ziti" + "github.com/openziti/ziti/common/eid" "io" "testing" "time" @@ -69,7 +69,9 @@ func Test_ServerConnClosePropagation(t *testing.T) { clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) - clientContext := ziti.NewContext(clientConfig) + + clientContext, err := ziti.NewContext(clientConfig) + ctx.Req.NoError(err) conn := ctx.WrapConn(clientContext.Dial(service.Name)) defer conn.Close() @@ -134,7 +136,9 @@ func Test_ServerContextClosePropagation(t *testing.T) { clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) - clientContext := ziti.NewContext(clientConfig) + + clientContext, err := ziti.NewContext(clientConfig) + ctx.Req.NoError(err) conn := ctx.WrapConn(clientContext.Dial(service.Name)) defer conn.Close() @@ -202,7 +206,9 @@ func Test_ServerCloseListenerPropagation(t *testing.T) { clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) - clientContext := ziti.NewContext(clientConfig) + + clientContext, err := ziti.NewContext(clientConfig) + ctx.Req.NoError(err) conn := ctx.WrapConn(clientContext.Dial(service.Name)) defer conn.Close() @@ -234,7 +240,9 @@ func Test_ClientConnClosePropagation(t *testing.T) { clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) - clientContext := ziti.NewContext(clientConfig) + + clientContext, err := ziti.NewContext(clientConfig) + ctx.Req.NoError(err) errC := make(chan error, 1) @@ -296,7 +304,9 @@ func Test_ClientContextClosePropagation(t *testing.T) { clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) - clientContext := ziti.NewContext(clientConfig) + + clientContext, err := ziti.NewContext(clientConfig) + ctx.Req.NoError(err) errC := make(chan error, 1) @@ -359,7 +369,9 @@ func Test_ServerConnCloseWritePropagation(t *testing.T) { clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) - clientContext := ziti.NewContext(clientConfig) + + clientContext, err := ziti.NewContext(clientConfig) + ctx.Req.NoError(err) errC := make(chan error, 1) @@ -453,7 +465,9 @@ func Test_ClientConnCloseWritePropagation(t *testing.T) { clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) - clientContext := ziti.NewContext(clientConfig) + + clientContext, err := ziti.NewContext(clientConfig) + ctx.Req.NoError(err) conn := ctx.WrapConn(clientContext.Dial(service.Name)) name := eid.New() diff --git a/tests/data_flow_hs_rotating_test.go b/tests/data_flow_hs_rotating_test.go index d860d4406..6966e37ac 100644 --- a/tests/data_flow_hs_rotating_test.go +++ b/tests/data_flow_hs_rotating_test.go @@ -21,9 +21,9 @@ package tests import ( "github.com/michaelquigley/pfxlog" - "github.com/openziti/ziti/common/eid" "github.com/openziti/sdk-golang/ziti" "github.com/openziti/sdk-golang/ziti/edge" + "github.com/openziti/ziti/common/eid" "github.com/pkg/errors" "math/rand" "sync" @@ -122,7 +122,9 @@ func testClientFirstWithStrategy(t *testing.T, strategy string) { clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) - clientContext := ziti.NewContext(clientConfig) + + clientContext, err := ziti.NewContext(clientConfig) + ctx.Req.NoError(err) logger := pfxlog.Logger() @@ -265,7 +267,9 @@ func testServerFirstWithStrategy(t *testing.T, strategy string) { clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) - clientContext := ziti.NewContext(clientConfig) + + clientContext, err := ziti.NewContext(clientConfig) + ctx.Req.NoError(err) ticker := time.NewTicker(time.Millisecond * 500) defer ticker.Stop() diff --git a/tests/data_flow_hs_test.go b/tests/data_flow_hs_test.go index 5a8295757..83d43ff5a 100644 --- a/tests/data_flow_hs_test.go +++ b/tests/data_flow_hs_test.go @@ -21,8 +21,8 @@ package tests import ( "github.com/michaelquigley/pfxlog" - "github.com/openziti/ziti/common/eid" "github.com/openziti/sdk-golang/ziti" + "github.com/openziti/ziti/common/eid" "sync/atomic" "testing" "time" @@ -76,7 +76,9 @@ func Test_HSDataflow(t *testing.T) { clientIdentity := ctx.AdminManagementSession.RequireNewIdentityWithOtt(false) clientConfig := ctx.EnrollIdentity(clientIdentity.Id) - clientContext := ziti.NewContext(clientConfig) + + clientContext, err := ziti.NewContext(clientConfig) + ctx.Req.NoError(err) for i := 0; i < 100; i++ { conn := ctx.WrapConn(clientContext.Dial(service.Name))