Merge lp:~tcuthbert/mojo/mojo-specs into lp:mojo/mojo-specs

Proposed by Thomas Cuthbert
Status: Merged
Approved by: Haw Loeung
Approved revision: no longer in the source branch.
Merged at revision: 63
Proposed branch: lp:~tcuthbert/mojo/mojo-specs
Merge into: lp:mojo/mojo-specs
Diff against target: 62 lines (+47/-0)
3 files modified
charm-testing/prometheus/collect (+5/-0)
charm-testing/prometheus/deploy (+16/-0)
charm-testing/prometheus/post-deploy (+26/-0)
To merge this branch: bzr merge lp:~tcuthbert/mojo/mojo-specs
Reviewer Review Type Date Requested Status
Haw Loeung Approve
Review via email: mp+336416@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM, +1

review: Approve
lp:~tcuthbert/mojo/mojo-specs updated
63. By Haw Loeung

[tcuthbert] charm-testing: Initial commit of prometheus charm testing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'charm-testing/prometheus'
=== added file 'charm-testing/prometheus/collect'
--- charm-testing/prometheus/collect 1970-01-01 00:00:00 +0000
+++ charm-testing/prometheus/collect 2018-01-23 00:08:31 +0000
@@ -0,0 +1,5 @@
1# Services, primary charms
2prometheus cs:prometheus
3
4# subordinates
5nrpe cs:nrpe
06
=== added file 'charm-testing/prometheus/deploy'
--- charm-testing/prometheus/deploy 1970-01-01 00:00:00 +0000
+++ charm-testing/prometheus/deploy 2018-01-23 00:08:31 +0000
@@ -0,0 +1,16 @@
1prometheus:
2 series: {{series}}
3 services:
4 prometheus:
5 charm: prometheus
6 expose: true
7 options:
8 prometheus_registration_authtoken: "testing"
9 external_url: "http://prometheus.testing.local/"
10 nrpe:
11 charm: nrpe
12 {% if series == "xenial" %}options:
13 swap: '-w 90% -c 75% -n OK'{% endif %}
14
15 relations:
16 - ["prometheus:nrpe-external-master", "nrpe:nrpe-external-master"]
017
=== added file 'charm-testing/prometheus/post-deploy'
--- charm-testing/prometheus/post-deploy 1970-01-01 00:00:00 +0000
+++ charm-testing/prometheus/post-deploy 2018-01-23 00:08:31 +0000
@@ -0,0 +1,26 @@
1#!/bin/bash
2
3PROMETHEUS=$(juju status --format=yaml prometheus 2>&1 | sed -nr '/^ {8}public-address/s/.*://p')
4
5if [ -z "${PROMETHEUS}" ]; then
6 echo "No prometheus instances"
7 exit 1
8fi
9
10for UNIT in ${PROMETHEUS}; do
11
12 echo "Calling unit to ensure it returns: 'up' metrics"
13 echo 'curl -f -s -S -v http://${UNIT}:9090/api/v1/query?query=up'
14 curl -f -s -S -v http://${UNIT}:9090/api/v1/query?query=up
15 if [ $? -ne 0 ]; then
16 echo "####################"
17 echo "# E2E Check Failed #"
18 echo "####################"
19 exit 1
20 fi
21done
22
23# If we are here it means no checks failed
24echo "####################"
25echo "# E2E Check Passed #"
26echo "####################"

Subscribers

People subscribed via source and target branches

to all changes: