tests

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SingleNodeLabel             = "SINGLE_NODE_ONLY"
	HighlyAvailableClusterLabel = "HIGHLY_AVAILABLE_CLUSTER"
	OpenshiftLabel              = "OpenShift"

	TestNamespace = "hco-test-default"
)

labels

View Source
const (
	ConfigFileFlag = "config-file"
)

Variables

View Source
var (
	KubeVirtStorageClassLocal string
	InstallNamespace          string
)

Functions

func BeforeEach

func BeforeEach(ctx context.Context)

func CreateTempOperatorRoute added in v1.16.0

func CreateTempOperatorRoute(ctx context.Context, cli client.Client) error

CreateTempOperatorRoute creates a route to the HCO prometheus endpoint, to allow reading the metrics.

func CreateTempWebhookRoute added in v1.16.0

func CreateTempWebhookRoute(ctx context.Context, cli client.Client) error

CreateTempWebhookRoute creates a route to the HCO prometheus endpoint, to allow reading the metrics.

func DeleteTempOperatorRoute added in v1.16.0

func DeleteTempOperatorRoute(ctx context.Context, cli client.Client) error

func DeleteTempWebhookRoute added in v1.16.0

func DeleteTempWebhookRoute(ctx context.Context, cli client.Client) error

func FailIfHighAvailableCluster added in v1.14.0

func FailIfHighAvailableCluster(singleWorkerCluster bool)

func FailIfNotOpenShift added in v1.13.0

func FailIfNotOpenShift(ctx context.Context, cli client.Client, testName string)

func FailIfSingleNodeCluster added in v1.14.0

func FailIfSingleNodeCluster(singleWorkerCluster bool)

func FlagParse added in v1.1.0

func FlagParse()

func GetClientConfig added in v1.13.0

func GetClientConfig() *rest.Config

func GetControllerRuntimeClient added in v1.13.0

func GetControllerRuntimeClient() client.Client

func GetHCO added in v1.13.0

GetHCO reads the HCO CR from the APIServer with a DynamicClient

func GetK8sClientSet added in v1.13.0

func GetK8sClientSet() *kubernetes.Clientset

func IsOpenShift

func IsOpenShift(ctx context.Context, cli client.Client) (bool, error)

func PatchHCO added in v1.13.0

func PatchHCO(ctx context.Context, cli client.Client, patchBytes []byte) error

PatchHCO updates the HCO CR using a DynamicClient, it can return errors on failures

func PatchMergeHCO added in v1.16.0

func PatchMergeHCO(ctx context.Context, cli client.Client, patchBytes []byte) error

PatchMergeHCO patches the HCO CR using a DynamicClient, it can return errors on failures

func RestoreDefaults added in v1.13.0

func RestoreDefaults(ctx context.Context, cli client.Client)

func UpdateHCO added in v1.13.0

UpdateHCO updates the HCO CR using a DynamicClient, it can return errors on failures

func UpdateHCORetry added in v1.13.0

func UpdateHCORetry(ctx context.Context, cli client.Client, input *v1beta1.HyperConverged) *v1beta1.HyperConverged

UpdateHCORetry updates the HCO CR in a safe way internally calling UpdateHCO_old UpdateHCORetry internally uses an async Eventually block refreshing the in-memory object if needed and setting there Spec, Annotations, Finalizers and Labels from the input object. UpdateHCORetry should be preferred over UpdateHCO_old to reduce test flakiness due to inevitable concurrency conflicts

Types

type DashboardTestConfig added in v1.13.0

type DashboardTestConfig struct {
	TestItems []DashboardTestItem `yaml:"testItems,omitempty"`
}

type DashboardTestItem added in v1.13.0

type DashboardTestItem struct {
	Name      string `yaml:"name,omitempty"`
	Namespace string `yaml:"namespace,omitempty"`
	// keys expected in the configmap
	Keys []string `yaml:"keys,omitempty"`
}

type DataImportCronConfig added in v1.13.0

type DataImportCronConfig struct {
	ExpectedDataImportCrons []string            `yaml:"expectedDataImportCrons,omitempty"`
	ExpectedImageStream     []ImageStreamConfig `yaml:"expectedImageStream,omitempty"`
	Namespace               string              `yaml:"namespace,omitempty"`
}

type HCOPrometheusClient added in v1.13.0

type HCOPrometheusClient struct {
	// contains filtered or unexported fields
}

func GetHCOPrometheusClient added in v1.13.0

func GetHCOPrometheusClient(ctx context.Context, cli client.Client) (*HCOPrometheusClient, error)

func GetWebhookPrometheusClient added in v1.16.0

func GetWebhookPrometheusClient(ctx context.Context, cli client.Client) (*HCOPrometheusClient, error)

func (HCOPrometheusClient) GetHCOMetric added in v1.13.0

func (hcoCli HCOPrometheusClient) GetHCOMetric(ctx context.Context, query string) (float64, error)

type ImageStreamConfig added in v1.13.0

type ImageStreamConfig struct {
	Name         string   `yaml:"name"`
	RegistryName string   `yaml:"registryName"`
	UsageImages  []string `yaml:"usageImages,omitempty"`
}

type QuickStartTestConfig added in v1.4.1

type QuickStartTestConfig struct {
	TestItems []QuickStartTestItem `yaml:"testItems,omitempty"`
}

type QuickStartTestItem added in v1.4.1

type QuickStartTestItem struct {
	Name        string `yaml:"name,omitempty"`
	DisplayName string `yaml:"displayName,omitempty"`
}

type TestConfig added in v1.4.1

type TestConfig struct {
	QuickStart     QuickStartTestConfig `yaml:"quickStart,omitempty"`
	Dashboard      DashboardTestConfig  `yaml:"dashboard,omitempty"`
	DataImportCron DataImportCronConfig `yaml:"dataImportCron,omitempty"`
}

func GetConfig added in v1.4.1

func GetConfig() *TestConfig

Jump to

Keyboard shortcuts

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