testing

package
v1.0.1-0...-b3ee44d Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package testing contains methods to create test data. It's a seaparate package to avoid import cycles. Helper functions can be found in the package `testhelper`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONDump

func JSONDump(props interface{})

JSONDump pretty prints a struct

func PrettyPrint

func PrettyPrint(i interface{}) string

PrettyPrint returns the interface as indented JSON

Types

type Catalog

type Catalog struct{}

Catalog provides several instances for tests

func (*Catalog) AnnotatedPod

func (c *Catalog) AnnotatedPod(name string, annotations map[string]string) corev1.Pod

AnnotatedPod defines a pod with annotations

func (*Catalog) BOSHDeploymentWithWrongTypeOps

func (c *Catalog) BOSHDeploymentWithWrongTypeOps(name, manifestRef string, opsRef string) bdv1.BOSHDeployment

BOSHDeploymentWithWrongTypeOps a deployment CR with wrong type ops

func (*Catalog) BOSHManifestCFRouting

func (c *Catalog) BOSHManifestCFRouting() (*manifest.Manifest, error)

BOSHManifestCFRouting returns a manifest for the CF routing release with an underscore in the name

func (*Catalog) BOSHManifestConfigMap

func (c *Catalog) BOSHManifestConfigMap(name string, text string) corev1.ConfigMap

BOSHManifestConfigMap creates a config map containing the BOSH manifest

func (*Catalog) BOSHManifestFromKubeCF641

func (c *Catalog) BOSHManifestFromKubeCF641() (*manifest.Manifest, error)

BOSHManifestFromKubeCF641 for "real-life" tests

func (*Catalog) BOSHManifestSecret

func (c *Catalog) BOSHManifestSecret(name string, text string) corev1.Secret

BOSHManifestSecret returns a secret containing the BOSH manifest

func (*Catalog) BOSHManifestWithAbsentBPMInfo

func (c *Catalog) BOSHManifestWithAbsentBPMInfo() (*manifest.Manifest, error)

BOSHManifestWithAbsentBPMInfo for data gathering tests

func (*Catalog) BOSHManifestWithActivePassiveProbes

func (c *Catalog) BOSHManifestWithActivePassiveProbes() (*manifest.Manifest, error)

BOSHManifestWithActivePassiveProbes returns a manifest with an active/passive probe

func (*Catalog) BOSHManifestWithBPMRelease

func (c *Catalog) BOSHManifestWithBPMRelease() (*manifest.Manifest, error)

BOSHManifestWithBPMRelease returns a manifest with single BPM configuration

func (c *Catalog) BOSHManifestWithExternalLinks() (*manifest.Manifest, error)

BOSHManifestWithExternalLinks returns a manifest with external links Also usable in integration tests

func (*Catalog) BOSHManifestWithGlobalUpdateBlock

func (c *Catalog) BOSHManifestWithGlobalUpdateBlock() (*manifest.Manifest, error)

BOSHManifestWithGlobalUpdateBlock returns a manifest with a global update block

func (c *Catalog) BOSHManifestWithLinks() (*manifest.Manifest, error)

BOSHManifestWithLinks returns a manifest with explicit and implicit BOSH links Also usable in integration tests

func (*Catalog) BOSHManifestWithMultiBPMProcesses

func (c *Catalog) BOSHManifestWithMultiBPMProcesses() (*manifest.Manifest, error)

BOSHManifestWithMultiBPMProcesses returns a manifest with multi BPM configuration

func (*Catalog) BOSHManifestWithMultiBPMProcessesAndPersistentDisk

func (c *Catalog) BOSHManifestWithMultiBPMProcessesAndPersistentDisk() (*manifest.Manifest, error)

BOSHManifestWithMultiBPMProcessesAndPersistentDisk returns a manifest with multi BPM configuration and persistent disk

func (*Catalog) BOSHManifestWithNilConsume

func (c *Catalog) BOSHManifestWithNilConsume() (*manifest.Manifest, error)

BOSHManifestWithNilConsume returns a manifest with a nil consume for the job

func (*Catalog) BOSHManifestWithOverriddenBPMInfo

func (c *Catalog) BOSHManifestWithOverriddenBPMInfo() (*manifest.Manifest, error)

BOSHManifestWithOverriddenBPMInfo for data gathering tests

func (*Catalog) BOSHManifestWithProviderAndConsumer

func (c *Catalog) BOSHManifestWithProviderAndConsumer() (*manifest.Manifest, error)

BOSHManifestWithProviderAndConsumer for data gathering tests

func (*Catalog) BOSHManifestWithResources

func (c *Catalog) BOSHManifestWithResources() (*manifest.Manifest, error)

BOSHManifestWithResources for data gathering tests

func (*Catalog) BOSHManifestWithUpdateSerial

func (c *Catalog) BOSHManifestWithUpdateSerial() (*manifest.Manifest, error)

BOSHManifestWithUpdateSerial returns a manifest with update serial

func (*Catalog) BOSHManifestWithUpdateSerialAndWithoutPorts

func (c *Catalog) BOSHManifestWithUpdateSerialAndWithoutPorts() (*manifest.Manifest, error)

BOSHManifestWithUpdateSerialAndWithoutPorts returns a manifest with update serial and without ports

func (*Catalog) BOSHManifestWithUpdateSerialInManifest

func (c *Catalog) BOSHManifestWithUpdateSerialInManifest() (*manifest.Manifest, error)

BOSHManifestWithUpdateSerialInManifest returns a manifest with update serial in manifest

func (*Catalog) BOSHManifestWithZeroInstances

func (c *Catalog) BOSHManifestWithZeroInstances() (*manifest.Manifest, error)

BOSHManifestWithZeroInstances for data gathering tests

func (*Catalog) BPMReleaseWithAffinity

func (c *Catalog) BPMReleaseWithAffinity() (*manifest.Manifest, error)

BPMReleaseWithAffinity returns a manifest with affinity

func (*Catalog) BPMReleaseWithTolerations

func (c *Catalog) BPMReleaseWithTolerations() (*manifest.Manifest, error)

BPMReleaseWithTolerations returns a manifest with tolerations

func (*Catalog) CustomOpsConfigMap

func (c *Catalog) CustomOpsConfigMap(name string, change string) corev1.ConfigMap

CustomOpsConfigMap is an operations file with a custom structural change

func (*Catalog) CustomOpsSecret

func (c *Catalog) CustomOpsSecret(name string, change string) corev1.Secret

CustomOpsSecret is an operations file with a custom structural change

func (*Catalog) DefaultBOSHDeployment

func (c *Catalog) DefaultBOSHDeployment(name, manifestRef string) bdv1.BOSHDeployment

DefaultBOSHDeployment a deployment CR

func (*Catalog) DefaultBOSHDeploymentWithOps

func (c *Catalog) DefaultBOSHDeploymentWithOps(name, manifestRef string, opsRef string) bdv1.BOSHDeployment

DefaultBOSHDeploymentWithOps a deployment CR with ops

func (*Catalog) DefaultBOSHManifest

func (c *Catalog) DefaultBOSHManifest() (*manifest.Manifest, error)

DefaultBOSHManifest returns a BOSH manifest for unit tests

func (*Catalog) DefaultCA

func (c *Catalog) DefaultCA(name string, ca credsgen.Certificate) corev1.Secret

DefaultCA for use in tests

func (*Catalog) DefaultConfig

func (c *Catalog) DefaultConfig() *config.Config

DefaultConfig for tests

func (*Catalog) DefaultPod

func (c *Catalog) DefaultPod(name string) corev1.Pod

DefaultPod defines a pod with a simple web server useful for testing

func (*Catalog) DefaultQuarksLinkSecret

func (c *Catalog) DefaultQuarksLinkSecret(deploymentName, linkType string) corev1.Secret

DefaultQuarksLinkSecret has default values from the nats release

func (*Catalog) DummyService

func (c *Catalog) DummyService(serviceName string) corev1.Service

DummyService for use in tests

func (*Catalog) EchoContainer

func (c *Catalog) EchoContainer(name string) corev1.Container

EchoContainer returns a container which just "echo" for use in tests

func (*Catalog) ElaboratedBOSHManifest

func (c *Catalog) ElaboratedBOSHManifest() (*manifest.Manifest, error)

ElaboratedBOSHManifest for data gathering tests

func (*Catalog) EmptyBOSHDeployment

func (c *Catalog) EmptyBOSHDeployment(name, manifestRef string) bdv1.BOSHDeployment

EmptyBOSHDeployment empty deployment CR

func (*Catalog) EntangledPod

func (c *Catalog) EntangledPod(deploymentName string) corev1.Pod

EntangledPod is a pod which has annotations for a BOSH link

func (*Catalog) InterpolateBOSHDeployment

func (c *Catalog) InterpolateBOSHDeployment(name, manifestRef, opsRef string, secretRef string) bdv1.BOSHDeployment

InterpolateBOSHDeployment a deployment CR

func (*Catalog) NatsConfigMap

func (c *Catalog) NatsConfigMap(deployName string) corev1.ConfigMap

NatsConfigMap returns a ConfigMap used to test native-to-bosh quarks-links

func (*Catalog) NatsEndpoints

func (c *Catalog) NatsEndpoints(deployName string) corev1.Endpoints

NatsEndpoints is used to test native-to-bosh quarks-links

func (*Catalog) NatsOtherSecret

func (c *Catalog) NatsOtherSecret(deployName string) corev1.Secret

NatsOtherSecret is used to test native-to-bosh quarks-links

func (*Catalog) NatsPod

func (c *Catalog) NatsPod(deployName string) corev1.Pod

NatsPod returns a Pod used to test native-to-bosh quarks-links

func (*Catalog) NatsSecret

func (c *Catalog) NatsSecret(deployName string) corev1.Secret

NatsSecret is used to test native-to-bosh quarks-links

func (*Catalog) NatsService

func (c *Catalog) NatsService(deployName string) corev1.Service

NatsService is used to test native-to-bosh quarks-links

func (*Catalog) NatsServiceExternalName

func (c *Catalog) NatsServiceExternalName(deployName string) corev1.Service

NatsServiceExternalName is used to test native-to-bosh quarks-links

func (*Catalog) NatsServiceForEndpoint

func (c *Catalog) NatsServiceForEndpoint(deployName string) corev1.Service

NatsServiceForEndpoint is used to test native-to-bosh quarks-links

func (*Catalog) NodePortService

func (c *Catalog) NodePortService(name, ig string, targetPort int32) corev1.Service

NodePortService returns a Service of type NodePort

func (*Catalog) PodWithTailLogsContainer

func (c *Catalog) PodWithTailLogsContainer(podName string, parentPodCmd string, parentCName string, sidecardCName string, dockerImg string) corev1.Pod

PodWithTailLogsContainer will generate a pod with two containers One is the parent container that will execute a cmd, preferrable something that writes into files under /var/vcap/sys/log The side-car container, will be tailing the logs of specific files under /var/vcap/sys/log, by running the quarks-operator util tail-logs subcmommand

func (*Catalog) QuarksLinkSecret

func (c *Catalog) QuarksLinkSecret(deploymentName, linkType, linkName string, value map[string][]byte) corev1.Secret

QuarksLinkSecret returns a link secret, as generated for consumption by an external (non BOSH) consumer

func (*Catalog) SecretBOSHDeployment

func (c *Catalog) SecretBOSHDeployment(name, manifestRef string) bdv1.BOSHDeployment

SecretBOSHDeployment a deployment CR which expects the BOSH manifest in a secret. The name needs to match the name inside the referenced manifest.

func (*Catalog) Sleep1hPodSpec

func (c *Catalog) Sleep1hPodSpec() corev1.PodSpec

Sleep1hPodSpec defines a simple pod that sleeps 60*60s for testing

func (*Catalog) StorageClassSecret

func (c *Catalog) StorageClassSecret(name string, class string) corev1.Secret

StorageClassSecret for tests

func (*Catalog) UserExplicitPassword

func (c *Catalog) UserExplicitPassword(name, password string) corev1.Secret

UserExplicitPassword is a secret representing an explicit var, used as a password

func (*Catalog) VersionedSecret

func (c *Catalog) VersionedSecret(name string) corev1.Secret

VersionedSecret for tests

func (*Catalog) WaitingPod

func (c *Catalog) WaitingPod(name string, serviceList ...string) corev1.Pod

WaitingPod is a pod which has the wait-for annotation for use in tests

func (*Catalog) WrongTypeBOSHDeployment

func (c *Catalog) WrongTypeBOSHDeployment(name, manifestRef string) bdv1.BOSHDeployment

WrongTypeBOSHDeployment a deployment CR containing wrong type

Directories

Path Synopsis
Package boshmanifest contains text assets for BOSH manifests and ops files
Package boshmanifest contains text assets for BOSH manifests and ops files
Package boshreleases contains test manifests for bpm related unit tests
Package boshreleases contains test manifests for bpm related unit tests

Jump to

Keyboard shortcuts

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