-
Notifications
You must be signed in to change notification settings - Fork 39
/
getting-started-test-example.yaml
77 lines (75 loc) · 3.03 KB
/
getting-started-test-example.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Getting Started Blueprint Test
location:
jclouds:aws-ec2:
identity: ABCDEFGHIJKLMNOPQRST
credential: s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l
services:
- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
name: My Web
id: webappcluster
brooklyn.config:
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
java.sysprops:
brooklyn.example.db.url: >
$brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
entity("db").attributeWhenReady("datastore.url"),
"visitors", "brooklyn", $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
- type: org.apache.brooklyn.entity.database.mysql.MySqlNode
id: db
name: My DB
brooklyn.config:
creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
datastore.creation.script.template.url: https://bit.ly/brooklyn-visitors-creation-script
- type: org.apache.brooklyn.test.framework.TestHttpCall
name: Check HTTP Response Status Code
brooklyn.config:
url: >
$brooklyn:formatString("http://%s:%s",
$brooklyn:entity("webappcluster").attributeWhenReady("host.address"),
$brooklyn:entity("webappcluster").attributeWhenReady("proxy.http.port"))
timeout: 10m
applyAssertionTo: status
assert:
- isEqualTo: 200
- type: org.apache.brooklyn.test.framework.TestHttpCall
name: Check HTTP Response Body
brooklyn.config:
url: >
$brooklyn:formatString("http://%s:%s",
$brooklyn:entity("webappcluster").attributeWhenReady("host.address"),
$brooklyn:entity("webappcluster").attributeWhenReady("proxy.http.port"))
timeout: 10m
applyAssertionTo: body
assert:
- matches: "(?s).*Br[o]{2}klyn Deployed.*"
- type: org.apache.brooklyn.test.framework.TestCase
name: Check Deploy Effector
brooklyn.children:
- type: org.apache.brooklyn.test.framework.TestSensor
name: Check webappcluster isUp
brooklyn.config:
targetId: webappcluster
sensor: service.isUp
timeout: 10m
assert:
- equals: true
- type: org.apache.brooklyn.test.framework.TestEffector
name: Invoke Deploy Effector
brooklyn.config:
targetId: webappcluster
effector: deploy
timeout: 5m
params:
url: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
targetName: newcontext
- type: org.apache.brooklyn.test.framework.TestHttpCall
name: Check Deployed Webapp Status Code
brooklyn.config:
timeout: 5m
url: >
$brooklyn:formatString("http://%s:%s/newcontext/",
$brooklyn:entity("webappcluster").attributeWhenReady("host.address"),
$brooklyn:entity("webappcluster").attributeWhenReady("proxy.http.port"))
applyAssertionTo: status
assert:
- isEqualTo: 200