tests

package
v0.19.95 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 61 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ControllerConfFile         = "ats-ctrl.yml"
	EdgeRouterConfFile         = "ats-edge.router.yml"
	TunnelerEdgeRouterConfFile = "ats-edge-tunneler.router.yml"
	TransitRouterConfFile      = "ats-transit.router.yml"
)

Variables

This section is empty.

Functions

func NewVersionProviderTest

func NewVersionProviderTest() common.VersionProvider

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 {
	ApiHost            string
	AdminAuthenticator *updbAuthenticator
	AdminSession       *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) Client

func (ctx *TestContext) Client(httpClient *http.Client) *resty.Client

func (*TestContext) CreateEnrollAndStartEdgeRouter

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

func (*TestContext) CreateEnrollAndStartTunnelerEdgeRouter

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

func (*TestContext) DefaultClient

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

func (*TestContext) EnrollIdentity

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

func (*TestContext) HttpClient

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

func (*TestContext) NewClient

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

func (*TestContext) NewClientComponents

func (ctx *TestContext) NewClientComponents() (*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) RequireAdminLogin

func (ctx *TestContext) RequireAdminLogin()

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) Transport

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

func (*TestContext) TransportWithClientCert

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

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