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

Proposed by Junien Fridrick on 2018-03-30
Status: Merged
Approved by: Paul Gear on 2018-04-03
Approved revision: no longer in the source branch.
Merged at revision: 101
Proposed branch: lp:~axino/mojo/mojo-specs
Merge into: lp:mojo/mojo-specs
Diff against target: 72 lines (+40/-5)
3 files modified
charm-testing/filebeat/deploy (+9/-5)
charm-testing/filebeat/post-deploy (+26/-0)
charm-testing/filebeat/pre-deploy (+5/-0)
To merge this branch: bzr merge lp:~axino/mojo/mojo-specs
Reviewer Review Type Date Requested Status
Paul Gear (community) 2018-03-30 Approve on 2018-04-03
Review via email: mp+342456@code.launchpad.net

Commit message

charm-testing/filebeat : fix for bionic

To post a comment you must log in.

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Paul Gear (paulgear) wrote :

Makes sense

review: Approve

Change successfully merged at revision 101

lp:~axino/mojo/mojo-specs updated on 2018-04-03
101. By Junien Fridrick on 2018-04-03

charm-testing/filebeat : fix for bionic

Reviewed-on: https://code.launchpad.net/~axino/mojo/mojo-specs/+merge/342456
Reviewed-by: Paul Gear <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charm-testing/filebeat/deploy'
2--- charm-testing/filebeat/deploy 2018-03-21 14:07:00 +0000
3+++ charm-testing/filebeat/deploy 2018-03-30 14:21:57 +0000
4@@ -6,13 +6,17 @@
5 filebeat:
6 charm: filebeat
7 options:
8- install_sources: deb http://archive.admin.canonical.com/other/packages.elastic.co stable main
9- elasticsearch:
10+ install_sources: 'deb http://archive.admin.canonical.com/other/packages.elastic.co stable main'
11+ elasticsearch:
12 charm: elasticsearch
13 series: trusty
14+ num_units: 2
15 options:
16- apt-key-url: http://archive.admin.canonical.com/other/artifacts.elastic.co/GPG-KEY-elasticsearch
17- apt-repository: deb http://archive.admin.canonical.com/other/artifacts.elastic.co stable main
18+ apt-key-url: 'http://archive.admin.canonical.com/other/artifacts.elastic.co/GPG-KEY-elasticsearch'
19+ apt-repository: 'deb http://archive.admin.canonical.com/other/artifacts.elastic.co stable main'
20+ nrpe-trusty:
21+ charm: nrpe
22+ series: trusty
23 nrpe:
24 charm: nrpe
25 {% if series == "xenial" or series == "bionic" %}options:
26@@ -22,4 +26,4 @@
27 - ['ubuntu', 'filebeat']
28 - ['filebeat:elasticsearch', 'elasticsearch:client']
29 - ['nrpe', 'ubuntu']
30- - ['nrpe', 'elasticsearch']
31+ - ['nrpe-trusty', 'elasticsearch']
32
33=== added file 'charm-testing/filebeat/post-deploy'
34--- charm-testing/filebeat/post-deploy 1970-01-01 00:00:00 +0000
35+++ charm-testing/filebeat/post-deploy 2018-03-30 14:21:57 +0000
36@@ -0,0 +1,26 @@
37+#!/bin/bash
38+
39+set -eu
40+
41+TEST_MESSAGE="testfilebeatmessage"
42+# filebeat doesn't process syslog by default
43+# so use auth.crit instead
44+TEST_FACILITY="auth.crit"
45+
46+echo "Starting functional testing of filebeat."
47+
48+# Generate a message in a file watched by filebeat
49+juju ssh ubuntu/0 logger -p ${TEST_FACILITY} ${TEST_MESSAGE}
50+
51+# filebeat scan_frequency defaults to 10s, so sleep for 15s
52+sleep 15
53+
54+# Check if the message made it to elasticsearch
55+hits=$(juju ssh elasticsearch/0 curl -s "localhost:9200/_search?q=${TEST_MESSAGE}"|jq '.hits.total')
56+if [ "$hits" != "1" ]; then
57+ echo "ERROR : test message not found in elasticsearch"
58+ exit 1
59+else
60+ echo "SUCCESS : test message found in elasticsearch"
61+ exit 0
62+fi
63
64=== added file 'charm-testing/filebeat/pre-deploy'
65--- charm-testing/filebeat/pre-deploy 1970-01-01 00:00:00 +0000
66+++ charm-testing/filebeat/pre-deploy 2018-03-30 14:21:57 +0000
67@@ -0,0 +1,5 @@
68+#!/bin/bash
69+
70+mkdir -p $MOJO_REPO_DIR/trusty
71+rsync -av $MOJO_REPO_DIR/bionic/elasticsearch $MOJO_REPO_DIR/trusty/
72+rsync -av $MOJO_REPO_DIR/bionic/nrpe $MOJO_REPO_DIR/trusty/

Subscribers

People subscribed via source and target branches

to all changes: