Merge lp:~johnsca/charms/trusty/rsyslog-forwarder-ha/cwr into lp:charms/trusty/rsyslog-forwarder-ha

Proposed by Cory Johns
Status: Merged
Merged at revision: 10
Proposed branch: lp:~johnsca/charms/trusty/rsyslog-forwarder-ha/cwr
Merge into: lp:charms/trusty/rsyslog-forwarder-ha
Diff against target: 185 lines (+22/-93)
8 files modified
.bzrignore (+1/-0)
Makefile (+3/-7)
metadata.yaml (+1/-1)
test_requirements.txt (+0/-12)
tests/00_setup.sh (+14/-0)
tests/10_deploy_test.py (+3/-11)
tests/functional/00_setup.sh (+0/-14)
tests/functional/10_deploy_test.py (+0/-48)
To merge this branch: bzr merge lp:~johnsca/charms/trusty/rsyslog-forwarder-ha/cwr
Reviewer Review Type Date Requested Status
Tim Van Steenburgh (community) Approve
Review via email: mp+273281@code.launchpad.net

Description of the change

Cleanup of tests to get passing on CWR as part of the realtime-syslog-analytics bundle.

To post a comment you must log in.
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

Excellent, thanks Cory.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2015-10-02 19:23:27 +0000
4@@ -0,0 +1,1 @@
5+.coverage
6
7=== modified file 'Makefile'
8--- Makefile 2014-05-02 19:55:18 +0000
9+++ Makefile 2015-10-02 19:23:27 +0000
10@@ -6,15 +6,11 @@
11 lint:
12 @flake8 --exclude hooks/charmhelpers --ignore=E125,F401 hooks
13
14-functional:
15- @PYTHONPATH=$(PYTHON_PATH):hooks/ nosetests --nologcapture tests/functional/
16-
17-unit:
18- #@pip install -r test_requirements.txt
19+test:
20+ @dpkg -s python-apt > /dev/null || sudo apt-get install python-apt
21+ @sudo pip install -r test_requirements.txt
22 @PYTHONPATH=$(PYTHON_PATH):hooks/ nosetests --nologcapture tests/unit
23
24-test: functional unit
25-
26 bin/charm_helpers_sync.py:
27 @bzr cat lp:charm-helpers/tools/charm_helpers_sync/charm_helpers_sync.py > bin/charm_helpers_sync.py
28
29
30=== modified file 'metadata.yaml'
31--- metadata.yaml 2014-05-02 19:55:18 +0000
32+++ metadata.yaml 2015-10-02 19:23:27 +0000
33@@ -2,7 +2,7 @@
34 maintainer: Jorge Niedbalski <jorge.niedbalski@canonical.com>
35 subordinate: true
36 summary: forwards local syslog to multiple remote syslog servers.
37-categories: ["system"]
38+tags: ["system"]
39 description: |
40 Uses rsyslogs facilities to forward to multiple remote syslog servers.
41 requires:
42
43=== modified file 'test_requirements.txt'
44--- test_requirements.txt 2014-05-02 20:12:12 +0000
45+++ test_requirements.txt 2015-10-02 19:23:27 +0000
46@@ -1,15 +1,3 @@
47 PyYAML==3.10
48 SQLAlchemy==0.9.4
49-amulet==1.4.0
50-argparse==1.2.1
51-bzr==2.6.0
52-charmworldlib==0.3.0
53-coverage==3.7.1
54-juju-deployer==0.3.8
55-jujuclient==0.17.7
56 mock==1.0.1
57-nose==1.3.1
58-python-apt==0.0.0
59-requests==2.2.1
60-websocket-client==0.12.0
61-wsgiref==0.1.2
62
63=== added file 'tests/00_setup.sh'
64--- tests/00_setup.sh 1970-01-01 00:00:00 +0000
65+++ tests/00_setup.sh 2015-10-02 19:23:27 +0000
66@@ -0,0 +1,14 @@
67+#!/bin/sh
68+
69+# The script installs amulet and other tools needed for the amulet tests.
70+
71+set -x
72+
73+# Get the status of the amulet package, this returns 0 of package is installed.
74+dpkg -s amulet
75+if [ $? -ne 0 ]; then
76+ # Install the Amulet testing harness.
77+ sudo add-apt-repository -y ppa:juju/stable
78+ sudo apt-get update
79+ sudo apt-get install -y amulet
80+fi
81
82=== modified file 'tests/10_deploy_test.py' (properties changed: -x to +x)
83--- tests/10_deploy_test.py 2014-05-02 19:55:18 +0000
84+++ tests/10_deploy_test.py 2015-10-02 19:23:27 +0000
85@@ -14,7 +14,7 @@
86 pass
87
88 def test_deployment_single(self):
89- """Test a deployment with no replication-mode set"""
90+ """Test a rsyslog-forwarder-ha deployment"""
91 self.deployment = amulet.Deployment(series="precise",
92 sentries=False)
93
94@@ -34,16 +34,8 @@
95 self.deployment.expose("rsyslog-master")
96 self.deployment.expose("rsyslog-slave")
97
98- seconds = 300
99- try:
100- self.deployment.setup(timeout=seconds)
101- except amulet.helpers.TimeoutError:
102- message = 'The environment did not setup in %d seconds.' % seconds
103- amulet.raise_status(amulet.SKIP, msg=message)
104- except:
105- raise
106-
107- self.deployment.cleanup()
108+ self.deployment.setup(timeout=600)
109+ self.deployment.sentry.wait(timeout=600)
110
111
112 if __name__ == "__main__":
113
114=== removed directory 'tests/functional'
115=== removed file 'tests/functional/00_setup.sh'
116--- tests/functional/00_setup.sh 2014-05-02 19:55:18 +0000
117+++ tests/functional/00_setup.sh 1970-01-01 00:00:00 +0000
118@@ -1,14 +0,0 @@
119-#!/bin/sh
120-
121-# The script installs amulet and other tools needed for the amulet tests.
122-
123-set -x
124-
125-# Get the status of the amulet package, this returns 0 of package is installed.
126-dpkg -s amulet
127-if [ $? -ne 0 ]; then
128- # Install the Amulet testing harness.
129- sudo add-apt-repository -y ppa:juju/stable
130- sudo apt-get update
131- sudo apt-get install -y amulet
132-fi
133
134=== removed file 'tests/functional/10_deploy_test.py'
135--- tests/functional/10_deploy_test.py 2014-05-02 19:55:18 +0000
136+++ tests/functional/10_deploy_test.py 1970-01-01 00:00:00 +0000
137@@ -1,48 +0,0 @@
138-#!/usr/bin/env python
139-# -*- coding: utf-8 -*-
140-
141-__author__ = 'Jorge Niedbalski R. <jorge.niedbalski@canonical.com>'
142-
143-
144-import amulet
145-import unittest
146-
147-
148-class RsyslogForwarder(unittest.TestCase):
149-
150- def setUp(self):
151- pass
152-
153- def test_deployment_single(self):
154- """Test a rsyslog-forwarder-ha deployment"""
155- self.deployment = amulet.Deployment(series="precise",
156- sentries=False)
157-
158- self.deployment.add("rsyslog-master", charm="rsyslog")
159- self.deployment.add("rsyslog-slave", charm="rsyslog")
160- self.deployment.add("rsyslog-forwarder-ha")
161- self.deployment.add("postgresql")
162-
163- self.deployment.relate("rsyslog-forwarder-ha:syslog",
164- "rsyslog-master:aggregator")
165-
166- self.deployment.relate("rsyslog-forwarder-ha:syslog",
167- "rsyslog-slave:aggregator")
168-
169- self.deployment._relate("postgresql", "rsyslog-forwarder-ha")
170-
171- self.deployment.expose("rsyslog-master")
172- self.deployment.expose("rsyslog-slave")
173-
174- seconds = 300
175- try:
176- self.deployment.setup(timeout=seconds)
177- except amulet.helpers.TimeoutError:
178- message = 'The environment did not setup in %d seconds.' % seconds
179- amulet.raise_status(amulet.SKIP, msg=message)
180- except:
181- raise
182-
183-
184-if __name__ == "__main__":
185- unittest.main()

Subscribers

People subscribed via source and target branches