testutil

package
v0.0.0-...-c53321b Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KopiaRepositoryServerAdminUser        = "admin@test"
	KopiaRepositoryServerAdminPassword    = "admin1234"
	KopiaRepositoryServerHost             = "localhost"
	KopiaRepositoryPassword               = "test1234"
	KopiaRepositoryUser                   = "repository-user"
	KopiaRepositoryServerAccessUser       = "kanister-user"
	KopiaRepositoryServerAccessPassword   = "test1234"
	KanisterNamespace                     = "kanister"
	KopiaRepositoryPath                   = "kopia-repo-path-test"
	DefaultKopiaRepositoryServerContainer = "repo-server-container"
)
View Source
const (
	TestS3BucketName = "tests.kanister.io"
	TestS3Region     = "us-west-2"
)
View Source
const (
	FailFuncName            = "FailFunc"
	WaitFuncName            = "WaitFunc"
	ArgFuncName             = "ArgFunc"
	OutputFuncName          = "OutputFunc"
	CancelFuncName          = "CancelFunc"
	VersionMismatchFuncName = "VerMisFunc"
	TestVersion             = "v1.0.0"
)
View Source
const TestProfileName = "test-profile"

Variables

This section is empty.

Functions

func ActionSetWithConfigMap

func ActionSetWithConfigMap(as *crv1alpha1.ActionSet, name string) *crv1alpha1.ActionSet

ActionSetWithConfigMap function returns a pointer to a new ActionSet test object with CongigMap

func ArgFuncArgs

func ArgFuncArgs() map[string]interface{}

func BlueprintWithConfigMap

func BlueprintWithConfigMap(bp *crv1alpha1.Blueprint) *crv1alpha1.Blueprint

BlueprintWithConfigMap function returns a pointer to a new Blueprint test object with CongigMap

func CancelFuncOut

func CancelFuncOut() error

func CancelFuncStarted

func CancelFuncStarted() struct{}

func CreateSecret

func CreateSecret(cli kubernetes.Interface, namespace, name string, secrettype corev1.SecretType, data map[string][]byte) (se *corev1.Secret, err error)

func CreateTestKopiaRepository

func CreateTestKopiaRepository(cli kubernetes.Interface, rs *crv1alpha1.RepositoryServer, storageLocation map[string][]byte) error

func FailFuncError

func FailFuncError() error

func GetDefaultS3CompliantStorageLocation

func GetDefaultS3CompliantStorageLocation() map[string][]byte

func GetDefaultS3StorageCreds

func GetDefaultS3StorageCreds(c *check.C) map[string][]byte

func GetEnvOrSkip

func GetEnvOrSkip(c *check.C, varName string) string

func GetFileStoreLocationSecretData

func GetFileStoreLocationSecretData(claimName string) map[string][]byte

func GetKopiaTLSSecretData

func GetKopiaTLSSecretData() (map[string][]byte, error)

func GetObjectstoreLocation

func GetObjectstoreLocation() (objectstore.ProviderType, crv1alpha1.Location)

GetObjectstoreLocation finds out which location to use based on creds set as env vars

func GetRepoPasswordSecretData

func GetRepoPasswordSecretData(password string) map[string][]byte

func GetRepoServerAdminSecretData

func GetRepoServerAdminSecretData(username, password string) map[string][]byte

func GetRepoServerUserAccessSecretData

func GetRepoServerUserAccessSecretData(hostname, password string) map[string][]byte

func GetTestKopiaRepositoryServerCR

func GetTestKopiaRepositoryServerCR(namespace string) crv1alpha1.RepositoryServer

func NewProfile

func NewProfile(location crv1alpha1.Location) *crv1alpha1.Profile

NewProfile function returns a pointer to a new Profile object that passes validation.

func NewProfileSecret

func NewProfileSecret(data map[string]string) *corev1.Secret

NewProfileSecret function returns a pointer to a new Secret test object.

func NewSecretProfileFromLocation

func NewSecretProfileFromLocation(location crv1alpha1.Location) (*corev1.Secret, *crv1alpha1.Profile, error)

NewSecretProfileFromLocation figures out Provider type from the location type and returns a pointer to Secret and Profile

func NewTestActionSet

func NewTestActionSet(namespace, blueprintName, poKind, poName, poNamespace, version, action string) *crv1alpha1.ActionSet

NewTestActionSet function returns a pointer to a new ActionSet test object

func NewTestBlueprint

func NewTestBlueprint(poKind string, phaseFuncs ...string) *crv1alpha1.Blueprint

NewTestBlueprint function returns a pointer to a new Blueprint test object

func NewTestConfigMap

func NewTestConfigMap() *corev1.ConfigMap

NewTestConfigMap function returns a pointer to a new ConfigMap test object

func NewTestDeployment

func NewTestDeployment(replicas int32) *appsv1.Deployment

NewTestDeployment function returns a pointer to a new Deployment test object

func NewTestNamespace

func NewTestNamespace() *corev1.Namespace

NewTestNamespace function returns a pointer to a new Namespace test object

func NewTestPVC

func NewTestPVC() *corev1.PersistentVolumeClaim

NewTestPVC function returns a pointer to a new PVC test object

func NewTestProfile

func NewTestProfile(namespace string, secretName string) *crv1alpha1.Profile

NewTestProfile function returns a pointer to a new Profile test object that passes validation.

func NewTestProfileSecret

func NewTestProfileSecret() *corev1.Secret

NewTestProfileSecret function returns a pointer to a new Secret test object.

func NewTestProfileSecretWithRole

func NewTestProfileSecretWithRole(role string) *corev1.Secret

NewTestProfileSecretWithRole function returns a pointer to a new Secret test object with role.

func NewTestRestoreActionSet

func NewTestRestoreActionSet(namespace, blueprintName, poName string, arts map[string]crv1alpha1.Artifact) *crv1alpha1.ActionSet

NewTestRestoreActionSet returns a pointer to a restore actionset, that is used in deferPhase blueprint

func NewTestStatefulSet

func NewTestStatefulSet(replicas int32) *appsv1.StatefulSet

NewTestStatefulSet function returns a pointer to a new StatefulSet test object

func ObjectStoreProfileOrSkip

func ObjectStoreProfileOrSkip(c *check.C, osType objectstore.ProviderType, location crv1alpha1.Location) *param.Profile

func OutputFuncOut

func OutputFuncOut() map[string]interface{}

func ReleaseWaitFunc

func ReleaseWaitFunc()

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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