framework

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TF         Framework
	StepNumber int
)

Functions

func BaseSetup

func BaseSetup(t *testing.T) error

func BuildManilaCephFSDriver

func BuildManilaCephFSDriver(osdpl *unstructured.Unstructured, params *ManilaConfigParams) (map[string]interface{}, error)

func CustomTeardown

func CustomTeardown(t *testing.T, customTeardown func() error)

func GenerateOsdRemoveTasks

func GenerateOsdRemoveTasks(tasksSpecString string) ([]*cephlcmv1alpha.CephOsdRemoveTask, error)

func GetConfigForTestCase

func GetConfigForTestCase(t *testing.T) map[string]string

func GetKubeconfig

func GetKubeconfig(url, fileName string) error

func GetNewPool

func GetNewPool(name string, useAsfullName, volumeExpansion bool, size int, role, mapOptions string, deviceClass string) cephlcmv1alpha.CephPool

func GetRgwPublicEndpoint

func GetRgwPublicEndpoint(cdhName string) (string, error)

func GetSecretForRgwCreds

func GetSecretForRgwCreds(cdSecret, userName string) (*corev1.Secret, error)

func IsStatefulsetReady

func IsStatefulsetReady(sts *appsv1.StatefulSet) bool

func ReadNodeStorageConfig

func ReadNodeStorageConfig(nodesConfig string) (map[string]rookv1.Node, error)

func ReadSharedFilesystemConfig

func ReadSharedFilesystemConfig(sharedFilesystemConfigString string) ([]string, *cephlcmv1alpha.CephSharedFilesystem, error)

func Setup

func Setup(fc *TestConfig) error

func SetupTeardown

func SetupTeardown(t *testing.T) func()

func SetupWithCustomTeardown

func SetupWithCustomTeardown(t *testing.T, customTeardown func() error) func()

func Step

func Step(t *testing.T, msg string, args ...interface{})

func Teardown

func Teardown() error

func UpdateCephDeploymentSpec

func UpdateCephDeploymentSpec(cdUpdated *cephlcmv1alpha.CephDeployment, waitReadiness bool) error

func WaitForStatusReady

func WaitForStatusReady(name string) error

Types

type CaseSettings

type CaseSettings struct {
	Name   string            `yaml:"name"`
	Config map[string]string `yaml:"config"`
}

type CinderListItem

type CinderListItem struct {
	Name   string `json:"Name,omitempty"`
	Status string `json:"Status,omitempty"`
	Size   int    `json:"Size,omitempty"`
}

type CinderShow

type CinderShow struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Status      string `json:"status,omitempty"`
	Size        int    `json:"size,omitempty"`
	Type        string `json:"type,omitempty"`
	Attachments []struct {
		VolumeID string `json:"volume_id,omitempty"`
		ServerID string `json:"server_id,omitempty"`
		Device   string `json:"device,omitempty"`
	} `json:"attachments,omitempty"`
}

type CinderTypeListItem

type CinderTypeListItem struct {
	Name string `json:"Name,omitempty"`
}

type Framework

type Framework struct {
	ManagedCluster       *ManagedConfig
	InitialClusterState  *StoreState
	PreviousClusterState *StoreState
	TestConfig           *TestConfig
	Log                  zerolog.Logger
	E2eImage             string
}

type GlanceListItem

type GlanceListItem struct {
	Name   string `json:"Name,omitempty"`
	Status string `json:"Status,omitempty"`
}

type GlanceShow

type GlanceShow struct {
	Name      string `json:"name,omitempty"`
	Status    string `json:"status,omitempty"`
	Size      int    `json:"size,omitempty"`
	Locations []struct {
		URL string `json:"url,omitempty"`
	} `json:"locations,omitempty"`
}

type ManagedConfig

type ManagedConfig struct {
	Context                 context.Context
	Client                  client.Client
	DynamicClient           dynamic.Interface
	KubeClient              *kubernetes.Clientset
	CephDplClient           cephlcmclient.CephDeploymentInterface
	CephDplSecretClient     cephlcmclient.CephDeploymentSecretInterface
	CephHealthClient        cephlcmclient.CephDeploymentHealthInterface
	CephOsdRemoveTaskClient cephlcmclient.CephOsdRemoveTaskInterface
	RookClientset           *rookclient.Clientset
	KubeConfig              *rest.Config
	LcmConfig               lcmconfig.LcmConfig
	LcmNamespace            string
	OpenstackClient         *OpenstackClient
}

func NewManagedCluster

func NewManagedCluster(cephdeployNamespace string, config *rest.Config) (*ManagedConfig, error)

func (*ManagedConfig) CinderVolumeCreate

func (c *ManagedConfig) CinderVolumeCreate(name string, size int, volumeType string, waiting bool) (*CinderShow, error)

func (*ManagedConfig) CinderVolumeDelete

func (c *ManagedConfig) CinderVolumeDelete(name string, waiting bool) error

func (*ManagedConfig) CinderVolumeList

func (c *ManagedConfig) CinderVolumeList() ([]CinderListItem, error)

func (*ManagedConfig) CinderVolumeShow

func (c *ManagedConfig) CinderVolumeShow(name string) (*CinderShow, error)

func (*ManagedConfig) CinderVolumeTypeList

func (c *ManagedConfig) CinderVolumeTypeList() ([]CinderTypeListItem, error)

func (*ManagedConfig) CreateAWSCliDeployment

func (c *ManagedConfig) CreateAWSCliDeployment(name string, label string, testImage string, awsConfig string, sslSecretName string, ingressIP string, endpoint string) (*appsv1.Deployment, error)

func (*ManagedConfig) CreateAndWaitOsdRemoveTask

func (c *ManagedConfig) CreateAndWaitOsdRemoveTask(task *cephlcmv1alpha.CephOsdRemoveTask) error

func (*ManagedConfig) CreateCephDeployment

func (c *ManagedConfig) CreateCephDeployment(cephdpl *cephlcmv1alpha1.CephDeployment) error

func (*ManagedConfig) CreateConfigMap

func (c *ManagedConfig) CreateConfigMap(cm *corev1.ConfigMap) error

func (*ManagedConfig) CreateDeployment

func (c *ManagedConfig) CreateDeployment(deploy *appsv1.Deployment) error

func (*ManagedConfig) CreateManilaShare

func (c *ManagedConfig) CreateManilaShare(name string, shareClientName string) (string, string, error)

func (*ManagedConfig) CreateManilaShareType

func (c *ManagedConfig) CreateManilaShareType() error

func (*ManagedConfig) CreateOsdRemoveTask

func (c *ManagedConfig) CreateOsdRemoveTask(task *cephlcmv1alpha.CephOsdRemoveTask) error

func (*ManagedConfig) CreatePVC

func (c *ManagedConfig) CreatePVC(pvc *corev1.PersistentVolumeClaim) error

func (*ManagedConfig) CreatePod

func (c *ManagedConfig) CreatePod(pod *corev1.Pod) error

func (*ManagedConfig) CreateSecret

func (c *ManagedConfig) CreateSecret(secret *corev1.Secret) error

func (*ManagedConfig) DeleteConfigMap

func (c *ManagedConfig) DeleteConfigMap(name, namespace string) error

func (*ManagedConfig) DeleteDeployment

func (c *ManagedConfig) DeleteDeployment(name, namespace string) error

func (*ManagedConfig) DeleteManilaShare

func (c *ManagedConfig) DeleteManilaShare(name string) error

func (*ManagedConfig) DeleteManilaShareType

func (c *ManagedConfig) DeleteManilaShareType() error

func (*ManagedConfig) DeleteOsdRemoveTask

func (c *ManagedConfig) DeleteOsdRemoveTask(name string) error

func (*ManagedConfig) DeletePVC

func (c *ManagedConfig) DeletePVC(name, namespace string) error

func (*ManagedConfig) DeletePod

func (c *ManagedConfig) DeletePod(name, namespace string) error

func (*ManagedConfig) DeleteSSHPod

func (c *ManagedConfig) DeleteSSHPod(name string) error

func (*ManagedConfig) DeleteSecret

func (c *ManagedConfig) DeleteSecret(name, namespace string) error

func (*ManagedConfig) ExecSSHPod

func (c *ManagedConfig) ExecSSHPod(ip, cmd string, sshPod *corev1.Pod) (string, error)

func (*ManagedConfig) FindCephDeployment

func (c *ManagedConfig) FindCephDeployment() (*cephlcmv1alpha1.CephDeployment, error)

func (*ManagedConfig) GetCephBlockPool

func (c *ManagedConfig) GetCephBlockPool(name string) (*rookv1.CephBlockPool, error)

func (*ManagedConfig) GetCephClient

func (c *ManagedConfig) GetCephClient(name string) (*rookv1.CephClient, error)

func (*ManagedConfig) GetCephCluster

func (c *ManagedConfig) GetCephCluster(clusterName string) (*rookv1.CephCluster, error)

func (*ManagedConfig) GetCephDeployment

func (c *ManagedConfig) GetCephDeployment(cdName string) (*cephlcmv1alpha1.CephDeployment, error)

func (*ManagedConfig) GetCephDeploymentHealth

func (c *ManagedConfig) GetCephDeploymentHealth(clusterName string) (*cephlcmv1alpha1.CephDeploymentHealth, error)

func (*ManagedConfig) GetCephDeploymentSecret

func (c *ManagedConfig) GetCephDeploymentSecret(name string) (*cephlcmv1alpha1.CephDeploymentSecret, error)

func (*ManagedConfig) GetConfigMap

func (c *ManagedConfig) GetConfigMap(name, namespace string) (*corev1.ConfigMap, error)

func (*ManagedConfig) GetDeployment

func (c *ManagedConfig) GetDeployment(name, namespace string) (*appsv1.Deployment, error)

func (*ManagedConfig) GetIngress

func (c *ManagedConfig) GetIngress(name, namespace string) (*networkingv1.Ingress, error)

func (*ManagedConfig) GetKeystonePod

func (c *ManagedConfig) GetKeystonePod() (*v1.Pod, string, error)

func (*ManagedConfig) GetOpenstackDeployment

func (c *ManagedConfig) GetOpenstackDeployment() (*unstructured.Unstructured, error)

func (*ManagedConfig) GetOpenstackDeploymentStatusState

func (c *ManagedConfig) GetOpenstackDeploymentStatusState() (string, error)

func (*ManagedConfig) GetOsdRemoveTask

func (c *ManagedConfig) GetOsdRemoveTask(taskName, taskNamespace string) (*cephlcmv1alpha.CephOsdRemoveTask, error)

func (*ManagedConfig) GetPVC

func (c *ManagedConfig) GetPVC(name, namespace string) (*corev1.PersistentVolumeClaim, error)

func (*ManagedConfig) GetPodByLabel

func (c *ManagedConfig) GetPodByLabel(namespace, label string) (*corev1.Pod, error)

func (*ManagedConfig) GetPodLogs

func (c *ManagedConfig) GetPodLogs(name string, namespace string) (string, error)

func (*ManagedConfig) GetSecret

func (c *ManagedConfig) GetSecret(name, namespace string) (*corev1.Secret, error)

func (*ManagedConfig) GetService

func (c *ManagedConfig) GetService(name, namespace string) (*corev1.Service, error)

func (*ManagedConfig) GetStatefulset

func (c *ManagedConfig) GetStatefulset(name, namespace string) (*appsv1.StatefulSet, error)

func (*ManagedConfig) GetStorageClass

func (c *ManagedConfig) GetStorageClass(name string) (*v1storage.StorageClass, error)

func (*ManagedConfig) GlanceImageDelete

func (c *ManagedConfig) GlanceImageDelete(name string, waiting bool) error

func (*ManagedConfig) GlanceImageList

func (c *ManagedConfig) GlanceImageList() ([]GlanceListItem, error)

func (*ManagedConfig) GlanceImageShow

func (c *ManagedConfig) GlanceImageShow(name string) (*GlanceShow, error)

func (*ManagedConfig) HeatStackCreate

func (c *ManagedConfig) HeatStackCreate(name, defaultsPath, templatePath string) error

func (*ManagedConfig) HeatStackDelete

func (c *ManagedConfig) HeatStackDelete(name string) error

func (*ManagedConfig) HeatStackOutputShow

func (c *ManagedConfig) HeatStackOutputShow(stackName, outputKey string) (*StackOutputShow, error)

func (*ManagedConfig) HeatStackShow

func (c *ManagedConfig) HeatStackShow(name string) (*StackShow, error)

func (*ManagedConfig) IsDeploymentScaled

func (c *ManagedConfig) IsDeploymentScaled(namespace, name string, replicas int32) (bool, error)

func (*ManagedConfig) KeypairCreate

func (c *ManagedConfig) KeypairCreate(name string, privateFile string) (string, error)

func (*ManagedConfig) KeypairDelete

func (c *ManagedConfig) KeypairDelete(name string, privateFile string) error

func (*ManagedConfig) ListCephDeployment

func (c *ManagedConfig) ListCephDeployment() ([]cephlcmv1alpha1.CephDeployment, error)

func (*ManagedConfig) ListCephObjectStore

func (c *ManagedConfig) ListCephObjectStore() ([]rookv1.CephObjectStore, error)

func (*ManagedConfig) ListDeployments

func (c *ManagedConfig) ListDeployments(namespace string, labels ...string) (*appsv1.DeploymentList, error)

func (*ManagedConfig) ListNodes

func (c *ManagedConfig) ListNodes() ([]corev1.Node, error)

func (*ManagedConfig) ListPods

func (c *ManagedConfig) ListPods(namespace, label string) ([]corev1.Pod, error)

func (*ManagedConfig) ListStorageClass

func (c *ManagedConfig) ListStorageClass() (*v1storage.StorageClassList, error)

func (*ManagedConfig) NewSSHPod

func (c *ManagedConfig) NewSSHPod(name string, privKeySecretName string) (*corev1.Pod, error)

func (*ManagedConfig) NovaServerAddVolume

func (c *ManagedConfig) NovaServerAddVolume(serverName, volumeName string) (string, error)

func (*ManagedConfig) NovaServerCreate

func (c *ManagedConfig) NovaServerCreate(name, flavor, keypair, image, network string, waiting bool) (*NovaShow, error)

func (*ManagedConfig) NovaServerDelete

func (c *ManagedConfig) NovaServerDelete(name string, waiting bool) error

func (*ManagedConfig) NovaServerDisablePortSecurity

func (c *ManagedConfig) NovaServerDisablePortSecurity(serverName string) error

func (*ManagedConfig) NovaServerImageCreate

func (c *ManagedConfig) NovaServerImageCreate(serverName, imageName string, waiting bool) (*GlanceShow, error)

func (*ManagedConfig) NovaServerList

func (c *ManagedConfig) NovaServerList() ([]NovaListItem, error)

func (*ManagedConfig) NovaServerMigrate

func (c *ManagedConfig) NovaServerMigrate(name string, waiting bool) (*NovaShow, error)

func (*ManagedConfig) NovaServerMigrateAction

func (c *ManagedConfig) NovaServerMigrateAction(name string, action string, waiting bool) (*NovaShow, error)

func (*ManagedConfig) NovaServerReboot

func (c *ManagedConfig) NovaServerReboot(name string, hard bool, waiting bool) (*NovaShow, error)

func (*ManagedConfig) NovaServerRemoveVolume

func (c *ManagedConfig) NovaServerRemoveVolume(serverName, volumeName string) error

func (*ManagedConfig) NovaServerShow

func (c *ManagedConfig) NovaServerShow(name string) (*NovaShow, error)

func (*ManagedConfig) OpenstackClientSet

func (c *ManagedConfig) OpenstackClientSet() error

func (*ManagedConfig) RunCephToolsCommand

func (c *ManagedConfig) RunCephToolsCommand(command string) (string, error)

func (*ManagedConfig) RunCommand

func (c *ManagedConfig) RunCommand(command, namespace string, labels ...string) (string, string, error)

func (*ManagedConfig) RunOpenstackCommand

func (c *ManagedConfig) RunOpenstackCommand(command string) (string, string, error)

func (*ManagedConfig) RunPodCommand

func (c *ManagedConfig) RunPodCommand(command, containerName string, pod *corev1.Pod) (string, string, error)

func (*ManagedConfig) RunPodCommandWithContent

func (c *ManagedConfig) RunPodCommandWithContent(command, containerName string, pod *corev1.Pod, content string) (string, string, error)

func (*ManagedConfig) ScaleDeployment

func (c *ManagedConfig) ScaleDeployment(deployName, namespace string, replicas int32) error

func (*ManagedConfig) SwiftContainerCreate

func (c *ManagedConfig) SwiftContainerCreate(name string) error

func (*ManagedConfig) SwiftContainerDelete

func (c *ManagedConfig) SwiftContainerDelete(name string) error

func (*ManagedConfig) SwiftObjectDownload

func (c *ManagedConfig) SwiftObjectDownload(containerName, objectName string) (string, error)

func (*ManagedConfig) SwiftObjectUpload

func (c *ManagedConfig) SwiftObjectUpload(containerName, objectName, testString string) error

func (*ManagedConfig) UpdateCephDeploymentSpec

func (c *ManagedConfig) UpdateCephDeploymentSpec(cephDpl *cephlcmv1alpha1.CephDeployment) (bool, error)

func (*ManagedConfig) UpdateFileSSHPod

func (c *ManagedConfig) UpdateFileSSHPod(ip, path, content string, sshPod *corev1.Pod) error

func (*ManagedConfig) UpdateNode

func (c *ManagedConfig) UpdateNode(node *corev1.Node) error

func (*ManagedConfig) UpdateOpenstackDeployment

func (c *ManagedConfig) UpdateOpenstackDeployment(data map[string]interface{}, waitApplied bool) error

func (*ManagedConfig) UpdateOsdRemoveTask

func (c *ManagedConfig) UpdateOsdRemoveTask(task *cephlcmv1alpha.CephOsdRemoveTask) error

func (*ManagedConfig) UpdatePVC

func (c *ManagedConfig) UpdatePVC(pvc *corev1.PersistentVolumeClaim) error

func (*ManagedConfig) WaitCephOsdRemoveTaskFinished

func (c *ManagedConfig) WaitCephOsdRemoveTaskFinished(task *cephlcmv1alpha.CephOsdRemoveTask) error

func (*ManagedConfig) WaitDeploymentReady

func (c *ManagedConfig) WaitDeploymentReady(deployName, deployNamespace string) error

func (*ManagedConfig) WaitForCephDeploymentHealthReady

func (c *ManagedConfig) WaitForCephDeploymentHealthReady(clusterName string) error

func (*ManagedConfig) WaitForCephDeploymentReady

func (c *ManagedConfig) WaitForCephDeploymentReady(cdName string) error

type ManilaConfigParams

type ManilaConfigParams struct {
	MonEndpoints     string
	CephFsName       string
	CephFsClientName string
	CephFsClientKey  string
}

type ManilaExportLocationItem

type ManilaExportLocationItem struct {
	ID        string `json:"ID,omitempty"`
	Path      string `json:"Path,omitempty"`
	Preferred bool   `json:"Preferred,omitempty"`
}

type ManilaShareAccessItem

type ManilaShareAccessItem struct {
	ID        string `json:"ID,omitempty"`
	AccessKey string `json:"Access Key,omitempty"`
	AccessTo  string `json:"Access To,omitempty"`
}

type NovaEventListItem

type NovaEventListItem struct {
	ID        string `json:"Request ID,omitempty"`
	Action    string `json:"Action,omitempty"`
	StartTime string `json:"Start Time,omitempty"`
}

type NovaEventShow

type NovaEventShow struct {
	Events []struct {
		Event      string `json:"event,omitempty"`
		StartTime  string `json:"start_time,omitempty"`
		FinishTime string `json:"finish_time,omitempty"`
		Result     string `json:"result,omitempty"`
	} `json:"events,omitempty"`
}

type NovaListItem

type NovaListItem struct {
	Name   string `json:"Name,omitempty"`
	Status string `json:"Status,omitempty"`
}

type NovaShow

type NovaShow struct {
	ID        string              `json:"id,omitempty"`
	Name      string              `json:"name,omitempty"`
	Status    string              `json:"status,omitempty"`
	Flavor    string              `json:"flavor,omitempty"`
	Image     string              `json:"image,omitempty"`
	Power     int                 `json:"OS-EXT-STS:power_state,omitempty"`
	Host      string              `json:"OS-EXT-SRV-ATTR:host"`
	Keypair   string              `json:"key_name,omitempty"`
	Addresses map[string][]string `json:"addresses,omitempty"`
	Volumes   []struct {
		ID string `json:"id,omitempty"`
	} `json:"volumes_attached,omitempty"`
}

type OpenstackClient

type OpenstackClient struct {
	KeystonePod *v1.Pod
	Container   string
}

type PortListItem

type PortListItem struct {
	ID       string `json:"ID,omitempty"`
	FixedIPs []struct {
		IP string `json:"ip_address,omitempty"`
	} `json:"Fixed IP Addresses,omitempty"`
	Status string `json:"Status,omitempty"`
}

type SecurityGroupListItem

type SecurityGroupListItem struct {
	Name string `json:"Name,omitempty"`
	ID   string `json:"ID,omitempty"`
}

type StackOutputShow

type StackOutputShow struct {
	Key   string `json:"output_key,omitempty"`
	Value string `json:"output_value,omitempty"`
}

type StackShow

type StackShow struct {
	Name   string `json:"stack_name,omitempty"`
	Status string `json:"stack_status,omitempty"`
}

type StoreState

type StoreState struct {
	CephDeployment *cephlcmv1alpha1.CephDeployment
	CephCluster    *rookv1.CephCluster
	ExportDir      string
}

func NewStoreState

func NewStoreState() (*StoreState, error)

func (*StoreState) ConvertStateToJSON

func (s *StoreState) ConvertStateToJSON() (state []byte, err error)

func (*StoreState) CopyState

func (s *StoreState) CopyState(t *StoreState)

func (*StoreState) ExportStoreState

func (s *StoreState) ExportStoreState(dirname string) error

func (*StoreState) RestoreStoredState

func (s *StoreState) RestoreStoredState() error

type TestConfig

type TestConfig struct {
	Cases    []string     `yaml:"testCases"`
	Settings TestSettings `yaml:"testSettings,omitempty"`
}

func GetFrameworkConfig

func GetFrameworkConfig() (*TestConfig, error)

type TestSettings

type TestSettings struct {
	Namespace      string         `yaml:"namespace,omitempty"`
	CaseSettings   []CaseSettings `yaml:"caseSettings,omitempty"`
	KubeconfigURL  string         `yaml:"kubeconfigUrl,omitempty"`
	KubeconfigFile string         `yaml:"kubeconfigFile,omitempty"`
	KeepAfter      bool           `yaml:"keepAfter,omitempty"`
	SkipStoreState bool           `yaml:"skipStoreState,omitempty"`
}

Jump to

Keyboard shortcuts

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