Merge lp:~mthaddon/mojo/charm-testing-squid into lp:mojo/mojo-specs

Proposed by Tom Haddon
Status: Work in progress
Proposed branch: lp:~mthaddon/mojo/charm-testing-squid
Merge into: lp:mojo/mojo-specs
Diff against target: 101 lines (+79/-0) (has conflicts)
4 files modified
charm-testing/squid-reverseproxy/collect (+6/-0)
charm-testing/squid-reverseproxy/deploy (+20/-0)
charm-testing/squid-reverseproxy/post-deploy (+49/-0)
charm-testing/squid-reverseproxy/templates/vhost-http.tmpl (+4/-0)
Conflict adding file charm-testing/squid-reverseproxy.  Moved existing file to charm-testing/squid-reverseproxy.moved.
To merge this branch: bzr merge lp:~mthaddon/mojo/charm-testing-squid
Reviewer Review Type Date Requested Status
Mojo Maintainers Pending
Review via email: mp+349645@code.launchpad.net

Commit message

Charm testing spec for squid-reverseproxy

Description of the change

Charm testing spec for squid-reverseproxy

To post a comment you must log in.

Unmerged revisions

94. By Tom Haddon

Charm testing spec for squid-reverseproxy

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'charm-testing/squid-reverseproxy'
2=== renamed directory 'charm-testing/squid-reverseproxy' => 'charm-testing/squid-reverseproxy.moved'
3=== added file 'charm-testing/squid-reverseproxy/collect'
4--- charm-testing/squid-reverseproxy/collect 1970-01-01 00:00:00 +0000
5+++ charm-testing/squid-reverseproxy/collect 2018-07-16 13:52:28 +0000
6@@ -0,0 +1,6 @@
7+# Services, primary charms
8+apache2 cs:apache2
9+squid-reverseproxy cs:squid-reverseproxy
10+
11+# subordinates
12+nrpe cs:nrpe
13
14=== added file 'charm-testing/squid-reverseproxy/deploy'
15--- charm-testing/squid-reverseproxy/deploy 1970-01-01 00:00:00 +0000
16+++ charm-testing/squid-reverseproxy/deploy 2018-07-16 13:52:28 +0000
17@@ -0,0 +1,20 @@
18+squid-reverseproxy:
19+ series: {{series}}
20+ services:
21+ apache2:
22+ charm: apache2
23+ expose: true
24+ options:
25+ servername: apache2.devel.canonical.com
26+ vhost_http_template: include-base64://{{spec_dir}}/{{stage}}/templates/vhost-http.tmpl
27+ enable_modules: headers proxy proxy_http rewrite
28+ squid-reverseproxy:
29+ charm: squid-reverseproxy
30+ nrpe:
31+ charm: nrpe
32+ {% if series == "xenial" or series == "bionic" %}options:
33+ swap: '-w 90% -c 75% -n OK'{% endif %}
34+ relations:
35+ - ["nrpe:local-monitors", "apache2:local-monitors"]
36+ - ["nrpe:local-monitors", "squid-reverseproxy:local-monitors"]
37+ - ["apache2:website-cache", "squid-reverseproxy:cached-website"]
38
39=== added file 'charm-testing/squid-reverseproxy/post-deploy'
40--- charm-testing/squid-reverseproxy/post-deploy 1970-01-01 00:00:00 +0000
41+++ charm-testing/squid-reverseproxy/post-deploy 2018-07-16 13:52:28 +0000
42@@ -0,0 +1,49 @@
43+#!/bin/bash
44+
45+# Put some content there to check
46+juju ssh apache2/0 "sudo mkdir -p /var/www/html && echo 'Sample content' > index.html && sudo mv index.html /var/www/html"
47+
48+APACHE=$(juju status --format=yaml apache2 2>&1 | sed -nr '/^ {8}public-address/s/.*://p')
49+
50+if [ -z "${APACHE}" ]; then
51+ echo "No apache2 instances"
52+ exit 1
53+fi
54+
55+for UNIT in ${APACHE}; do
56+
57+ echo "Calling unit to ensure it returns: Sample content"
58+ echo 'curl -f -k -s -S -v http://'${UNIT}'/|grep Sample content'
59+ curl -f -k -s -S -v http://${UNIT}/|grep "Sample content"
60+ if [ $? -ne 0 ]; then
61+ echo "###########################"
62+ echo "# E2E Apache Check Failed #"
63+ echo "###########################"
64+ exit 1
65+ fi
66+done
67+
68+SQUID=$(juju status --format=yaml squid-reverseproxy 2>&1 | sed -nr '/^ {8}public-address/s/.*://p')
69+
70+if [ -z "${SQUID}" ]; then
71+ echo "No squid-reverseproxy instances"
72+ exit 1
73+fi
74+
75+for UNIT in ${SQUID}; do
76+
77+ echo "Calling unit to ensure it returns: Sample content"
78+ echo 'curl -f -k -s -S -v http://'${UNIT}':3128/|grep Sample content'
79+ curl -f -k -s -S -v http://${UNIT}:3128/|grep "Sample content"
80+ if [ $? -ne 0 ]; then
81+ echo "##########################"
82+ echo "# E2E Squid Check Failed #"
83+ echo "##########################"
84+ exit 1
85+ fi
86+done
87+
88+# If we are here it means no checks failed
89+echo "####################"
90+echo "# E2E Check Passed #"
91+echo "####################"
92
93=== added directory 'charm-testing/squid-reverseproxy/templates'
94=== added file 'charm-testing/squid-reverseproxy/templates/vhost-http.tmpl'
95--- charm-testing/squid-reverseproxy/templates/vhost-http.tmpl 1970-01-01 00:00:00 +0000
96+++ charm-testing/squid-reverseproxy/templates/vhost-http.tmpl 2018-07-16 13:52:28 +0000
97@@ -0,0 +1,4 @@
98+<VirtualHost *:80>
99+ ServerName {{ servername }}
100+ DocumentRoot /var/www/html
101+</VirtualHost>

Subscribers

People subscribed via source and target branches

to all changes: