MCPcopy Index your code
hub / github.com/cloudfoundry/cli / SetupReadOnlyOrgAndSpace

Function SetupReadOnlyOrgAndSpace

integration/helpers/org_and_space.go:14–26  ·  view source on GitHub ↗

SetupReadOnlyOrgAndSpace creates a randomly-named org containing two randomly-named spaces. It creates a new CF_HOME directory to run these commands, then deletes it afterwards.

()

Source from the content-addressed store, hash-verified

12// spaces. It creates a new CF_HOME directory to run these commands, then deletes it
13// afterwards.
14func SetupReadOnlyOrgAndSpace() (string, string) {
15 homeDir := SetHomeDir()
16 SetAPI()
17 LoginCF()
18 orgName := NewOrgName()
19 spaceName1 := NewSpaceName()
20 spaceName2 := NewSpaceName()
21 Eventually(CF("create-org", orgName)).Should(Exit(0))
22 Eventually(CF("create-space", spaceName1, "-o", orgName)).Should(Exit(0))
23 Eventually(CF("create-space", spaceName2, "-o", orgName)).Should(Exit(0))
24 DestroyHomeDir(homeDir)
25 return orgName, spaceName1
26}
27
28// CreateAndTargetOrg creates a randomly-named org and targets it.
29func CreateAndTargetOrg() string {

Callers 4

CommonGinkgoSetupFunction · 0.92

Calls 7

SetHomeDirFunction · 0.85
SetAPIFunction · 0.85
LoginCFFunction · 0.85
NewOrgNameFunction · 0.85
NewSpaceNameFunction · 0.85
CFFunction · 0.85
DestroyHomeDirFunction · 0.85

Tested by

no test coverage detected