forked from cloudfoundry/csb-brokerpak-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmysql_test.go
43 lines (34 loc) · 1.25 KB
/
mysql_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
package acceptance_tests_test
import (
"csbbrokerpakaws/acceptance-tests/helpers/apps"
"csbbrokerpakaws/acceptance-tests/helpers/matchers"
"csbbrokerpakaws/acceptance-tests/helpers/random"
"csbbrokerpakaws/acceptance-tests/helpers/services"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("MySQL", Label("mysql"), func() {
It("can be accessed by an app", func() {
By("creating a service instance")
serviceInstance := services.CreateInstance("csb-aws-mysql", "small")
defer serviceInstance.Delete()
By("pushing the unstarted app twice")
appOne := apps.Push(apps.WithApp(apps.MySQL))
appTwo := apps.Push(apps.WithApp(apps.MySQL))
defer apps.Delete(appOne, appTwo)
By("binding the apps to the service instance")
binding := serviceInstance.Bind(appOne)
serviceInstance.Bind(appTwo)
By("starting the apps")
apps.Start(appOne, appTwo)
By("checking that the app environment has a credhub reference for credentials")
Expect(binding.Credential()).To(matchers.HaveCredHubRef)
By("setting a key-value using the first app")
key := random.Hexadecimal()
value := random.Hexadecimal()
appOne.PUT(value, key)
By("getting the value using the second app")
got := appTwo.GET(key)
Expect(got).To(Equal(value))
})
})