operationtesting

package
v0.0.0-...-c3f02f9 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestSubscriptionID            = "00000000-0000-0000-0000-000000000000"
	TestResourceGroupName         = "test-rg"
	TestClusterName               = "test-cluster"
	TestNodePoolName              = "test-nodepool"
	TestExternalAuthName          = "test-external-auth"
	TestClusterServiceIDStr       = "/api/clusters_mgmt/v1/clusters/abc123"
	TestNodePoolIDStr             = "/api/aro_hcp/v1alpha1/clusters/abc123/node_pools/test-nodepool"
	TestExternalAuthIDStr         = "/api/clusters_mgmt/v1/clusters/abc123/external_auth_config/external_auths/ea123"
	TestBreakGlassCredentialIDStr = "/api/clusters_mgmt/v1/clusters/abc123/break_glass_credentials/bgc123"
	TestOperationName             = "test-operation-id"
	TestTenantID                  = "11111111-1111-1111-1111-111111111111"
	TestAzureLocation             = "eastus"
	TestClusterUID                = "00000000-0000-0000-0000-000000000000"
)

Common test constants

Variables

This section is empty.

Functions

func ClusterUpdateMatchingHostedClusterSpec

func ClusterUpdateMatchingHostedClusterSpec() v1beta1.HostedClusterSpec

ClusterUpdateMatchingHostedClusterSpec returns a HostedCluster spec that matches the default cluster fixture for cluster update state calculation tests.

func ExternalAuthUpdateMatchingHostedClusterSpec

func ExternalAuthUpdateMatchingHostedClusterSpec() v1beta1.HostedClusterSpec

ExternalAuthUpdateMatchingHostedClusterSpec returns a HostedCluster spec that matches NewExternalAuthUpdateTestExternalAuth for external auth update state calculation tests.

func ExternalAuthUpdateMatchingOIDCProvider

func ExternalAuthUpdateMatchingOIDCProvider() configv1.OIDCProvider

ExternalAuthUpdateMatchingOIDCProvider returns an OIDCProvider that matches NewExternalAuthUpdateTestExternalAuth for external auth update state calculation tests.

func MustParseTime

func MustParseTime(s string) time.Time

MustParseTime parses a time string in RFC3339 format and panics on error. Use for test constants to make date values more readable.

func NewExternalAuthUpdateTestExternalAuth

func NewExternalAuthUpdateTestExternalAuth(mutate ...func(*coreapi.HCPOpenShiftClusterExternalAuth)) *coreapi.HCPOpenShiftClusterExternalAuth

NewExternalAuthUpdateTestExternalAuth returns an external auth whose properties match ExternalAuthUpdateMatchingOIDCProvider for external auth update state calculation tests.

func NewHostedClusterReadDesire

func NewHostedClusterReadDesire(t *testing.T, hostedCluster *v1beta1.HostedCluster, conditions ...metav1.Condition) *kubeapplierapi.ReadDesire

NewHostedClusterReadDesire builds a kube-applier ReadDesire fixture wrapping the given HostedCluster. When no conditions are supplied it defaults to a successful observation. Shared across the resource operations test packages.

Types

type ClusterTestFixture

type ClusterTestFixture struct {
	ClusterResourceID         *azcorearm.ResourceID
	OperationID               *azcorearm.ResourceID
	CosmosOperationResourceID *azcorearm.ResourceID
	ClusterInternalID         metadataapi.InternalID
}

ClusterTestFixture contains common test objects for cluster operations

func NewClusterTestFixture

func NewClusterTestFixture() *ClusterTestFixture

func (*ClusterTestFixture) NewCluster

func (f *ClusterTestFixture) NewCluster(createdAt *time.Time) *coreapi.HCPOpenShiftCluster

func (*ClusterTestFixture) NewOperation

func (*ClusterTestFixture) OperationKey

type ExternalAuthTestFixture

type ExternalAuthTestFixture struct {
	ClusterResourceID         *azcorearm.ResourceID
	ExternalAuthResourceID    *azcorearm.ResourceID
	OperationID               *azcorearm.ResourceID
	CosmosOperationResourceID *azcorearm.ResourceID
	ClusterInternalID         metadataapi.InternalID
	ExternalAuthInternalID    metadataapi.InternalID
}

ExternalAuthTestFixture contains common test objects for external auth operations

func NewExternalAuthTestFixture

func NewExternalAuthTestFixture() *ExternalAuthTestFixture

func (*ExternalAuthTestFixture) NewCluster

func (*ExternalAuthTestFixture) NewExternalAuth

func (*ExternalAuthTestFixture) NewOperation

func (*ExternalAuthTestFixture) OperationKey

type NodePoolTestFixture

type NodePoolTestFixture struct {
	ClusterResourceID         *azcorearm.ResourceID
	NodePoolResourceID        *azcorearm.ResourceID
	OperationID               *azcorearm.ResourceID
	CosmosOperationResourceID *azcorearm.ResourceID
	ClusterInternalID         metadataapi.InternalID
	NodePoolInternalID        metadataapi.InternalID
}

NodePoolTestFixture contains common test objects for node pool operations

func NewNodePoolTestFixture

func NewNodePoolTestFixture() *NodePoolTestFixture

func (*NodePoolTestFixture) NewCluster

func (*NodePoolTestFixture) NewNodePool

func (*NodePoolTestFixture) NewNodePoolVersionController

func (f *NodePoolTestFixture) NewNodePoolVersionController(conditions []metav1.Condition) *coreapi.Controller

func (*NodePoolTestFixture) NewOperation

func (*NodePoolTestFixture) NewServiceProviderNodePool

func (f *NodePoolTestFixture) NewServiceProviderNodePool() *coreapi.ServiceProviderNodePool

func (*NodePoolTestFixture) OperationKey

Jump to

Keyboard shortcuts

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