tests

package
v0.21.251 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EdgeClientApiPath     = "/edge/client/v1"
	EdgeManagementApiPath = "/edge/management/v1"
)
View Source
const (
	ControllerConfFile         = "ats-ctrl.yml"
	EdgeRouterConfFile         = "ats-edge.router.yml"
	TunnelerEdgeRouterConfFile = "ats-edge-tunneler.router.yml"
	TransitRouterConfFile      = "ats-transit.router.yml"
)

Variables

View Source
var DefaultFormats strfmt.Registry = NewRegistry()

Functions

func B added in v0.21.194

func B(b bool) *bool

func I added in v0.21.194

func I(i int64) *int64

func IsURI added in v0.21.247

func IsURI(rawurl string) bool

func NewRegistry added in v0.21.247

func NewRegistry() strfmt.Registry

func NewVersionProviderTest

func NewVersionProviderTest() common.VersionProvider

func S added in v0.21.194

func S(s string) *string

func ST added in v0.21.194

func ST(t time.Time) *strfmt.DateTime

ST returns a pointer to a strfmt.Date time. A helper function for creating rest_model types

func T added in v0.21.194

func T(t time.Time) *time.Time

Types

type Config

type Config struct {
	Id           string
	ConfigTypeId string
	Name         string
	Data         map[string]interface{}
	Tags         map[string]interface{}
	// contains filtered or unexported fields
}

type JsonMarshallable added in v0.19.93

type JsonMarshallable interface {
	MarshalJSON() ([]byte, error)
}

type SessionRequest

type SessionRequest struct {
	ServiceId string `json:"serviceId"`
}

type TestContext

type TestContext struct {
	*require.Assertions
	ApiHost                string
	AdminAuthenticator     *updbAuthenticator
	AdminManagementSession *session
	AdminClientSession     *session

	EdgeController *server.Controller
	Req            *require.Assertions

	LogLevel         string
	ControllerConfig *controller.Config
	// contains filtered or unexported fields
}

func GetTestContext

func GetTestContext() *TestContext

func NewTestContext

func NewTestContext(t *testing.T) *TestContext

func (*TestContext) CreateEnrollAndStartEdgeRouter

func (ctx *TestContext) CreateEnrollAndStartEdgeRouter(roleAttributes ...string)

func (*TestContext) CreateEnrollAndStartTunnelerEdgeRouter

func (ctx *TestContext) CreateEnrollAndStartTunnelerEdgeRouter(roleAttributes ...string)

func (*TestContext) DefaultClientApiClient added in v0.19.105

func (ctx *TestContext) DefaultClientApiClient() *resty.Client

func (*TestContext) DefaultManagementApiClient added in v0.19.105

func (ctx *TestContext) DefaultManagementApiClient() *resty.Client

func (*TestContext) EnrollIdentity

func (ctx *TestContext) EnrollIdentity(identityId string) *sdkConfig.Config

func (*TestContext) NewClientComponents

func (ctx *TestContext) NewClientComponents(apiPath string) (*resty.Client, *http.Client, *http.Transport)

func (*TestContext) NewClientComponentsWithClientCert

func (ctx *TestContext) NewClientComponentsWithClientCert(cert *x509.Certificate, privateKey crypto.PrivateKey) (*resty.Client, *http.Client, *http.Transport)

func (*TestContext) NewHttpClient added in v0.19.105

func (ctx *TestContext) NewHttpClient(transport *http.Transport) *http.Client

func (*TestContext) NewRestClient added in v0.21.2

func (ctx *TestContext) NewRestClient(i idlib.Identity) *resty.Client

func (*TestContext) NewRestClientWithDefaults added in v0.19.105

func (ctx *TestContext) NewRestClientWithDefaults() *resty.Client

func (*TestContext) NewTransport added in v0.19.105

func (ctx *TestContext) NewTransport() *http.Transport

func (*TestContext) NewTransportWithClientCert added in v0.19.105

func (ctx *TestContext) NewTransportWithClientCert(cert *x509.Certificate, privateKey crypto.PrivateKey) *http.Transport

func (*TestContext) NewTransportWithIdentity added in v0.21.2

func (ctx *TestContext) NewTransportWithIdentity(i idlib.Identity) *http.Transport

func (*TestContext) RequireAdminClientApiLogin added in v0.19.105

func (ctx *TestContext) RequireAdminClientApiLogin()

func (*TestContext) RequireAdminManagementApiLogin added in v0.19.105

func (ctx *TestContext) RequireAdminManagementApiLogin()

func (*TestContext) RequireChildWith

func (ctx *TestContext) RequireChildWith(container *gabs.Container, attribute string, value interface{}) *gabs.Container

func (*TestContext) RequireGetNonNilPathValue

func (ctx *TestContext) RequireGetNonNilPathValue(container *gabs.Container, searchPath ...string) *gabs.Container

func (*TestContext) RequireNoChildWith

func (ctx *TestContext) RequireNoChildWith(container *gabs.Container, attribute string, value interface{}) *gabs.Container

func (*TestContext) RequireNotFoundError

func (ctx *TestContext) RequireNotFoundError(httpStatus int, body []byte) *gabs.Container

func (*TestContext) RequirePathExists

func (ctx *TestContext) RequirePathExists(container *gabs.Container, searchPath ...string)

func (*TestContext) StartServer

func (ctx *TestContext) StartServer()

func (*TestContext) StartServerFor

func (ctx *TestContext) StartServerFor(test string, clean bool)

func (*TestContext) T

func (ctx *TestContext) T() *testing.T

func (*TestContext) Teardown

func (ctx *TestContext) Teardown()

func (*TestContext) WrapConn

func (ctx *TestContext) WrapConn(conn edge.Conn, err error) *testConn

func (*TestContext) WrapNetConn

func (ctx *TestContext) WrapNetConn(conn edge.Conn, err error) *testConn

type VersionProviderTest

type VersionProviderTest struct {
}

func (VersionProviderTest) AsVersionInfo

func (v VersionProviderTest) AsVersionInfo() *common.VersionInfo

func (VersionProviderTest) Branch

func (v VersionProviderTest) Branch() string

func (VersionProviderTest) BuildDate

func (v VersionProviderTest) BuildDate() string

func (VersionProviderTest) EncoderDecoder

func (v VersionProviderTest) EncoderDecoder() common.VersionEncDec

func (VersionProviderTest) Revision

func (v VersionProviderTest) Revision() string

func (VersionProviderTest) Version

func (v VersionProviderTest) Version() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL