forked from cloudfoundry/cf-acceptance-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
instance_reporting.go
54 lines (45 loc) · 1.62 KB
/
instance_reporting.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-incubator/cf-test-helpers/cf"
"github.com/cloudfoundry-incubator/cf-test-helpers/workflowhelpers"
. "github.com/cloudfoundry/cf-acceptance-tests/cats_suite_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"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
. "github.com/onsi/gomega/gexec"
)
var _ = AppsDescribe("Getting instance information", func() {
Describe("scaling memory", func() {
var appName string
var runawayTestSetup *workflowhelpers.ReproducibleTestSuiteSetup
BeforeEach(func() {
runawayTestSetup = workflowhelpers.NewRunawayAppTestSuiteSetup(Config)
runawayTestSetup.Setup()
appName = random_name.CATSRandomName("APP")
Eventually(cf.Cf(
"push", appName,
"-p", assets.NewAssets().Binary,
"-b", "binary_buildpack",
"-m", DEFAULT_MEMORY_LIMIT,
"-d", Config.GetAppsDomain(),
"-c", "./app"),
Config.CfPushTimeoutDuration()).Should(Exit(0))
})
AfterEach(func() {
app_helpers.AppReport(appName)
Eventually(cf.Cf("delete", appName, "-f")).Should(Exit(0))
runawayTestSetup.Teardown()
})
It("fails with insufficient resources", func() {
scale := cf.Cf("scale", appName, "-m", workflowhelpers.RUNAWAY_QUOTA_MEM_LIMIT, "-f")
Eventually(scale).Should(Or(Say("insufficient"), Say("down")))
scale.Kill()
app := cf.Cf("app", appName)
Eventually(app).Should(Exit(0))
Expect(app.Out).NotTo(Say("instances: 1/1"))
})
})
})