test_gen

package
v0.0.0-...-2f56d2a Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SvcNameA = "app-a"
	SvcNameB = "app-b"
	SvcNameC = "app-c"
)

App service names

View Source
const (
	METRICS = "metrics"
	CALL    = "call"
	ECHO    = "echo"
)

App API endpoints

Variables

This section is empty.

Functions

func ClearAllMetrics

func ClearAllMetrics(clusterIPs map[string]string, smObj ServiceMesh)

ClearAllMetrics aggregate all the svc metrics

func ClearMetrics

func ClearMetrics(hostname string, port string) error

ClearMetrics remove all the resources

func GetClusterIPs

func GetClusterIPs(kubeClient client.Client, namespace string) (map[string]string, error)

GetClusterIPs returns the ClusterIPs of various services exposed in the namespace

func GetHTTPClient

func GetHTTPClient() http.Client

GetHTTPClient returns a configured HTTP client

Types

type Failure

type Failure struct {
	Text    string `json:"text,omitempty"`
	Message string `json:"message,omitempty"`
}

type Istio

type Istio struct {
	PortSvcA string
	PortSvcB string
	PortSvcC string
}

func (Istio) SvcAGetInternalName

func (sm Istio) SvcAGetInternalName(namespace string) string

func (Istio) SvcAGetPort

func (sm Istio) SvcAGetPort() string

func (Istio) SvcBGetInternalName

func (sm Istio) SvcBGetInternalName(namespace string) string

func (Istio) SvcBGetPort

func (sm Istio) SvcBGetPort() string

func (Istio) SvcCGetInternalName

func (sm Istio) SvcCGetInternalName(namespace string) string

func (Istio) SvcCGetPort

func (sm Istio) SvcCGetPort() string

type Linkerd

type Linkerd struct {
	PortSvcA string
	PortSvcB string
	PortSvcC string
}

func (Linkerd) SvcAGetInternalName

func (sm Linkerd) SvcAGetInternalName(namespace string) string

func (Linkerd) SvcAGetPort

func (sm Linkerd) SvcAGetPort() string

func (Linkerd) SvcBGetInternalName

func (sm Linkerd) SvcBGetInternalName(namespace string) string

func (Linkerd) SvcBGetPort

func (sm Linkerd) SvcBGetPort() string

func (Linkerd) SvcCGetInternalName

func (sm Linkerd) SvcCGetInternalName(namespace string) string

func (Linkerd) SvcCGetPort

func (sm Linkerd) SvcCGetPort() string

type Maesh

type Maesh struct {
	PortSvcA string
	PortSvcB string
	PortSvcC string
}

func (Maesh) SvcAGetInternalName

func (sm Maesh) SvcAGetInternalName(namespace string) string

func (Maesh) SvcAGetPort

func (sm Maesh) SvcAGetPort() string

func (Maesh) SvcBGetInternalName

func (sm Maesh) SvcBGetInternalName(namespace string) string

func (Maesh) SvcBGetPort

func (sm Maesh) SvcBGetPort() string

func (Maesh) SvcCGetInternalName

func (sm Maesh) SvcCGetInternalName(namespace string) string

func (Maesh) SvcCGetPort

func (sm Maesh) SvcCGetPort() string

type MetricResponse

type MetricResponse struct {
	ReqReceived   []string
	RespSucceeded []URLstruct
	RespFailed    []URLstruct
}

MetricResponse is a part of the metrics exposed by the app

func GetMetrics

func GetMetrics(hostname string, port string) (*MetricResponse, error)

GetMetrics return a type MetricResponse

type OSM

type OSM struct {
	PortSvcA string
	PortSvcB string
	PortSvcC string
}

func (OSM) SvcAGetInternalName

func (sm OSM) SvcAGetInternalName(namespace string) string

func (OSM) SvcAGetPort

func (sm OSM) SvcAGetPort() string

func (OSM) SvcBGetInternalName

func (sm OSM) SvcBGetInternalName(namespace string) string

func (OSM) SvcBGetPort

func (sm OSM) SvcBGetPort() string

func (OSM) SvcCGetInternalName

func (sm OSM) SvcCGetInternalName(namespace string) string

func (OSM) SvcCGetPort

func (sm OSM) SvcCGetPort() string

type Results

type Results struct {
	Name      string `json:"name,omitempty"`
	Tests     int    `json:"tests,omitempty"`
	Failures  int    `json:"failures,omitempty"`
	Time      string `json:"time,omitempty"`
	Testsuite []struct {
		Tests    int    `json:"tests,omitempty"`
		Failures int    `json:"failures,omitempty"`
		Time     string `json:"time,omitempty"`
		Name     string `json:"name,omitempty"`
		Testcase []struct {
			Classname  string  `json:"classname,omitempty"`
			Name       string  `json:"name,omitempty"`
			Time       string  `json:"time,omitempty"`
			Assertions int     `json:"assertions,omitempty"`
			Failure    Failure `json:"failure,omitempty"`
		} `json:"testcase,omitempty"`
	} `json:"testsuite,omitempty"`
}

func RunTest

func RunTest(meshConfig ServiceMesh, annotations, labels map[string]string) Results

type SMIConformance

type SMIConformance struct {
	SMObj ServiceMesh
}

SMIConformance holds the SMI conformance tests

func (*SMIConformance) TrafficAccessGetTests

func (smi *SMIConformance) TrafficAccessGetTests() map[string]test.CustomTest

func (*SMIConformance) TrafficSpecGetTests

func (smi *SMIConformance) TrafficSpecGetTests() map[string]test.CustomTest

func (*SMIConformance) TrafficSplitGetTests

func (smi *SMIConformance) TrafficSplitGetTests() map[string]test.CustomTest

TrafficSplitGetTests return type of map[string]test.CustomTest

type ServiceMesh

type ServiceMesh interface {
	SvcAGetInternalName(string) string
	SvcBGetInternalName(string) string
	SvcCGetInternalName(string) string

	SvcAGetPort() string
	SvcBGetPort() string
	SvcCGetPort() string
}

ServiceMesh provides an abstract interface for different service meshes. This is required as each service mesh has different ways to expose their internals.

type URLstruct

type URLstruct struct {
	URL     string
	Method  string
	Headers map[string]string
}

URLstruct is a part of the metrics exposed by the app

Jump to

Keyboard shortcuts

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