Merge lp:~james-page/charms/trusty/cinder-ceph/tox into lp:~openstack-charmers-archive/charms/trusty/cinder-ceph/next

Proposed by James Page
Status: Merged
Merged at revision: 46
Proposed branch: lp:~james-page/charms/trusty/cinder-ceph/tox
Merge into: lp:~openstack-charmers-archive/charms/trusty/cinder-ceph/next
Diff against target: 156 lines (+71/-8)
7 files modified
.bzrignore (+3/-0)
.testr.conf (+8/-0)
requirements.txt (+11/-0)
test-requirements.txt (+8/-0)
tests/basic_deployment.py (+11/-7)
tox.ini (+29/-0)
unit_tests/test_cinder_hooks.py (+1/-1)
To merge this branch: bzr merge lp:~james-page/charms/trusty/cinder-ceph/tox
Reviewer Review Type Date Requested Status
Corey Bryant (community) Approve
Review via email: mp+276537@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Code looks good and I ran tests successfully (tox, make lint/test, and a subset of amulet tests).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2014-07-02 08:14:53 +0000
3+++ .bzrignore 2015-11-03 14:17:23 +0000
4@@ -1,2 +1,5 @@
5 bin
6 .coverage
7+.testrepository
8+.tox
9+tags
10
11=== added file '.testr.conf'
12--- .testr.conf 1970-01-01 00:00:00 +0000
13+++ .testr.conf 2015-11-03 14:17:23 +0000
14@@ -0,0 +1,8 @@
15+[DEFAULT]
16+test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
17+ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
18+ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
19+ ${PYTHON:-python} -m subunit.run discover -t ./ ./unit_tests $LISTOPT $IDOPTION
20+
21+test_id_option=--load-list $IDFILE
22+test_list_option=--list
23
24=== added file 'requirements.txt'
25--- requirements.txt 1970-01-01 00:00:00 +0000
26+++ requirements.txt 2015-11-03 14:17:23 +0000
27@@ -0,0 +1,11 @@
28+# The order of packages is significant, because pip processes them in the order
29+# of appearance. Changing the order has an impact on the overall integration
30+# process, which may cause wedges in the gate later.
31+PyYAML>=3.1.0
32+simplejson>=2.2.0
33+netifaces>=0.10.4
34+netaddr>=0.7.12,!=0.7.16
35+Jinja2>=2.6 # BSD License (3 clause)
36+six>=1.9.0
37+dnspython>=1.12.0
38+psutil>=1.1.1,<2.0.0
39
40=== added file 'test-requirements.txt'
41--- test-requirements.txt 1970-01-01 00:00:00 +0000
42+++ test-requirements.txt 2015-11-03 14:17:23 +0000
43@@ -0,0 +1,8 @@
44+# The order of packages is significant, because pip processes them in the order
45+# of appearance. Changing the order has an impact on the overall integration
46+# process, which may cause wedges in the gate later.
47+coverage>=3.6
48+mock>=1.2
49+flake8>=2.2.4,<=2.4.1
50+os-testr>=0.4.1
51+charm-tools
52
53=== modified file 'tests/basic_deployment.py'
54--- tests/basic_deployment.py 2015-09-14 09:36:00 +0000
55+++ tests/basic_deployment.py 2015-11-03 14:17:23 +0000
56@@ -14,7 +14,6 @@
57 from charmhelpers.contrib.openstack.amulet.utils import (
58 OpenStackAmuletUtils,
59 DEBUG,
60- #ERROR
61 )
62
63 # Use DEBUG to turn on debug logging
64@@ -306,12 +305,15 @@
65 def get_broker_response(self):
66 broker_request = self.get_broker_request()
67 response_key = "broker-rsp-cinder-ceph-0"
68- ceph_sentrys = [self.ceph0_sentry, self.ceph1_sentry, self.ceph2_sentry]
69+ ceph_sentrys = [self.ceph0_sentry,
70+ self.ceph1_sentry,
71+ self.ceph2_sentry]
72 for sentry in ceph_sentrys:
73 relation_data = sentry.relation('client', 'cinder-ceph:ceph')
74 if relation_data.get(response_key):
75 broker_response = json.loads(relation_data[response_key])
76- if broker_request['request-id'] == broker_response['request-id']:
77+ if (broker_request['request-id'] ==
78+ broker_response['request-id']):
79 return broker_response
80
81 def test_200_cinderceph_ceph_ceph_relation(self):
82@@ -321,8 +323,10 @@
83 relation = ['ceph', 'ceph:client']
84
85 req = {
86- "api-version": 1,
87- "ops": [{"replicas": 3, "name": "cinder-ceph", "op": "create-pool"}]
88+ "api-version": 1,
89+ "ops": [{"replicas": 3,
90+ "name": "cinder-ceph",
91+ "op": "create-pool"}]
92 }
93 expected = {
94 'private-address': u.valid_ip,
95@@ -340,7 +344,6 @@
96 def test_201_ceph_cinderceph_ceph_relation(self):
97 u.log.debug('Checking ceph:client to cinder-ceph:ceph '
98 'relation data...')
99- response_key = "broker-rsp-cinder-ceph-0"
100 ceph_unit = self.ceph0_sentry
101 relation = ['client', 'cinder-ceph:ceph']
102 expected = {
103@@ -355,7 +358,8 @@
104 amulet.raise_status(amulet.FAIL, msg=msg)
105 broker_response = self.get_broker_response()
106 if not broker_response or broker_response['exit-code'] != 0:
107- msg='Broker request invalid or failed: {}'.format(broker_response)
108+ msg = ('Broker request invalid'
109+ ' or failed: {}'.format(broker_response))
110 amulet.raise_status(amulet.FAIL, msg=msg)
111
112 def test_202_cinderceph_cinder_backend_relation(self):
113
114=== added file 'tox.ini'
115--- tox.ini 1970-01-01 00:00:00 +0000
116+++ tox.ini 2015-11-03 14:17:23 +0000
117@@ -0,0 +1,29 @@
118+[tox]
119+envlist = lint,py27
120+skipsdist = True
121+
122+[testenv]
123+setenv = VIRTUAL_ENV={envdir}
124+ PYTHONHASHSEED=0
125+install_command =
126+ pip install --allow-unverified python-apt {opts} {packages}
127+commands = ostestr {posargs}
128+
129+[testenv:py27]
130+basepython = python2.7
131+deps = -r{toxinidir}/requirements.txt
132+ -r{toxinidir}/test-requirements.txt
133+
134+[testenv:lint]
135+basepython = python2.7
136+deps = -r{toxinidir}/requirements.txt
137+ -r{toxinidir}/test-requirements.txt
138+commands = flake8 {posargs} hooks unit_tests tests
139+ charm proof
140+
141+[testenv:venv]
142+commands = {posargs}
143+
144+[flake8]
145+ignore = E402,E226
146+exclude = hooks/charmhelpers
147
148=== modified file 'unit_tests/test_cinder_hooks.py'
149--- unit_tests/test_cinder_hooks.py 2015-10-08 15:46:16 +0000
150+++ unit_tests/test_cinder_hooks.py 2015-11-03 14:17:23 +0000
151@@ -155,4 +155,4 @@
152 backend_name='test',
153 subordinate_configuration=json.dumps({'test': 1}),
154 stateless=True,
155- )
156+ )

Subscribers

People subscribed via source and target branches