forked from cloudfoundry/cf-acceptance-tests
/
http_healthcheck.go
57 lines (44 loc) · 1.78 KB
/
http_healthcheck.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
56
57
package windows
import (
"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
"github.com/cloudfoundry-incubator/cf-test-helpers/helpers"
. "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/gexec"
)
var _ = WindowsDescribe("Http Healthcheck", func() {
var (
appName string
)
BeforeEach(func() {
appName = random_name.CATSRandomName("APP")
Expect(cf.Cf("push",
appName,
"--no-start",
"-s", Config.GetWindowsStack(),
"-b", Config.GetHwcBuildpackName(),
"-m", DEFAULT_MEMORY_LIMIT,
"-p", assets.NewAssets().Nora,
"-d", Config.GetAppsDomain()).Wait()).To(Exit(0))
})
AfterEach(func() {
app_helpers.AppReport(appName)
Expect(cf.Cf("delete", appName, "-f", "-r").Wait()).Should(Exit(0))
})
Describe("An app staged and running", func() {
It("starts with a valid http healthcheck endpoint", func() {
Expect(cf.Cf("set-health-check", appName, "http", "--endpoint", "/healthcheck").Wait()).To(Exit(0))
Expect(cf.Cf("start", appName).Wait(Config.CfPushTimeoutDuration())).To(Exit(0))
Eventually(helpers.CurlingAppRoot(Config, appName)).Should(ContainSubstring("hello i am nora"))
})
It("starts with a http healthcheck endpoint that is a redirect", func() {
Expect(cf.Cf("set-health-check", appName, "http", "--endpoint", "/redirect/healthcheck").Wait()).To(Exit(0))
Expect(cf.Cf("start", appName).Wait(Config.CfPushTimeoutDuration())).To(Exit(0))
Eventually(helpers.CurlingAppRoot(Config, appName)).Should(ContainSubstring("hello i am nora"))
})
})
})