-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmultiple_bind_configs_test.go
55 lines (44 loc) · 1.58 KB
/
multiple_bind_configs_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package main_test
import (
"fmt"
"github.com/cloudfoundry/cf-test-helpers/v2/cf"
"github.com/cloudfoundry/cf-test-helpers/v2/workflowhelpers"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("Multiple bind configs", func() {
var (
readWriteAppURL, appName, instanceName string
validBindConfigs []string
)
BeforeEach(func() {
validBindConfigs = testValues.validBindConfigs
Expect(len(validBindConfigs)).To(BeNumerically(">", 1))
instanceName, appName, readWriteAppURL = generateTestNames()
By("Enabling service-access")
enableServiceAccess(pConfig.ServiceName, cfTestSuiteSetup.RegularUserContext().Org)
By("Pushing the first app")
pushPoraNoStart(appName, false)
By("Creating a service")
createService(instanceName, testValues.validCreateServiceConfig)
})
AfterEach(func() {
workflowhelpers.AsUser(cfTestSuiteSetup.RegularUserContext(), DEFAULT_TIMEOUT, func() {
cf.Cf("logs", appName, "--recent").Wait(DEFAULT_TIMEOUT)
cf.Cf("stop", appName).Wait(DEFAULT_TIMEOUT)
cf.Cf("unbind-service", appName, instanceName).Wait(DEFAULT_TIMEOUT)
cf.Cf("delete-service", instanceName, "-f").Wait(DEFAULT_TIMEOUT)
cf.Cf("delete", appName, "-r", "-f").Wait(DEFAULT_TIMEOUT)
})
})
It("works", func() {
pushPoraNoStart(appName, false)
for _, config := range validBindConfigs {
By(fmt.Sprintf("Binding the service using config: %s", config))
bindAppToService(appName, instanceName, config)
startApp(appName)
eventuallyExpect(readWriteAppURL+"/write", "Hello Persistent World")
stopApp(appName)
}
})
})