Documentation ¶
Index ¶
- Constants
- func Async(wg *sync.WaitGroup, cancel context.CancelFunc, testFunc func() bool)
- func ControlPlaneMachineSetSelectorLabels() map[string]string
- func Periodic() ginkgo.Labels
- func PreSubmit() ginkgo.Labels
- func RunCheckUntil(ctx context.Context, ...) bool
- type Framework
- type GomegaAssertions
- type PlatformSupportLevel
Constants ¶
const ( // DefaultTimeout is the default timeout for eventually and consistently assertions. DefaultTimeout = 60 * time.Second // DefaultInterval is the default interval for eventually and consistently assertions. DefaultInterval = 5 * time.Second // MachineAPINamespace is the name of the openshift-machine-api namespace. MachineAPINamespace = "openshift-machine-api" // ControlPlaneMachineSetName is the name of the control plane machine set in all clusters. ControlPlaneMachineSetName = "cluster" )
Variables ¶
This section is empty.
Functions ¶
func Async ¶
func Async(wg *sync.WaitGroup, cancel context.CancelFunc, testFunc func() bool)
Async runs the test function as an asynchronous goroutine. If the test function returns false, the cancel will be called. This allows to cancel the context if the test function fails.
func ControlPlaneMachineSetSelectorLabels ¶
ControlPlaneMachineSetSelectorLabels are the set of labels use to select control plane machines within the cluster.
func RunCheckUntil ¶
func RunCheckUntil(ctx context.Context, check, condition func(context.Context, GomegaAssertions) bool) bool
RunCheckUntil runs the check function until the condition succeeds or the context is cancelled. If the check fails before the condition succeeds, the test will fail. The check and condition functions must use the passed Gomega for any assertions so that we can handle failures within the functions appropriately.
Types ¶
type Framework ¶
type Framework interface { // ControlPlaneMachineSetKey returns the object key for fetching a control plane // machine set. ControlPlaneMachineSetKey() runtimeclient.ObjectKey // LoadClient returns a new controller-runtime client. GetClient() runtimeclient.Client // GetContext returns a context. GetContext() context.Context // GetPlatformType returns the platform type. GetPlatformType() configv1.PlatformType // GetPlatformSupportLevel returns the support level for the current platform. GetPlatformSupportLevel() PlatformSupportLevel // GetScheme returns the scheme. GetScheme() *runtime.Scheme // NewEmptyControlPlaneMachineSet returns a new control plane machine set with // just the name and namespace set. NewEmptyControlPlaneMachineSet() *machinev1.ControlPlaneMachineSet // IncreaseProviderSpecInstanceSize increases the instance size of the // providerSpec passed. This is used to trigger updates to the Machines // managed by the control plane machine set. IncreaseProviderSpecInstanceSize(providerSpec *runtime.RawExtension) error // TagInstanceInProviderSpec tags the instance in the provider spec. TagInstanceInProviderSpec(providerSpec *runtime.RawExtension) error // ConvertToControlPlaneMachineSetProviderSpec converts a control plane machine provider spec // to a control plane machine set suitable provider spec. ConvertToControlPlaneMachineSetProviderSpec(providerSpec machinev1beta1.ProviderSpec) (*runtime.RawExtension, error) // UpdateDefaultedValueFromCPMS updates a field that is defaulted by the defaulting webhook in the MAO with a desired value. UpdateDefaultedValueFromCPMS(rawProviderSpec *runtime.RawExtension) (*runtime.RawExtension, error) }
Framework is an interface for getting clients and information about the environment within test cases.
func NewFramework ¶
NewFramework initialises a new test framework for the E2E suite.
func NewFrameworkWith ¶
func NewFrameworkWith(sch *runtime.Scheme, client runtimeclient.Client, platform configv1.PlatformType, supportLevel PlatformSupportLevel, namespace string) Framework
NewFrameworkWith initialises a new test framework for the E2E suite using the existing scheme, client, platform and support level provided.
type GomegaAssertions ¶
type GomegaAssertions interface { Ω(actual interface{}, extra ...interface{}) gomega.Assertion //nolint:asciicheck Expect(actual interface{}, extra ...interface{}) gomega.Assertion ExpectWithOffset(offset int, actual interface{}, extra ...interface{}) gomega.Assertion }
GomegaAssertions is a subset of the gomega.Gomega interface. It is the set allowed for checks and conditions in the RunCheckUntil helper function.
type PlatformSupportLevel ¶
type PlatformSupportLevel int
PlatformSupportLevel is used to identify which tests should run based on the platform.
const ( // Unsupported means that the platform is not supported // by CPMS. Unsupported PlatformSupportLevel = iota // Manual means that the platform is supported by CPMS, // but the CPMS must be created manually. Manual // Full means that the platform is supported by CPMS, // and the CPMS will be created automatically. Full )