Documentation ¶
Index ¶
- Constants
- Variables
- func AClusterName() string
- func ANewRackIsAddedForCluster(namespace, clusterName string, rack v1alpha1.Rack)
- func ARackIsRemovedFromCluster(namespace, clusterName, rackToRemove string)
- func AScheduledSnapshotIsAddedToCluster(namespace, clusterName string, snapshot *v1alpha1.Snapshot)
- func AScheduledSnapshotIsChangedForCluster(namespace, clusterName string, snapshot *v1alpha1.Snapshot)
- func AScheduledSnapshotIsRemovedFromCluster(namespace, clusterName string)
- func BeCreatedOnOrAfter(targetTime time.Time) types.GomegaMatcher
- func BeCreatedWithServiceName(expected string) types.GomegaMatcher
- func CassandraDefinitions(namespace string) ([]v1alpha1.Cassandra, error)
- func CassandraEventsFor(namespace, clusterName string) func() ([]coreV1.Event, error)
- func CassandraEventsSince(namespace, clusterName string, sinceTime time.Time) func() ([]coreV1.Event, error)
- func ClusterConfigHashForRack(namespace, clusterName, rack string) string
- func CronJob(namespace, jobName string) func() (*kubernetesResource, error)
- func CronJobIsDeletedSince(namespace, jobName string, initialCreationTime time.Time) func() (bool, error)
- func CronJobsForCluster(namespace, clusterName string) func() ([]*kubernetesResource, error)
- func DataCenterForCluster(namespace, clusterName string) func() (string, error)
- func DefaultJvmOptionsWithLine(lineToAppend string) string
- func DeleteCassandraResourcesForClusters(namespace string, clusterNames ...string)
- func DeleteCassandraResourcesInNamespace(namespace string)
- func DurationSeconds(seconds int32) time.Duration
- func Each(subMatcher types.GomegaMatcher) types.GomegaMatcher
- func EventuallyClusterIsCreatedWithRacks(namespace string, clusterName string, racks []v1alpha1.Rack)
- func FileExistsInConfigurationDirectory(namespace string, podName string, filename string) func() (bool, error)
- func GetMetric(metricGetterFunc func() (string, error), metricToFind string) (int, error)
- func HaveAnnotation(expected interface{}) types.GomegaMatcher
- func HaveAnnotationValue(expected interface{}) types.GomegaMatcher
- func HaveContainer(containerName string, expectation ContainerSpecExpectation) types.GomegaMatcher
- func HaveDifferentRevisionTo(rackRevisions map[string]string) types.GomegaMatcher
- func HaveEmptyDirVolumeMountAtPath(path string) types.GomegaMatcher
- func HaveEvent(expected EventExpectation) types.GomegaMatcher
- func HaveInitContainer(initContainerName string, expectation ContainerSpecExpectation) types.GomegaMatcher
- func HaveJVMArg(expectedArg string) types.GomegaMatcher
- func HaveJobSpec(expected interface{}) types.GomegaMatcher
- func HaveLabel(key, value string) types.GomegaMatcher
- func HavePersistentVolumeMountAtPath(path string) types.GomegaMatcher
- func HaveResourcesRequirements(expected *ResourceRequirementsAssertion) types.GomegaMatcher
- func HaveStorageCapacity(value string) types.GomegaMatcher
- func HaveVolumeForConfigMap(configMapName string) types.GomegaMatcher
- func HeadlessServiceForCluster(namespace, clusterName string) func() (*kubernetesResource, error)
- func Kubectl(namespace string, args ...string) (*exec.Cmd, []byte, error)
- func KubectlOutputAsString(namespace string, args ...string) string
- func OperatorMetrics(namespace string) func() (string, error)
- func ParallelTestBeforeSuite(createClustersOnce func() []TestCluster, ...) bool
- func PersistentVolumeClaimsForCluster(namespace, clusterName string) func() ([]*kubernetesResource, error)
- func PodCreationTime(namespace, podName string) func() (time.Time, error)
- func PodName(clusterName, rack string, count int) string
- func PodReadinessStatus(namespace, podName string) func() (bool, error)
- func PodReadyForCluster(namespace, clusterName string) func() (int, error)
- func PodRestartForCluster(namespace, clusterName string) func() (int, error)
- func PodSpec() *apis.PodSpecBuilder
- func PodsForCluster(namespace, clusterName string) func() ([]*kubernetesResource, error)
- func PrintDiagnosis(namespace string, testStartTime time.Time, clusterNames ...string)
- func Rack(rackName string, replicas int32) v1alpha1.Rack
- func RackWithEmptyDir(rackName string, replicas int32) v1alpha1.Rack
- func RacksForCluster(namespace, clusterName string) func() (map[string][]string, error)
- func ReportAClusterWith(expected interface{}) types.GomegaMatcher
- func ReportNoClusterMetricsFor(namespace string, clusterName string) types.GomegaMatcher
- func SequentialTestBeforeSuite(runOnce func()) bool
- func ServiceIsDeletedSince(namespace, serviceName string, initialCreationTime time.Time) func() (bool, error)
- func SnapshotConfigFromSchedule(cron string) *v1alpha1.Snapshot
- func SnapshotJobsFor(clusterName string) func() (int, error)
- func StatefulSetDeletedSince(namespace, statefulSetName string, initialCreationTime time.Time) func() (bool, error)
- func StatefulSetForRack(namespace, clusterName, rack string) (*kubernetesResource, error)
- func StatefulSetRevision(namespace, statefulSetName string) (string, error)
- func StatefulSetsForCluster(namespace, clusterName string) func() ([]*kubernetesResource, error)
- func TheBootstrapperImageImmutablePropertyIsChangedTo(namespace, clusterName, imageName string)
- func TheClusterIsDeleted(clusterName string)
- func TheClusterPodEnvVarsAreChangedTo(namespace, clusterName string, envVars *[]v1alpha1.CassEnvVar)
- func TheClusterPodResourcesSpecAreChangedTo(namespace, clusterName string, podResources coreV1.ResourceRequirements)
- func TheClusterPodSpecAreChangedTo(namespace, clusterName string, podSpec v1alpha1.Pod)
- func TheCronJobIsDeleted(namespace, jobName string)
- func TheCronjobResourcesAreChangedTo(namespace, jobName string, editedResources coreV1.ResourceRequirements)
- func TheCustomConfigHashIsChangedForRack(namespace, clusterName, rackName string)
- func TheCustomConfigIsAddedForCluster(namespace, clusterName string, extraConfigFile *ExtraConfigFile)
- func TheCustomConfigIsDeletedForCluster(namespace, clusterName string)
- func TheCustomConfigIsModifiedForCluster(namespace, clusterName string, extraConfigFile *ExtraConfigFile)
- func TheCustomJVMOptionsConfigIsChangedForCluster(namespace, clusterName, jvmOptions string)
- func TheImageImmutablePropertyIsChangedTo(namespace, clusterName, imageName string)
- func TheRackReplicationIsChangedTo(namespace, clusterName, rackName string, replicas int)
- func TheRackStorageIsChangedTo(namespace, clusterName, rackName string, storages []v1alpha1.Storage)
- func TheServiceIsDeletedFor(namespace, clusterName string)
- func TheSnapshotCleanupCronJobIsDeleted(namespace, clusterName string)
- func TheSnapshotCronJobIsDeleted(namespace, clusterName string)
- func TheStatefulSetContainerEnvVarsHaveChanged(namespace, statefulSetName string, containerName string, ...)
- func TheStatefulSetContainerImageNameIsChanged(namespace, statefulSetName string, containerName string, newImageName string)
- func TheStatefulSetContainerResourcesChanged(namespace, statefulSetName string, containerName string, ...)
- func TheStatefulSetIsDeletedForRack(namespace, clusterName, rackName string)
- func UniqueNodesUsed(namespace, clusterName string) ([]string, error)
- type AnnotationValueAssertion
- type ClusterBuilder
- func (c *ClusterBuilder) AndClusterSpec(clusterSpec *v1alpha1.CassandraSpec) *ClusterBuilder
- func (c *ClusterBuilder) AndCustomConfig(extraConfigFile *ExtraConfigFile) *ClusterBuilder
- func (c *ClusterBuilder) AndPodSpec(podSpec *v1alpha1.Pod) *ClusterBuilder
- func (c *ClusterBuilder) AndRacks(racks []v1alpha1.Rack) *ClusterBuilder
- func (c *ClusterBuilder) AndScheduledSnapshot(snapshot *v1alpha1.Snapshot) *ClusterBuilder
- func (c *ClusterBuilder) Exists() *cluster.Cluster
- func (c *ClusterBuilder) ForDatacenter(datacenter string) *ClusterBuilder
- func (c *ClusterBuilder) IsDefined() *cluster.Cluster
- func (c *ClusterBuilder) WithoutCustomConfig() *ClusterBuilder
- func (c *ClusterBuilder) WithoutRacks() *ClusterBuilder
- type ContainerEnvExpectation
- type ContainerExpectation
- type ContainerImageExpectation
- type ContainerSpecExpectation
- type EventExpectation
- type ExtraConfigFile
- type JobExpectation
- type MetricAssertion
- func ClusterSizeMetric(namespace, clusterName string, value uint) MetricAssertion
- func DownAndNormalNodeMetric(namespace, clusterName, node string, rack string, value int) MetricAssertion
- func FailedValidationMetric(namespace, clusterName string, value int) MetricAssertion
- func LiveAndNormalNodeMetric(namespace, clusterName, node string, rack string, value int) MetricAssertion
- type MetricsExpectation
- type PodEventLog
- type ResourceRequirementsAssertion
- type TestCluster
Constants ¶
const ( PodMemory = "1Gi" PodCPU = "0" )
const ( CheckInterval = 5 * time.Second EventPublicationTimeout = time.Minute )
Variables ¶
var ( KubeClientset *kubernetes.Clientset CassandraClientset *versioned.Clientset UseMockedImage bool CassandraImageName *string CassandraBootstrapperImageName *string CassandraSidecarImageName *string CassandraSnapshotImageName *string CassandraInitialDelay int32 CassandraLivenessPeriod int32 CassandraLivenessProbeFailureThreshold int32 CassandraLivenessTimeout int32 CassandraReadinessPeriod int32 CassandraReadinessProbeFailureThreshold int32 CassandraReadinessTimeout int32 NodeStartDuration time.Duration NodeRestartDuration time.Duration NodeTerminationDuration time.Duration Namespace string MaxCassandraNodesPerNamespace int CassEnv map[string]string )
Functions ¶
func AClusterName ¶
func AClusterName() string
func ARackIsRemovedFromCluster ¶
func ARackIsRemovedFromCluster(namespace, clusterName, rackToRemove string)
func AScheduledSnapshotIsRemovedFromCluster ¶
func AScheduledSnapshotIsRemovedFromCluster(namespace, clusterName string)
func BeCreatedOnOrAfter ¶
func BeCreatedOnOrAfter(targetTime time.Time) types.GomegaMatcher
BeCreatedOnOrAfter matcher
func BeCreatedWithServiceName ¶
func BeCreatedWithServiceName(expected string) types.GomegaMatcher
BeCreatedWithServiceName matcher
func CassandraDefinitions ¶
func CassandraEventsFor ¶
func CassandraEventsSince ¶
func CronJobIsDeletedSince ¶
func CronJobsForCluster ¶
func DataCenterForCluster ¶
func DeleteCassandraResourcesInNamespace ¶
func DeleteCassandraResourcesInNamespace(namespace string)
func DurationSeconds ¶
func HaveAnnotation ¶
func HaveAnnotation(expected interface{}) types.GomegaMatcher
HaveAnnotation matcher
func HaveAnnotationValue ¶
func HaveAnnotationValue(expected interface{}) types.GomegaMatcher
HaveAnnotationValue matcher
func HaveContainer ¶
func HaveContainer(containerName string, expectation ContainerSpecExpectation) types.GomegaMatcher
HaveContainer matcher
func HaveDifferentRevisionTo ¶
func HaveDifferentRevisionTo(rackRevisions map[string]string) types.GomegaMatcher
HaveDifferentRevisionTo matcher
func HaveEmptyDirVolumeMountAtPath ¶
func HaveEmptyDirVolumeMountAtPath(path string) types.GomegaMatcher
HaveEmptyDirVolumeMountAtPath
func HaveInitContainer ¶
func HaveInitContainer(initContainerName string, expectation ContainerSpecExpectation) types.GomegaMatcher
HaveInitContainer matcher
func HavePersistentVolumeMountAtPath ¶
func HavePersistentVolumeMountAtPath(path string) types.GomegaMatcher
HavePersistentVolumeMountAtPath
func HaveResourcesRequirements ¶
func HaveResourcesRequirements(expected *ResourceRequirementsAssertion) types.GomegaMatcher
HaveResourcesRequirements matcher
func HaveStorageCapacity ¶
func HaveStorageCapacity(value string) types.GomegaMatcher
HaveStorageCapacity matcher
func HaveVolumeForConfigMap ¶
func HaveVolumeForConfigMap(configMapName string) types.GomegaMatcher
HaveVolumeForConfigMap matcher
func KubectlOutputAsString ¶
func OperatorMetrics ¶
func ParallelTestBeforeSuite ¶
func ParallelTestBeforeSuite(createClustersOnce func() []TestCluster, runOnceOnEachNode func(clusterNames []string)) bool
func PodReadinessStatus ¶
func PodReadyForCluster ¶
func PodRestartForCluster ¶
func PodSpec ¶
func PodSpec() *apis.PodSpecBuilder
func PodsForCluster ¶
func PrintDiagnosis ¶
func RacksForCluster ¶
func ReportAClusterWith ¶
func ReportAClusterWith(expected interface{}) types.GomegaMatcher
ReportAClusterWith matcher
func ReportNoClusterMetricsFor ¶
func ReportNoClusterMetricsFor(namespace string, clusterName string) types.GomegaMatcher
ReportNoClusterMetricsFor matcher
func SequentialTestBeforeSuite ¶
func SequentialTestBeforeSuite(runOnce func()) bool
func ServiceIsDeletedSince ¶
func SnapshotJobsFor ¶
func StatefulSetDeletedSince ¶
func StatefulSetForRack ¶
func StatefulSetRevision ¶
func StatefulSetsForCluster ¶
func TheBootstrapperImageImmutablePropertyIsChangedTo ¶
func TheBootstrapperImageImmutablePropertyIsChangedTo(namespace, clusterName, imageName string)
func TheClusterIsDeleted ¶
func TheClusterIsDeleted(clusterName string)
func TheClusterPodEnvVarsAreChangedTo ¶
func TheClusterPodEnvVarsAreChangedTo(namespace, clusterName string, envVars *[]v1alpha1.CassEnvVar)
func TheClusterPodResourcesSpecAreChangedTo ¶
func TheClusterPodResourcesSpecAreChangedTo(namespace, clusterName string, podResources coreV1.ResourceRequirements)
func TheCronJobIsDeleted ¶
func TheCronJobIsDeleted(namespace, jobName string)
func TheCronjobResourcesAreChangedTo ¶
func TheCronjobResourcesAreChangedTo(namespace, jobName string, editedResources coreV1.ResourceRequirements)
func TheCustomConfigHashIsChangedForRack ¶
func TheCustomConfigHashIsChangedForRack(namespace, clusterName, rackName string)
func TheCustomConfigIsAddedForCluster ¶
func TheCustomConfigIsAddedForCluster(namespace, clusterName string, extraConfigFile *ExtraConfigFile)
func TheCustomConfigIsDeletedForCluster ¶
func TheCustomConfigIsDeletedForCluster(namespace, clusterName string)
func TheCustomConfigIsModifiedForCluster ¶
func TheCustomConfigIsModifiedForCluster(namespace, clusterName string, extraConfigFile *ExtraConfigFile)
func TheCustomJVMOptionsConfigIsChangedForCluster ¶
func TheCustomJVMOptionsConfigIsChangedForCluster(namespace, clusterName, jvmOptions string)
func TheImageImmutablePropertyIsChangedTo ¶
func TheImageImmutablePropertyIsChangedTo(namespace, clusterName, imageName string)
func TheServiceIsDeletedFor ¶
func TheServiceIsDeletedFor(namespace, clusterName string)
func TheSnapshotCleanupCronJobIsDeleted ¶
func TheSnapshotCleanupCronJobIsDeleted(namespace, clusterName string)
func TheSnapshotCronJobIsDeleted ¶
func TheSnapshotCronJobIsDeleted(namespace, clusterName string)
func TheStatefulSetContainerResourcesChanged ¶
func TheStatefulSetContainerResourcesChanged(namespace, statefulSetName string, containerName string, editedResources coreV1.ResourceRequirements)
func TheStatefulSetIsDeletedForRack ¶
func TheStatefulSetIsDeletedForRack(namespace, clusterName, rackName string)
func UniqueNodesUsed ¶
Types ¶
type AnnotationValueAssertion ¶
func (AnnotationValueAssertion) String ¶
func (m AnnotationValueAssertion) String() string
type ClusterBuilder ¶
type ClusterBuilder struct {
// contains filtered or unexported fields
}
func AClusterWithName ¶
func AClusterWithName(clusterName string) *ClusterBuilder
func (*ClusterBuilder) AndClusterSpec ¶
func (c *ClusterBuilder) AndClusterSpec(clusterSpec *v1alpha1.CassandraSpec) *ClusterBuilder
func (*ClusterBuilder) AndCustomConfig ¶
func (c *ClusterBuilder) AndCustomConfig(extraConfigFile *ExtraConfigFile) *ClusterBuilder
func (*ClusterBuilder) AndPodSpec ¶
func (c *ClusterBuilder) AndPodSpec(podSpec *v1alpha1.Pod) *ClusterBuilder
func (*ClusterBuilder) AndRacks ¶
func (c *ClusterBuilder) AndRacks(racks []v1alpha1.Rack) *ClusterBuilder
func (*ClusterBuilder) AndScheduledSnapshot ¶
func (c *ClusterBuilder) AndScheduledSnapshot(snapshot *v1alpha1.Snapshot) *ClusterBuilder
func (*ClusterBuilder) Exists ¶
func (c *ClusterBuilder) Exists() *cluster.Cluster
func (*ClusterBuilder) ForDatacenter ¶
func (c *ClusterBuilder) ForDatacenter(datacenter string) *ClusterBuilder
func (*ClusterBuilder) IsDefined ¶
func (c *ClusterBuilder) IsDefined() *cluster.Cluster
func (*ClusterBuilder) WithoutCustomConfig ¶
func (c *ClusterBuilder) WithoutCustomConfig() *ClusterBuilder
func (*ClusterBuilder) WithoutRacks ¶
func (c *ClusterBuilder) WithoutRacks() *ClusterBuilder
type ContainerEnvExpectation ¶
type ContainerExpectation ¶
type ContainerExpectation struct { ImageName string ContainerPorts map[string]int MemoryRequest string MemoryLimit string CPURequest string LivenessProbeTimeout time.Duration LivenessProbeFailureThreshold int32 LivenessProbePeriod time.Duration LivenessProbeInitialDelay time.Duration ReadinessProbeTimeout time.Duration ReadinessProbeFailureThreshold int32 ReadinessProbeSuccessThreshold int32 ReadinessProbePeriod time.Duration ReadinessProbeInitialDelay time.Duration CassEnv map[string]string LifecyclePreStopCommand []string }
type ContainerImageExpectation ¶
type ContainerImageExpectation struct {
ImageName string
}
type ContainerSpecExpectation ¶
type ContainerSpecExpectation interface {
// contains filtered or unexported methods
}
type EventExpectation ¶
type ExtraConfigFile ¶
type JobExpectation ¶
type MetricAssertion ¶
type MetricAssertion struct {
// contains filtered or unexported fields
}
func ClusterSizeMetric ¶
func ClusterSizeMetric(namespace, clusterName string, value uint) MetricAssertion
func DownAndNormalNodeMetric ¶
func DownAndNormalNodeMetric(namespace, clusterName, node string, rack string, value int) MetricAssertion
func FailedValidationMetric ¶
func FailedValidationMetric(namespace, clusterName string, value int) MetricAssertion
func LiveAndNormalNodeMetric ¶
func LiveAndNormalNodeMetric(namespace, clusterName, node string, rack string, value int) MetricAssertion
func (MetricAssertion) String ¶
func (m MetricAssertion) String() string
type MetricsExpectation ¶
type MetricsExpectation struct {
MetricsToCheck func() []MetricAssertion
}
type PodEventLog ¶
type PodEventLog struct {
// contains filtered or unexported fields
}
func WatchPodEvents ¶
func WatchPodEvents(namespace, clusterName string) (*PodEventLog, watch.Interface)
func (*PodEventLog) PodsNotDownAtTheSameTime ¶
func (e *PodEventLog) PodsNotDownAtTheSameTime(pod, otherPod string) (bool, error)
The basic idea is to validate no 2 pods were down at the same time. It doesn't matter which pod was first deleted. If a pod was deleted before the other pod, it should have been (re)created before the other pod is deleted. If that's not the case then 2 pods were down at one moment in time, which is the error case.
func (*PodEventLog) PodsStartedEventCount ¶
func (e *PodEventLog) PodsStartedEventCount(pod string) int