Documentation ¶
Index ¶
- func CreateDialContext(t *testing.T, ing *v1alpha1.Ingress, clients *test.Clients) func(context.Context, string, string) (net.Conn, error)
- func CreateFlakyService(t *testing.T, clients *test.Clients, period int) (string, int, context.CancelFunc)
- func CreateGRPCService(t *testing.T, clients *test.Clients, suffix string) (string, int, context.CancelFunc)
- func CreateIngress(t *testing.T, clients *test.Clients, spec v1alpha1.IngressSpec) (*v1alpha1.Ingress, context.CancelFunc)
- func CreateIngressReady(t *testing.T, clients *test.Clients, spec v1alpha1.IngressSpec) (*v1alpha1.Ingress, *http.Client, context.CancelFunc)
- func CreateIngressReadyDialContext(t *testing.T, clients *test.Clients, spec v1alpha1.IngressSpec) (*v1alpha1.Ingress, func(context.Context, string, string) (net.Conn, error), ...)
- func CreateProxyService(t *testing.T, clients *test.Clients, target string, gatewayDomain string) (string, int, context.CancelFunc)
- func CreateRuntimeService(t *testing.T, clients *test.Clients, portName string) (string, int, context.CancelFunc)
- func CreateTLSSecret(t *testing.T, clients *test.Clients, hosts []string) (string, context.CancelFunc)
- func CreateTLSSecretWithCertPool(t *testing.T, clients *test.Clients, hosts []string, ns string, ...) (string, context.CancelFunc)
- func CreateTimeoutService(t *testing.T, clients *test.Clients) (string, int, context.CancelFunc)
- func CreateWebsocketService(t *testing.T, clients *test.Clients, suffix string) (string, int, context.CancelFunc)
- func DumpResponse(t *testing.T, resp *http.Response)
- func IsDialError(err error) bool
- func RunConformance(t *testing.T)
- func RuntimeRequest(t *testing.T, client *http.Client, url string, opts ...RequestOption) *types.RuntimeInfo
- func RuntimeRequestWithExpectations(t *testing.T, client *http.Client, url string, ...) *types.RuntimeInfo
- func TestBasics(t *testing.T)
- func TestBasicsHTTP2(t *testing.T)
- func TestGRPC(t *testing.T)
- func TestGRPCSplit(t *testing.T)
- func TestIngressTLS(t *testing.T)
- func TestMultipleHosts(t *testing.T)
- func TestPath(t *testing.T)
- func TestPathAndPercentageSplit(t *testing.T)
- func TestPercentage(t *testing.T)
- func TestPostSplitSetHeaders(t *testing.T)
- func TestPreSplitSetHeaders(t *testing.T)
- func TestRetry(t *testing.T)
- func TestTagHeaders(t *testing.T)
- func TestTimeout(t *testing.T)
- func TestUpdate(t *testing.T)
- func TestVisibility(t *testing.T)
- func TestVisibilityPath(t *testing.T)
- func TestVisibilitySplit(t *testing.T)
- func TestWebsocket(t *testing.T)
- func TestWebsocketSplit(t *testing.T)
- func UpdateIngress(t *testing.T, clients *test.Clients, name string, spec v1alpha1.IngressSpec)
- func UpdateIngressReady(t *testing.T, clients *test.Clients, name string, spec v1alpha1.IngressSpec)
- type RequestOption
- type ResponseExpectation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDialContext ¶
func CreateDialContext(t *testing.T, ing *v1alpha1.Ingress, clients *test.Clients) func(context.Context, string, string) (net.Conn, error)
CreateDialContext looks up the endpoint information to create a "dialer" for the provided Ingress' public ingress loas balancer. It can be used to contact external-visibility services with an HTTP client via:
client := &http.Client{ Transport: &http.Transport{ DialContext: CreateDialContext(t, ing, clients), }, }
func CreateFlakyService ¶
func CreateFlakyService(t *testing.T, clients *test.Clients, period int) (string, int, context.CancelFunc)
CreateFlakyService creates a Kubernetes service where the backing pod will succeed only every Nth request.
func CreateGRPCService ¶
func CreateGRPCService(t *testing.T, clients *test.Clients, suffix string) (string, int, context.CancelFunc)
CreateGRPCService creates a Kubernetes service that will upgrade the connection to use GRPC and echo back the received messages with the provided suffix.
func CreateIngress ¶
func CreateIngress(t *testing.T, clients *test.Clients, spec v1alpha1.IngressSpec) (*v1alpha1.Ingress, context.CancelFunc)
CreateIngress creates a Knative Ingress resource
func CreateIngressReady ¶
func CreateProxyService ¶ added in v0.13.0
func CreateProxyService(t *testing.T, clients *test.Clients, target string, gatewayDomain string) (string, int, context.CancelFunc)
CreateProxyService creates a Kubernetes service that will forward requests to the specified target. It returns the service name, the port on which the service is listening, and a "cancel" function to clean up the created resources.
func CreateRuntimeService ¶
func CreateRuntimeService(t *testing.T, clients *test.Clients, portName string) (string, int, context.CancelFunc)
CreateRuntimeService creates a Kubernetes service that will respond to the protocol specified with the given portName. It returns the service name, the port on which the service is listening, and a "cancel" function to clean up the created resources.
func CreateTLSSecret ¶
func CreateTLSSecret(t *testing.T, clients *test.Clients, hosts []string) (string, context.CancelFunc)
This is based on https://golang.org/src/crypto/tls/generate_cert.go
func CreateTLSSecretWithCertPool ¶
func CreateTLSSecretWithCertPool(t *testing.T, clients *test.Clients, hosts []string, ns string, cas *x509.CertPool) (string, context.CancelFunc)
CreateTLSSecretWithCertPool creates TLS certificate with given CertPool.
func CreateTimeoutService ¶
CreateTimeoutService creates a Kubernetes service that will respond to the protocol specified with the given portName. It returns the service name, the port on which the service is listening, and a "cancel" function to clean up the created resources.
func CreateWebsocketService ¶
func CreateWebsocketService(t *testing.T, clients *test.Clients, suffix string) (string, int, context.CancelFunc)
CreateWebsocketService creates a Kubernetes service that will upgrade the connection to use websockets and echo back the received messages with the provided suffix.
func IsDialError ¶ added in v0.14.0
func RunConformance ¶ added in v0.16.0
func RuntimeRequest ¶
func RuntimeRequest(t *testing.T, client *http.Client, url string, opts ...RequestOption) *types.RuntimeInfo
func RuntimeRequestWithExpectations ¶ added in v0.14.0
func RuntimeRequestWithExpectations(t *testing.T, client *http.Client, url string, responseExpectations []ResponseExpectation, allowDialError bool, opts ...RequestOption) *types.RuntimeInfo
RuntimeRequestWithExpectations attempts to make a request to url and return runtime information. If connection is successful only then it will validate all response expectations. If allowDialError is set to true then function will not fail if connection is a dial error.
func TestBasics ¶ added in v0.16.0
TestBasics verifies that a no frills Ingress exposes a simple Pod/Service via the public load balancer.
func TestBasicsHTTP2 ¶ added in v0.16.0
TestBasicsHTTP2 verifies that the same no-frills Ingress over a Service with http/2 configured will see a ProtoMajor of 2.
func TestGRPCSplit ¶ added in v0.16.0
TestGRPCSplit verifies that websockets may be used across a traffic split.
func TestIngressTLS ¶ added in v0.16.0
TestIngressTLS verifies that the Ingress properly handles the TLS field.
func TestMultipleHosts ¶ added in v0.16.0
TestMultipleHosts verifies that an Ingress can respond to multiple hosts.
func TestPath ¶ added in v0.16.0
TestPath verifies that an Ingress properly dispatches to backends based on the path of the URL.
func TestPathAndPercentageSplit ¶ added in v0.16.0
func TestPercentage ¶ added in v0.16.0
TestPercentage verifies that an Ingress splitting over multiple backends respects the given percentage distribution.
func TestPostSplitSetHeaders ¶ added in v0.16.0
TestPostSplitSetHeaders verifies that an Ingress that specified AppendHeaders post-split has the appropriate header(s) set.
func TestPreSplitSetHeaders ¶ added in v0.16.0
TestPreSplitSetHeaders verifies that an Ingress that specified AppendHeaders pre-split has the appropriate header(s) set.
func TestRetry ¶ added in v0.16.0
TestRetry verifies that an Ingress configured to retry N times properly masks transient failures.
func TestTagHeaders ¶ added in v0.16.0
TestTagHeaders verifies that an Ingress properly dispaches to backends based on the tag header
See proposal doc for reference: https://docs.google.com/document/d/12t_3NE4EqvW_l0hfVlQcAGKkwkAM56tTn2wN_JtHbSQ/edit?usp=sharing
func TestTimeout ¶ added in v0.16.0
TestTimeout verifies that an Ingress configured with a timeout respects that.
func TestUpdate ¶ added in v0.16.0
TestUpdate verifies that when the network programming changes that traffic isn't dropped.
func TestVisibility ¶ added in v0.16.0
func TestVisibilityPath ¶ added in v0.16.0
func TestVisibilitySplit ¶ added in v0.16.0
func TestWebsocket ¶ added in v0.16.0
TestWebsocket verifies that websockets may be used via a simple Ingress.
func TestWebsocketSplit ¶ added in v0.16.0
TestWebsocketSplit verifies that websockets may be used across a traffic split.
func UpdateIngress ¶
UpdateIngress updates a Knative Ingress resource
func UpdateIngressReady ¶
Types ¶
type RequestOption ¶
type ResponseExpectation ¶ added in v0.14.0
func StatusCodeExpectation ¶ added in v0.14.0
func StatusCodeExpectation(statusCodes sets.Int) ResponseExpectation