forked from cloudfoundry/cf-acceptance-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app_bits_copy.go
54 lines (45 loc) · 1.69 KB
/
app_bits_copy.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
package apps
import (
. "github.com/cloudfoundry/cf-acceptance-tests/cats_suite_helpers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
"github.com/cloudfoundry-incubator/cf-test-helpers/helpers"
"github.com/cloudfoundry/cf-acceptance-tests/helpers/app_helpers"
"github.com/cloudfoundry/cf-acceptance-tests/helpers/assets"
"github.com/cloudfoundry/cf-acceptance-tests/helpers/random_name"
)
var _ = AppsDescribe("Copy app bits", func() {
var golangAppName string
var helloWorldAppName string
BeforeEach(func() {
golangAppName = random_name.CATSRandomName("APP")
helloWorldAppName = random_name.CATSRandomName("APP")
Expect(cf.Cf("push", golangAppName,
"--no-start",
"-b", Config.GetRubyBuildpackName(),
"-m", DEFAULT_MEMORY_LIMIT,
"-p", assets.NewAssets().Golang,
"-d", Config.GetAppsDomain(),
).Wait()).To(Exit(0))
Expect(cf.Cf("push", helloWorldAppName,
"--no-start",
"-m", DEFAULT_MEMORY_LIMIT,
"-p", assets.NewAssets().HelloWorld,
"-d", Config.GetAppsDomain(),
).Wait()).To(Exit(0))
})
AfterEach(func() {
app_helpers.AppReport(golangAppName)
app_helpers.AppReport(helloWorldAppName)
Expect(cf.Cf("delete", golangAppName, "-f", "-r").Wait()).To(Exit(0))
Expect(cf.Cf("delete", helloWorldAppName, "-f", "-r").Wait()).To(Exit(0))
})
It("Copies over the package from the source app to the destination app", func() {
Expect(cf.Cf("copy-source", helloWorldAppName, golangAppName).Wait(Config.CfPushTimeoutDuration())).To(Exit(0))
Eventually(func() string {
return helpers.CurlAppRoot(Config, golangAppName)
}).Should(ContainSubstring("Hello, world!"))
})
})