test_helpers

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	BoshPath = "/usr/local/bin/bosh"
)

Variables

This section is empty.

Functions

func AppUUID

func AppUUID(name string) string

func AssertAppIsDeleted

func AssertAppIsDeleted(appName string)

func BindAppToService

func BindAppToService(appName string, instance string)

func BindAppToServiceWithUsername

func BindAppToServiceWithUsername(appName, instance, username string)

func BoundAppGUIDs

func BoundAppGUIDs(instanceGUID string) []string

func CheckAppInfo

func CheckAppInfo(skipSSLValidation bool, appURI string, instance string)

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 CreateAndBindServiceToApp

func CreateAndBindServiceToApp(serviceName, planName, appName, appPath, instanceName string)

func CreateInstanceAndWait

func CreateInstanceAndWait(args ...string) string

func CreateService

func CreateService(serviceName string, planName string, name string, args ...string)

func CreateServiceKey

func CreateServiceKey(instanceName, keyName string)

func DeleteApp

func DeleteApp(appName string)

func DeleteAppAndService

func DeleteAppAndService(appName, instance string)

func DeleteInstanceAndWait

func DeleteInstanceAndWait(instanceName string)

func DeleteService

func DeleteService(name string)

func DeleteServiceKey

func DeleteServiceKey(instanceName, keyName string)

func DeployApp

func DeployApp(appName string)

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 ExecuteCfCmd

func ExecuteCfCmd(args ...string) string

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 GetDeploymentName

func GetDeploymentName(instanceName string) string

func GetManifestValue

func GetManifestValue(deploymentName, xPath string) string

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

func InstanceDeploymentName

func InstanceDeploymentName(instanceUUID string) string

func InstanceUUID

func InstanceUUID(name string) string

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 ManageInstanceProcesses

func ManageInstanceProcesses(deploymentName, task, instance string)

func MustSucceed

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

func OpenDatabaseTunnelToApp

func OpenDatabaseTunnelToApp(port int, appName string, serviceKey ServiceKey) context.CancelFunc

func ProperYaml

func ProperYaml(improperYaml string) []byte

func PushApp

func PushApp(appName, appCodePath string)

func ReadData

func ReadData(skipSSLValidation bool, appURI string, id string) string

func ResourceExists

func ResourceExists(resourceType string, resourceName string) bool

func StartApp

func StartApp(appName string)

func UnbindAppFromService

func UnbindAppFromService(appName string, instance string)

func WaitForService

func WaitForService(name string, success string)

func WriteData

func WriteData(skipSSLValidation bool, appURI string, value string) string

Types

type BindingResult

type BindingResult struct {
	Resources []Resource `json:"resources"`
}

type Entity

type Entity struct {
	AppGUID string `json:"app_guid"`
}

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 Resource

type Resource struct {
	Entity Entity `json:"entity"`
}

type ServiceKey

type ServiceKey struct {
	Hostname string `json:"hostname"`
	JbdcUrl  string `json:"jbdcUrl"`
	Name     string `json:"name"`
	Password string `json:"password"`
	Port     int    `json:"port"`
	Uri      string `json:"uri"`
	Username string `json:"username"`
	TLS      struct {
		Cert struct {
			CA string
		}
	}
}

func GetServiceKey

func GetServiceKey(serviceInstanceName, serviceKeyName string) ServiceKey

Directories

Path Synopsis
poll_cf
cf

Jump to

Keyboard shortcuts

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