Documentation
¶
Index ¶
- Constants
- Variables
- func AlmostEquals(actual, expect, offset int) bool
- func BackendMustBeAccepted(t *testing.T, client client.Client, backendName types.NamespacedName)
- func BackendTrafficPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, ...)
- func BackendTrafficPolicyMustFail(t *testing.T, client client.Client, policyName types.NamespacedName, ...)
- func ClientTrafficPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, ...)
- func CollectAndDump(t *testing.T, rest *rest.Config)
- func ContentEncoding(compressorType egv1a1.CompressorType) string
- func CreateBackend(c client.Client, nn types.NamespacedName, clusterIP string, port int32) error
- func DeleteBackend(c client.Client, nn types.NamespacedName) error
- func EnabledClusterTrustBundle() bool
- func EnvoyExtensionPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, ...)
- func EnvoyExtensionPolicyMustFail(t *testing.T, client client.Client, policyName types.NamespacedName, ...)
- func ExpectEnvoyProxyDeploymentCount(t *testing.T, suite *suite.ConformanceTestSuite, gwNN types.NamespacedName, ...)
- func ExpectEnvoyProxyHPACount(t *testing.T, suite *suite.ConformanceTestSuite, gwNN types.NamespacedName, ...)
- func ExpectRequestTimeout(t *testing.T, suite *suite.ConformanceTestSuite, gwAddr, path, query string, ...)
- func GetGatewayResourceNamespace() string
- func GetService(c client.Client, nn types.NamespacedName) (*corev1.Service, error)
- func IsGatewayNamespaceMode() bool
- func OverLimitCount(suite *suite.ConformanceTestSuite) (int, error)
- func QueryLogCountFromLoki(t *testing.T, c client.Client, keyValues map[string]string, match string) (int, error)
- func RetrieveMetric(url, name string, timeout time.Duration) (*dto.MetricFamily, error)
- func RetrieveMetrics(url string, timeout time.Duration) (map[string]*dto.MetricFamily, error)
- func RetrieveURL(c client.Client, nn types.NamespacedName, port int32, path string) (string, error)
- func ScrapeMetrics(t *testing.T, c client.Client, nn types.NamespacedName, port int32, ...) error
- func SecurityPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, ...)
- func SecurityPolicyMustFail(t *testing.T, client client.Client, policyName types.NamespacedName, ...)
- func ServiceHost(c client.Client, nn types.NamespacedName, port int32) (string, error)
- func WaitForLoadBalancerAddress(t *testing.T, client client.Client, timeout time.Duration, ...) (string, error)
- func WaitForPods(t *testing.T, cl client.Client, namespace string, selectors map[string]string, ...)
- func XDSNameSchemeV2() bool
- type AddressMappings
- type CookieTracker
- type LoggingRoundTripper
- type LokiQueryResponse
- type OIDCTestClient
- func (o *OIDCTestClient) Get(url string, followDirection bool) (*http.Response, error)
- func (o *OIDCTestClient) Login(formData map[string]string) (*http.Response, error)
- func (o *OIDCTestClient) ParseLoginForm(responseBody io.ReadCloser, formID string) error
- func (o *OIDCTestClient) Send(req *http.Request, followRedirect bool) (*http.Response, error)
- type Option
Constants ¶
const ( ClusterTrustBundleFeature features.FeatureName = "ClusterTrustBundle" ConformanceInfraNamespace = "gateway-conformance-infra" AllNamespacesGateway = "all-namespaces" )
Variables ¶
var ( IPFamily = os.Getenv("IP_FAMILY") DeployProfile = os.Getenv("KUBE_DEPLOY_PROFILE") SameNamespaceGateway = types.NamespacedName{Name: "same-namespace", Namespace: ConformanceInfraNamespace} SameNamespaceGatewayRef = k8sutils.NewGatewayRef(SameNamespaceGateway) PodReady = corev1.PodCondition{Type: corev1.PodReady, Status: corev1.ConditionTrue} )
Functions ¶
func AlmostEquals ¶
AlmostEquals We use a solution similar to istio: Given an offset, calculate whether the actual value is within the offset of the expected value
func BackendMustBeAccepted ¶ added in v1.1.1
BackendMustBeAccepted waits for the specified Backend to be accepted.
func BackendTrafficPolicyMustBeAccepted ¶
func BackendTrafficPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, controllerName string, ancestorRef gwapiv1a2.ParentReference)
BackendTrafficPolicyMustBeAccepted waits for the specified BackendTrafficPolicy to be accepted.
func BackendTrafficPolicyMustFail ¶ added in v1.2.0
func BackendTrafficPolicyMustFail( t *testing.T, client client.Client, policyName types.NamespacedName, controllerName string, ancestorRef gwapiv1a2.ParentReference, message string, )
BackendTrafficPolicyMustFail waits for an BackendTrafficPolicy to fail with the specified reason.
func ClientTrafficPolicyMustBeAccepted ¶ added in v1.1.0
func ClientTrafficPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, controllerName string, ancestorRef gwapiv1a2.ParentReference)
ClientTrafficPolicyMustBeAccepted waits for the specified ClientTrafficPolicy to be accepted.
func CollectAndDump ¶ added in v1.1.0
CollectAndDump collects and dumps the cluster data for troubleshooting and log. This function should be call within t.Cleanup.
func ContentEncoding ¶ added in v1.4.0
func ContentEncoding(compressorType egv1a1.CompressorType) string
func CreateBackend ¶ added in v1.3.0
func DeleteBackend ¶ added in v1.3.0
func DeleteBackend(c client.Client, nn types.NamespacedName) error
func EnabledClusterTrustBundle ¶ added in v1.5.0
func EnabledClusterTrustBundle() bool
TODO: remove this when the min version EG supported is v1.33
func EnvoyExtensionPolicyMustBeAccepted ¶ added in v1.1.0
func EnvoyExtensionPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, controllerName string, ancestorRef gwapiv1a2.ParentReference)
EnvoyExtensionPolicyMustBeAccepted waits for the specified EnvoyExtensionPolicy to be accepted.
func EnvoyExtensionPolicyMustFail ¶ added in v1.1.0
func EnvoyExtensionPolicyMustFail( t *testing.T, client client.Client, policyName types.NamespacedName, controllerName string, ancestorRef gwapiv1a2.ParentReference, message string, )
EnvoyExtensionPolicyMustFail waits for an EnvoyExtensionPolicy to fail with the specified reason.
func ExpectEnvoyProxyDeploymentCount ¶ added in v1.4.0
func ExpectEnvoyProxyDeploymentCount(t *testing.T, suite *suite.ConformanceTestSuite, gwNN types.NamespacedName, expectedNs string, expectedCount int)
func ExpectEnvoyProxyHPACount ¶ added in v1.4.0
func ExpectEnvoyProxyHPACount(t *testing.T, suite *suite.ConformanceTestSuite, gwNN types.NamespacedName, expectedNs string, expectedCount int)
func ExpectRequestTimeout ¶ added in v1.4.0
func GetGatewayResourceNamespace ¶ added in v1.4.0
func GetGatewayResourceNamespace() string
func GetService ¶ added in v1.3.0
func IsGatewayNamespaceMode ¶ added in v1.4.0
func IsGatewayNamespaceMode() bool
func OverLimitCount ¶ added in v1.2.0
func OverLimitCount(suite *suite.ConformanceTestSuite) (int, error)
func QueryLogCountFromLoki ¶ added in v1.1.0
func QueryLogCountFromLoki(t *testing.T, c client.Client, keyValues map[string]string, match string) (int, error)
QueryLogCountFromLoki queries log count from loki
func RetrieveMetric ¶ added in v1.1.0
func RetrieveMetrics ¶ added in v1.1.0
func RetrieveURL ¶ added in v1.1.0
func ScrapeMetrics ¶ added in v1.1.0
func ScrapeMetrics(t *testing.T, c client.Client, nn types.NamespacedName, port int32, path string) error
ScrapeMetrics TODO: use QueryPrometheus from test/e2e/tests/promql.go instead
func SecurityPolicyMustBeAccepted ¶
func SecurityPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, controllerName string, ancestorRef gwapiv1a2.ParentReference)
SecurityPolicyMustBeAccepted waits for the specified SecurityPolicy to be accepted.
func SecurityPolicyMustFail ¶ added in v1.1.0
func SecurityPolicyMustFail( t *testing.T, client client.Client, policyName types.NamespacedName, controllerName string, ancestorRef gwapiv1a2.ParentReference, message string, )
SecurityPolicyMustFail waits for an SecurityPolicy to fail with the specified reason.
func ServiceHost ¶ added in v1.4.0
func WaitForLoadBalancerAddress ¶ added in v1.1.0
func WaitForPods ¶
func WaitForPods(t *testing.T, cl client.Client, namespace string, selectors map[string]string, phase corev1.PodPhase, condition *corev1.PodCondition)
WaitForPods waits for the pods in the given namespace and with the given selector to be in the given phase and condition.
func XDSNameSchemeV2 ¶ added in v1.5.0
func XDSNameSchemeV2() bool
TODO(zhaohuabing) remove this after the feature flag is removed.
Types ¶
type AddressMappings ¶
type AddressMappings struct {
// contains filtered or unexported fields
}
AddressMappings is a custom dialer that resolves specific host:port to specific target addresses.
func (*AddressMappings) DialContext ¶
DialContext is a custom dialer that resolves specific host:port to specific target addresses.
type CookieTracker ¶
type CookieTracker struct {
Delegate http.RoundTripper
Cookies map[string]*http.Cookie
}
CookieTracker is a http.RoundTripper that tracks cookies received from the server.
type LoggingRoundTripper ¶
type LoggingRoundTripper struct {
LogFunc func(...any)
LogBody bool
Delegate http.RoundTripper
}
LoggingRoundTripper is a http.RoundTripper that logs requests and responses.
type LokiQueryResponse ¶ added in v1.1.0
type OIDCTestClient ¶
type OIDCTestClient struct {
// contains filtered or unexported fields
}
OIDCTestClient encapsulates a http.Client and keeps track of the state of the OIDC login process.
func NewOIDCTestClient ¶
func NewOIDCTestClient(opts ...Option) (*OIDCTestClient, error)
NewOIDCTestClient creates a new OIDCTestClient.
func (*OIDCTestClient) ParseLoginForm ¶
func (o *OIDCTestClient) ParseLoginForm(responseBody io.ReadCloser, formID string) error
ParseLoginForm parses the HTML response body to get the URL where the login page would post the user-entered credentials.
type Option ¶
type Option func(*OIDCTestClient) error
Option is a functional option for configuring the OIDCTestClient.
func WithCustomAddressMappings ¶
WithCustomAddressMappings configures the OIDCTestClient to resolve specific host:port to specific target addresses.
func WithLoggingOptions ¶
WithLoggingOptions configures the OIDCTestClient to log requests and responses.