Documentation
¶
Index ¶
- func AssertContainerState(t *testing.T, service libservice.Service, state string)
- func AssertEnvoyHTTPrbacFilters(t *testing.T, port int)
- func AssertEnvoyMetricAtLeast(t *testing.T, adminPort int, prefix, metric string, count int)
- func AssertEnvoyMetricAtMost(t *testing.T, adminPort int, prefix, metric string, count int)
- func AssertEnvoyPresentsCertURI(t *testing.T, port int, serviceName string)
- func AssertEnvoyRunning(t *testing.T, port int)
- func AssertFortioName(t *testing.T, urlbase string, name string, reqHost string)
- func AssertFortioNameWithClient(t *testing.T, urlbase string, name string, reqHost string, client *http.Client)
- func AssertServiceHasHealthyInstances(t *testing.T, node libcluster.Agent, service string, onlypassing bool, ...)
- func AssertUpstreamEndpointStatus(t *testing.T, adminPort int, clusterName, healthStatus string, count int)
- func AssertUpstreamEndpointStatusWithClient(t *testing.T, client *http.Client, addr string, clusterName string, ...)
- func CatalogNodeExists(t *testing.T, c *api.Client, nodeName string)
- func CatalogServiceExists(t *testing.T, c *api.Client, svc string, opts *api.QueryOptions)
- func CatalogServiceHasInstanceCount(t *testing.T, c *api.Client, svc string, count int, opts *api.QueryOptions)
- func CatalogServiceIsHealthy(t *testing.T, c *api.Client, svc string, opts *api.QueryOptions)
- func GRPCPing(t *testing.T, addr string)
- func GetEnvoyListenerTCPFilters(t *testing.T, adminPort int)
- func GetEnvoyListenerTCPFiltersWithClient(t *testing.T, client *http.Client, addr string)
- func GetEnvoyOutput(port int, path string, query map[string]string) (string, int, error)
- func GetEnvoyOutputWithClient(client *http.Client, addr string, path string, query map[string]string) (string, int, error)
- func HTTPServiceEchoes(t *testing.T, ip string, port int, path string)
- func HTTPServiceEchoesResHeader(t *testing.T, ip string, port int, path string, ...)
- func HTTPServiceEchoesResHeaderWithClient(t *testing.T, client *http.Client, addr string, path string, ...)
- func HTTPServiceEchoesWithClient(t *testing.T, client *http.Client, addr string, path string)
- func HTTPServiceEchoesWithHeaders(t *testing.T, ip string, port int, path string, headers map[string]string)
- func PeeringExports(t *testing.T, client *api.Client, peerName string, exports int)
- func PeeringExportsOpts(t *testing.T, client *api.Client, peerName string, exports int, ...)
- func PeeringStatus(t *testing.T, client *api.Client, peerName string, status api.PeeringState)
- func PeeringStatusOpts(t *testing.T, client *api.Client, peerName string, status api.PeeringState, ...)
- func ServiceLogContains(t *testing.T, service libservice.Service, target string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertContainerState ¶
func AssertContainerState(t *testing.T, service libservice.Service, state string)
AssertContainerState validates service container status
func AssertEnvoyHTTPrbacFilters ¶
GetEnvoyHTTPrbacFilters validates that proxy was configured with an http connection manager AssertEnvoyHTTPrbacFilters validates that proxy was configured with an http connection manager this assertion is currently unused current tests use http protocol
func AssertEnvoyMetricAtLeast ¶
AssertEnvoyMetricAtLeast assert the filered metric by prefix and metric is <= count
func AssertEnvoyMetricAtMost ¶
AssertEnvoyMetricAtMost assert the filered metric by prefix and metric is >= count
func AssertEnvoyPresentsCertURI ¶
AssertEnvoyPresentsCertURI makes GET request to /certs endpoint and validates that two certificates URI is available in the response
func AssertEnvoyRunning ¶
AssertEnvoyRunning assert the envoy is running by querying its stats page
func AssertFortioName ¶
AssertFortioName is a convenience function for AssertFortioNameWithClient, using a [cleanhttp.DefaultClient()]
func AssertFortioNameWithClient ¶
func AssertFortioNameWithClient(t *testing.T, urlbase string, name string, reqHost string, client *http.Client)
AssertFortioNameWithClient asserts that the fortio service replying at urlbase/debug has a `FORTIO_NAME` env variable set. This validates that the client is sending traffic to the right envoy proxy.
If reqHost is set, the Host field of the HTTP request will be set to its value.
It retries with timeout defaultHTTPTimeout and wait defaultHTTPWait.
client must be a custom http.Client
func AssertServiceHasHealthyInstances ¶
func AssertServiceHasHealthyInstances(t *testing.T, node libcluster.Agent, service string, onlypassing bool, count int)
AssertServiceHasHealthyInstances asserts the number of instances of service equals count for a given service. https://developer.hashicorp.com/consul/docs/connect/config-entries/service-resolver#onlypassing
func AssertUpstreamEndpointStatus ¶
func AssertUpstreamEndpointStatus(t *testing.T, adminPort int, clusterName, healthStatus string, count int)
AssertUpstreamEndpointStatus validates that proxy was configured with provided clusterName in the healthStatus
func CatalogNodeExists ¶
CatalogNodeExists verifies the node name exists in the Consul catalog
func CatalogServiceExists ¶
CatalogServiceExists verifies the service name exists in the Consul catalog
func CatalogServiceHasInstanceCount ¶
func CatalogServiceHasInstanceCount(t *testing.T, c *api.Client, svc string, count int, opts *api.QueryOptions)
CatalogServiceHasInstanceCount verifies the service name exists in the Consul catalog and has the specified number of instances.
func CatalogServiceIsHealthy ¶
CatalogServiceIsHealthy verifies the service name exists and all instances pass healthchecks
func GRPCPing ¶
GRPCPing sends a fgrpc.PingMessage to a fortio server at addr, analogous to the CLI command `fortio grpcping`. It retries for up to 1m, with a 25ms gap.
func GetEnvoyListenerTCPFilters ¶
GetEnvoyListenerTCPFilters validates that proxy was configured with tcp protocol and one rbac listener filter
func GetEnvoyOutput ¶
func PeeringExports ¶
PeeringExports verifies the correct number of exported services with a default retry.
func PeeringExportsOpts ¶
func PeeringExportsOpts(t *testing.T, client *api.Client, peerName string, exports int, opts *api.QueryOptions)
PeeringExportsOpts verifies the correct number of exported services with a default retry with options.
func PeeringStatus ¶
PeeringStatus verifies the peering connection is the specified state with a default retry.
func PeeringStatusOpts ¶
func PeeringStatusOpts(t *testing.T, client *api.Client, peerName string, status api.PeeringState, opts *api.QueryOptions)
PeeringStatusOpts verifies the peering connection is the specified state with a default retry with options.
func ServiceLogContains ¶
ServiceLogContains returns true if the service container has the target string in its logs
Types ¶
This section is empty.