Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllFeatures = sets.New( SupportReferenceGrant, SupportTLSRoute, SupportHTTPRouteQueryParamMatching, SupportHTTPRouteMethodMatching, SupportHTTPResponseHeaderModification, SupportRouteDestinationPortMatching, SupportGatewayClassObservedGenerationBump, SupportHTTPRoutePortRedirect, SupportHTTPRouteSchemeRedirect, SupportHTTPRoutePathRedirect, SupportHTTPRouteHostRewrite, SupportHTTPRoutePathRewrite, )
AllFeatures contains all the supported features and can be used to run all conformance tests with `all-features` flag.
Note that the AllFeatures must in sync with defined features when the feature constants change.
var StandardCoreFeatures = sets.New( SupportReferenceGrant, )
StandardCoreFeatures are the features that are required to be conformant with the Core API features that are part of the Standard release channel.
Functions ¶
This section is empty.
Types ¶
type ConformanceTest ¶
type ConformanceTest struct {
ShortName string
Description string
Features []SupportedFeature
Manifests []string
Slow bool
Parallel bool
Test func(*testing.T, *ConformanceTestSuite)
}
ConformanceTest is used to define each individual conformance test.
func (*ConformanceTest) Run ¶
func (test *ConformanceTest) Run(t *testing.T, suite *ConformanceTestSuite)
Run runs an individual tests, applying and cleaning up the required manifests before calling the Test function.
type ConformanceTestSuite ¶
type ConformanceTestSuite struct {
Client client.Client
RoundTripper roundtripper.RoundTripper
GatewayClassName string
ControllerName string
Debug bool
Cleanup bool
BaseManifests string
Applier kubernetes.Applier
SupportedFeatures sets.Set[SupportedFeature]
TimeoutConfig config.TimeoutConfig
SkipTests sets.Set[string]
}
ConformanceTestSuite defines the test suite used to run Gateway API conformance tests.
func (*ConformanceTestSuite) Run ¶
func (suite *ConformanceTestSuite) Run(t *testing.T, tests []ConformanceTest)
Run runs the provided set of conformance tests.
func (*ConformanceTestSuite) Setup ¶
func (suite *ConformanceTestSuite) Setup(t *testing.T)
Setup ensures the base resources required for conformance tests are installed in the cluster. It also ensures that all relevant resources are ready.
type Options ¶
type Options struct {
Client client.Client
GatewayClassName string
Debug bool
RoundTripper roundtripper.RoundTripper
BaseManifests string
NamespaceLabels map[string]string
// ValidUniqueListenerPorts maps each listener port of each Gateway in the
// manifests to a valid, unique port. There must be as many
// ValidUniqueListenerPorts as there are listeners in the set of manifests.
// For example, given two Gateways, each with 2 listeners, there should be
// four ValidUniqueListenerPorts.
// If empty or nil, ports are not modified.
ValidUniqueListenerPorts []v1beta1.PortNumber
// CleanupBaseResources indicates whether or not the base test
// resources such as Gateways should be cleaned up after the run.
CleanupBaseResources bool
SupportedFeatures sets.Set[SupportedFeature]
EnableAllSupportedFeatures bool
TimeoutConfig config.TimeoutConfig
// SkipTests contains all the tests not to be run and can be used to opt out
// of specific tests
SkipTests []string
}
Options can be used to initialize a ConformanceTestSuite.
type SupportedFeature ¶
type SupportedFeature string
SupportedFeature allows opting in to additional conformance tests at an individual feature granularity.
const ( // This option indicates support for ReferenceGrant (core conformance). // Opting out of this requires an implementation to have clearly implemented // and documented equivalent safeguards. SupportReferenceGrant SupportedFeature = "ReferenceGrant" // This option indicates support for TLSRoute (extended conformance). SupportTLSRoute SupportedFeature = "TLSRoute" // This option indicates support for HTTPRoute query param matching (extended conformance). SupportHTTPRouteQueryParamMatching SupportedFeature = "HTTPRouteQueryParamMatching" // This option indicates support for HTTPRoute method matching (extended conformance). SupportHTTPRouteMethodMatching SupportedFeature = "HTTPRouteMethodMatching" // This option indicates support for HTTPRoute response header modification (extended conformance). SupportHTTPResponseHeaderModification SupportedFeature = "HTTPResponseHeaderModification" // This option indicates support for Destination Port matching (extended conformance). SupportRouteDestinationPortMatching SupportedFeature = "RouteDestinationPortMatching" // This option indicates GatewayClass will update the observedGeneration in it's conditions when reconciling SupportGatewayClassObservedGenerationBump SupportedFeature = "GatewayClassObservedGenerationBump" // This option indicates support for HTTPRoute port redirect (extended conformance). SupportHTTPRoutePortRedirect SupportedFeature = "HTTPRoutePortRedirect" // This option indicates support for HTTPRoute scheme redirect (extended conformance). SupportHTTPRouteSchemeRedirect SupportedFeature = "HTTPRouteSchemeRedirect" // This option indicates support for HTTPRoute path redirect (experimental conformance). SupportHTTPRoutePathRedirect SupportedFeature = "HTTPRoutePathRedirect" // This option indicates support for HTTPRoute host rewrite (experimental conformance) SupportHTTPRouteHostRewrite SupportedFeature = "HTTPRouteHostRewrite" // This option indicates support for HTTPRoute path rewrite (experimental conformance) SupportHTTPRoutePathRewrite SupportedFeature = "HTTPRoutePathRewrite" )