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 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 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 ¶
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 ¶
func RuntimeRequest ¶
func RuntimeRequest(t *testing.T, client *http.Client, url string, opts ...RequestOption) *types.RuntimeInfo
func RuntimeRequestWithExpectations ¶
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 UpdateIngress ¶
UpdateIngress updates a Knative Ingress resource
func UpdateIngressReady ¶
Types ¶
type RequestOption ¶
type ResponseExpectation ¶
func StatusCodeExpectation ¶
func StatusCodeExpectation(statusCodes sets.Int) ResponseExpectation