testhelpers

package
v0.0.0-...-e3dcd6b Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const TestFailureMessage = `
*****************************************

TEST FAILURE

*****************************************
`

Variables

This section is empty.

Functions

func CheckForRequiredEnvVars

func CheckForRequiredEnvVars(envs []string)

CheckForRequiredEnvVars asserts that environment variables in envs must be set to a non-empty string. If any environment variable in the slice is not set, an error will be returned denoting which variable is unset.

func DownloadManifest

func DownloadManifest(deploymentName string) string

DownloadManifest downloads the manifest for deployment deploymentName into a temporary file. It returns the filename path as a string. It is up to the caller to delete this file when they are done with the manifest.

func ExecuteBosh

func ExecuteBosh(args []string, timeout time.Duration) *gexec.Session

func ExecuteBoshNoOutput

func ExecuteBoshNoOutput(args []string, timeout time.Duration) *gexec.Session

func ExecuteMysqlQuery

func ExecuteMysqlQuery(deploymentName, instanceIndex, userName, password, sqlQuery string) *gexec.Session

ExecuteMysqlQuery executes sqlQuery against the MySQL deployment denoted by deploymentName and instance instanceIndex, using credentials in userName and password. It returns a pointer to a gexec.Session to be consumed.

func ExecuteMysqlQueryAsAdmin

func ExecuteMysqlQueryAsAdmin(deploymentName, instanceIndex, sqlQuery string) string

ExecuteMysqlQueryAsAdmin is a convenience function for calling ExecuteMysqlQuery as the admin user, asserting that the mysql command exits cleanly and returns the output as a string

func GetManifestValue

func GetManifestValue(deploymentName, xPath string) string

GetManifestValue fetches a value from deploymentName's manifest at the path xPath

func Interpolate

func Interpolate(manifestPath string, selector string) string

Interpolate interpolates the xPath selector against the manifest file at manifestPath and returns the resulting YAML as a string.

func MustSucceed

func MustSucceed(session *gexec.Session) *gexec.Session

func ProperYaml

func ProperYaml(improperYaml string) []byte

Types

type Instance

type Instance struct {
	IP           string
	Index        string
	UUID         string
	VmCid        string
	ProcessState string
}

func FindFollower

func FindFollower(deploymentName string) *Instance

FindFollower find a follower VM in deploymentName

func FindLeader

func FindLeader(deploymentName string) *Instance

FindLeader find a leader VM in deploymentName

func GetMySQLInstancesSortedByIndex

func GetMySQLInstancesSortedByIndex(boshDeployment string) []Instance

type TestCerts

type TestCerts struct {
	CaPEM      string
	SSLCertPEM string
	SSLKeyPEM  string

	MockClientTLSConfig          *tls.Config
	MockServerTLSConfig          *tls.Config
	MockServerNonMutualTLSConfig *tls.Config
}

func GetTestCerts

func GetTestCerts(domains []string) TestCerts

Jump to

Keyboard shortcuts

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