suite

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllFeatures = sets.New[SupportedFeature]().
	Insert(StandardExtendedFeatures.UnsortedList()...).
	Insert(ExperimentalExtendedFeatures.UnsortedList()...).
	Insert(HTTPExtendedFeatures.UnsortedList()...).
	Insert(TLSCoreFeatures.UnsortedList()...).
	Insert(MeshCoreFeatures.UnsortedList()...)

AllFeatures contains all the supported features and can be used to run all conformance tests with `all-features` flag.

NOTE: as new feature sets are added they should be inserted into this set.

View Source
var ExperimentalExtendedFeatures = sets.New(
	SupportRouteDestinationPortMatching,
)

ExperimentalExtendedFeatures are extra generic features that are currently only available in our experimental release channel, and at an extended support level.

TODO: we need clarity for standard vs experimental features. See: https://github.com/kubernetes-sigs/gateway-api/issues/1891

View Source
var HTTPCoreFeatures = sets.New(
	SupportHTTPRoute,
)

HTTPCoreFeatures includes all SupportedFeatures needed to be conformant with the HTTPRoute.

HTTPExtendedFeatures includes all the supported features for HTTPRoute conformance and can be used to opt-in to run all HTTPRoute tests, including extended features.

View Source
var MeshCoreFeatures = sets.New(
	SupportMesh,
)

MeshCoreFeatures includes all the supported features for the service mesh at a Core level of support.

View Source
var StandardCoreFeatures = sets.New(
	SupportReferenceGrant,
	SupportGateway,
)

StandardCoreFeatures are the features that are required to be conformant with the Core API features (e.g. GatewayClass, Gateway, e.t.c.).

TODO: we need clarity for standard vs experimental features. See: https://github.com/kubernetes-sigs/gateway-api/issues/1891

View Source
var StandardExtendedFeatures = sets.New(
	SupportGatewayClassObservedGenerationBump,
).Insert(StandardCoreFeatures.UnsortedList()...)

StandardExtendedFeatures are extra generic features that implementations may choose to support as an opt-in.

TODO: we need clarity for standard vs experimental features. See: https://github.com/kubernetes-sigs/gateway-api/issues/1891

View Source
var TLSCoreFeatures = sets.New(
	SupportTLSRoute,
)

TLSCoreFeatures includes all the supported features for the TLSRoute API at a Core level of support.

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
	Clientset         *clientset.Clientset
	RESTClient        *rest.RESTClient
	RestConfig        *rest.Config
	RoundTripper      roundtripper.RoundTripper
	GatewayClassName  string
	ControllerName    string
	Debug             bool
	Cleanup           bool
	BaseManifests     string
	MeshManifests     string
	Applier           kubernetes.Applier
	SupportedFeatures sets.Set[SupportedFeature]
	TimeoutConfig     config.TimeoutConfig
	SkipTests         sets.Set[string]
	FS                embed.FS
}

ConformanceTestSuite defines the test suite used to run Gateway API conformance tests.

func New

New returns a new ConformanceTestSuite.

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
	Clientset        *clientset.Clientset
	RESTClient       *rest.RESTClient
	RestConfig       *rest.Config
	GatewayClassName string
	Debug            bool
	RoundTripper     roundtripper.RoundTripper
	BaseManifests    string
	MeshManifests    string
	NamespaceLabels  map[string]string

	// 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]
	ExemptFeatures             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

	FS *embed.FS
}

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 Gateway (core conformance).
	// Opting out of this is allowed only for GAMMA-only implementations
	SupportGateway SupportedFeature = "Gateway"
)
const (
	// 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 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"

	// This option indicates support for HTTPRoute request mirror (extended conformance).
	SupportHTTPRouteRequestMirror SupportedFeature = "HTTPRouteRequestMirror"
)
const (
	// This option indicates GatewayClass will update the observedGeneration in
	// it's conditions when reconciling (extended conformance).
	//
	// NOTE: we intend to make this core and require implementations to do it
	//       as we expect this is something every implementation should be able
	//       to do and it's ideal behavior.
	//
	//       See: https://github.com/kubernetes-sigs/gateway-api/issues/1780
	SupportGatewayClassObservedGenerationBump SupportedFeature = "GatewayClassObservedGenerationBump"
)
const (
	// This option indicates support for HTTPRoute
	SupportHTTPRoute SupportedFeature = "HTTPRoute"
)
const (
	// This option indicates general support for service mesh
	SupportMesh SupportedFeature = "Mesh"
)
const (
	// This option indicates support for Destination Port matching.
	SupportRouteDestinationPortMatching SupportedFeature = "RouteDestinationPortMatching"
)
const (
	// This option indicates support for TLSRoute
	SupportTLSRoute SupportedFeature = "TLSRoute"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL