Documentation ¶
Index ¶
- Constants
- func BazelWorkspace() string
- func LoadTestData(testFileName string) string
- func LoadTestJSON(testFileName string) string
- func ReadYAML(input string, pb legacyproto.Message) error
- func TestPath(testFileName string) string
- type Envoy
- type ExactStat
- type ExistStat
- type ExtensionServer
- func (es *ExtensionServer) Delete(name string) error
- func (es *ExtensionServer) DeltaExtensionConfigs(...) error
- func (es *ExtensionServer) FetchExtensionConfigs(ctx context.Context, req *discovery.DiscoveryRequest) (*discovery.DiscoveryResponse, error)
- func (es *ExtensionServer) StreamExtensionConfigs(...) error
- func (es *ExtensionServer) Update(config *core.TypedExtensionConfig) error
- type Fork
- type GrpcCall
- type GrpcServer
- type GrpcStream
- type HTTPCall
- type InterceptedTCPConnection
- type MissingStat
- type NamedWorkload
- type Otel
- type OtelLogs
- type OtelMetrics
- type Params
- func (p *Params) Fill(s string) (string, error)
- func (p *Params) FillTestData(data string) string
- func (p *Params) FillYAML(input string, pb legacyproto.Message) error
- func (p *Params) LoadTestData(testFileName string) string
- func (p *Params) LoadTestProto(testFileName string, msg legacyproto.Message) legacyproto.Message
- type PartialStat
- type Repeat
- type Scenario
- type Sleep
- type StatMatcher
- type Stats
- type Step
- type StepFunction
- type TCPConnection
- type TCPLoad
- type TCPServer
- type TCPServerAcceptAndClose
- type Update
- type UpdateExtensions
- type UpdateWorkloadMetadata
- type WorkloadMetadata
- type XDS
- type XDSServer
Constants ¶
const ( DefaultTimeout = 10 * time.Second None = "-" Any = "*" )
const (
// APIType for extension configs.
APIType = "type.googleapis.com/envoy.config.core.v3.TypedExtensionConfig"
)
const WorkloadTypeURL = "type.googleapis.com/istio.workload.Workload"
Variables ¶
This section is empty.
Functions ¶
func BazelWorkspace ¶
func BazelWorkspace() string
Types ¶
type Envoy ¶
type Envoy struct { // template for the bootstrap Bootstrap string // Istio proxy version to download. // This could be either a patch version (x.y.z), or a minor version (x.y), or master. // When minor version or master is provided, proxy binary will downloaded based on // the latest proxy SHA that istio minor version branch points to. // DownloadVersion will be ignored if proxy binary already exists at the // default bazel-bin location, or ENVOY_PATH env var is set. DownloadVersion string // standard error for the Envoy process (defaults to os.Stderr). Stderr io.Writer // standard out for the Envoy process (defaults to os.Stdout). Stdout io.Writer // Value used to set the --concurrency flag when starting envoy. Concurrency uint32 // contains filtered or unexported fields }
Envoy starts up a Envoy process locally.
type ExistStat ¶
type ExistStat struct {
Metric string
}
ExistStat matches if the metric exists in the output, but does not compare the Counter.
type ExtensionServer ¶
type ExtensionServer struct { server.Server server.CallbackFuncs // contains filtered or unexported fields }
ExtensionServer is the main server instance.
func NewExtensionServer ¶
func NewExtensionServer(ctx context.Context) *ExtensionServer
func (*ExtensionServer) Delete ¶
func (es *ExtensionServer) Delete(name string) error
func (*ExtensionServer) DeltaExtensionConfigs ¶
func (es *ExtensionServer) DeltaExtensionConfigs(stream extensionservice.ExtensionConfigDiscoveryService_DeltaExtensionConfigsServer) error
func (*ExtensionServer) FetchExtensionConfigs ¶
func (es *ExtensionServer) FetchExtensionConfigs(ctx context.Context, req *discovery.DiscoveryRequest) (*discovery.DiscoveryResponse, error)
func (*ExtensionServer) StreamExtensionConfigs ¶
func (es *ExtensionServer) StreamExtensionConfigs(stream extensionservice.ExtensionConfigDiscoveryService_StreamExtensionConfigsServer) error
func (*ExtensionServer) Update ¶
func (es *ExtensionServer) Update(config *core.TypedExtensionConfig) error
type GrpcServer ¶
type GrpcServer struct {
// contains filtered or unexported fields
}
func (*GrpcServer) Cleanup ¶
func (g *GrpcServer) Cleanup()
func (*GrpcServer) Run ¶
func (g *GrpcServer) Run(p *Params) error
type GrpcStream ¶
type GrpcStream struct {
// contains filtered or unexported fields
}
func (*GrpcStream) Cleanup ¶
func (g *GrpcStream) Cleanup()
func (*GrpcStream) Close ¶
func (g *GrpcStream) Close() Step
func (*GrpcStream) Run ¶
func (g *GrpcStream) Run(p *Params) error
func (*GrpcStream) Send ¶
func (g *GrpcStream) Send(counts []uint32) Step
type HTTPCall ¶
type HTTPCall struct { // Method Method string // Authority override Authority string // URL path Path string // Port specifies the port in 127.0.0.1:PORT Port uint16 // Body is the expected body Body string // RequestHeaders to send with the request RequestHeaders map[string]string // ResponseCode to expect ResponseCode int // ResponseHeaders to expect ResponseHeaders map[string]string // Timeout (must be set to avoid the default) Timeout time.Duration // DisableRedirect prevents the client from following redirects and returns the original response. DisableRedirect bool // IP address override instead of 127.0.0.1 IP string }
HTTPCall sends a HTTP request to a localhost port, and then check the response code, and response headers.
type InterceptedTCPConnection ¶
InterceptedTCPConnection is a connection which expects the terminated connection (before the timeout occurs)
func (*InterceptedTCPConnection) Cleanup ¶
func (t *InterceptedTCPConnection) Cleanup()
func (*InterceptedTCPConnection) Run ¶
func (t *InterceptedTCPConnection) Run(p *Params) error
type MissingStat ¶
type MissingStat struct {
Metric string
}
func (*MissingStat) Matches ¶
func (m *MissingStat) Matches(_ *Params, that *dto.MetricFamily) error
type NamedWorkload ¶
type NamedWorkload struct {
*workloadapi.Workload
}
func (*NamedWorkload) GetName ¶
func (nw *NamedWorkload) GetName() string
type Otel ¶
type Otel struct { OtelLogs OtelMetrics Port uint16 // Metrics contains the expected (total) metric protos. Clients must produce them exactly. Metrics []string // contains filtered or unexported fields }
type OtelLogs ¶
type OtelLogs struct {
collogspb.UnimplementedLogsServiceServer
}
func (*OtelLogs) Export ¶
func (x *OtelLogs) Export(ctx context.Context, req *collogspb.ExportLogsServiceRequest) (*collogspb.ExportLogsServiceResponse, error)
type OtelMetrics ¶
type OtelMetrics struct { colmetricspb.UnimplementedMetricsServiceServer // contains filtered or unexported fields }
func (*OtelMetrics) Export ¶
func (x *OtelMetrics) Export(ctx context.Context, req *colmetricspb.ExportMetricsServiceRequest) (*colmetricspb.ExportMetricsServiceResponse, error)
type Params ¶
type Params struct { // Config is the XDS server state. Config XDSServer // Ports record the port assignment for a test. Ports *env.Ports // Vars include the variables which are used to fill in configuration template files. Vars map[string]string // N records the index of repetition. It is only valid when using with Repeat step. N int }
Params include test context that is shared by all steps.
func NewTestParams ¶
NewTestParams creates a new test params struct which keeps state of a test. vars will be used for template filling. A set of ports will be assigned. If TestInventory is provided, the port assignment will be offsetted based on the index of the test in the inventory.
func (*Params) FillTestData ¶
Fills in template variables in the given template data
func (*Params) LoadTestData ¶
Loads a test file and fills in template variables
func (*Params) LoadTestProto ¶
func (p *Params) LoadTestProto(testFileName string, msg legacyproto.Message) legacyproto.Message
Loads a test file as YAML into a proto and fills in template variables
type PartialStat ¶
type PartialStat struct {
Metric string
}
func (*PartialStat) Matches ¶
func (me *PartialStat) Matches(params *Params, that *dto.MetricFamily) error
type Scenario ¶
type Scenario struct { // Steps is a collection of steps which be executed sequentially. Steps []Step }
Scenario is a collection of Steps. It runs and cleans up all steps sequentially.
type StatMatcher ¶
type StatMatcher interface {
Matches(*Params, *dto.MetricFamily) error
}
type Stats ¶
type Stats struct { AdminPort uint16 Matchers map[string]StatMatcher }
type Step ¶
type Step interface { // Run wraps the logic of a test step. Run(*Params) error // Cleanup cleans up all the test artifacts created by Run. Cleanup() }
Step is a unit of execution in the integration test.
type StepFunction ¶
StepFunction models Lambda captured step
func (StepFunction) Cleanup ¶
func (s StepFunction) Cleanup()
func (StepFunction) Run ¶
func (s StepFunction) Run(p *Params) error
type TCPConnection ¶
type TCPConnection struct{}
func (*TCPConnection) Cleanup ¶
func (t *TCPConnection) Cleanup()
func (*TCPConnection) Run ¶
func (t *TCPConnection) Run(p *Params) error
type TCPServerAcceptAndClose ¶
type TCPServerAcceptAndClose struct {
// contains filtered or unexported fields
}
TCPServerAcceptAndClose implements a TCP server which accepts the data and then closes the connection immediately without any response.
The exception from this description is the "ping" data which is handled differently for checking if the server is already up.
func (*TCPServerAcceptAndClose) Cleanup ¶
func (t *TCPServerAcceptAndClose) Cleanup()
func (*TCPServerAcceptAndClose) Run ¶
func (t *TCPServerAcceptAndClose) Run(p *Params) error
type Update ¶
type UpdateExtensions ¶
type UpdateExtensions struct {
Extensions []string
}
func (*UpdateExtensions) Cleanup ¶
func (u *UpdateExtensions) Cleanup()
func (*UpdateExtensions) Run ¶
func (u *UpdateExtensions) Run(p *Params) error
type UpdateWorkloadMetadata ¶
type UpdateWorkloadMetadata struct {
Workloads []WorkloadMetadata
}
func (*UpdateWorkloadMetadata) Cleanup ¶
func (u *UpdateWorkloadMetadata) Cleanup()
func (*UpdateWorkloadMetadata) Run ¶
func (u *UpdateWorkloadMetadata) Run(p *Params) error
type WorkloadMetadata ¶
type XDSServer ¶
type XDSServer struct { cache.MuxCache Extensions *ExtensionServer Cache cache.SnapshotCache Workloads *cache.LinearCache }
XDSServer is a struct holding xDS state.