utils

package
v0.13.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Deis = "deis "

Deis points to the CLI used to run tests.

Functions

func AppsDestroyTest added in v0.11.0

func AppsDestroyTest(t *testing.T, params *DeisTestConfig)

AppsDestroyTest destroys a Deis app and checks that it was successful.

func AuthCancel added in v0.11.0

func AuthCancel(t *testing.T, params *DeisTestConfig)

AuthCancel tests whether `deis auth:cancel` destroys a user's account.

func BuildTag added in v0.12.0

func BuildTag() string

BuildTag returns the $BUILD_TAG environment variable or `git rev-parse` output.

func Chdir

func Chdir(app string) error

Chdir sets the current working directory to the relative path specified.

func CheckList added in v0.11.0

func CheckList(
	t *testing.T, cmd string, params interface{}, contain string, notflag bool)

CheckList executes a command and optionally tests whether its output does or does not contain a given string.

func CreateFile

func CreateFile(path string) error

CreateFile creates an empty file at the specified path.

func Curl added in v0.11.0

func Curl(t *testing.T, params *DeisTestConfig)

Curl connects to a Deis endpoint to see if the example app is running.

func Execute added in v0.11.0

func Execute(t *testing.T, cmd string, params interface{}, failFlag bool, expect string)

Execute takes command string and parameters required to execute the command, a failflag to check whether the command is expected to fail, and an expect string to check whether the command has failed according to failflag.

If failflag is true and the command failed, check the stdout and stderr for the expect string.

func GetRandomApp added in v0.11.0

func GetRandomApp() string

GetRandomApp returns a known working example app at random for testing.

func HostAddress added in v0.12.0

func HostAddress() string

HostAddress returns the host IP for accessing etcd and Deis services.

func Hostname added in v0.13.0

func Hostname() string

Hostname returns the hostname of the machine running the container, *not* the local machine We infer the hostname because we don't necessarily know how to log in.

func NewID added in v0.11.0

func NewID() string

NewID returns the first part of a random RFC 4122 UUID See http://play.golang.org/p/4FkNSiUDMg

func RandomPort added in v0.12.0

func RandomPort() string

RandomPort returns an unused TCP listen port on the host.

func Rmdir

func Rmdir(app string) error

Rmdir removes a directory and its contents.

func RunCommandWithStdoutStderr

func RunCommandWithStdoutStderr(cmd *exec.Cmd) (bytes.Buffer, bytes.Buffer, error)

RunCommandWithStdoutStderr execs a command and returns its output.

Types

type DeisTestConfig added in v0.11.0

type DeisTestConfig struct {
	AuthKey     string
	Hosts       string
	Domain      string
	SSHKey      string
	ClusterName string
	UserName    string
	Password    string
	Email       string
	ExampleApp  string
	AppName     string
	ProcessNum  string
	ImageID     string
	Version     string
	AppUser     string
}

DeisTestConfig allows tests to be repeated against different targets, with different example apps, using specific credentials, and so on.

func GetGlobalConfig added in v0.11.0

func GetGlobalConfig() *DeisTestConfig

GetGlobalConfig returns a test configuration object.

Jump to

Keyboard shortcuts

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