Merge lp:~1chb1n/charms/trusty/neutron-openvswitch/next-amulet-mitaka-1601 into lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next

Proposed by Ryan Beisner
Status: Merged
Merged at revision: 104
Proposed branch: lp:~1chb1n/charms/trusty/neutron-openvswitch/next-amulet-mitaka-1601
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next
Diff against target: 190 lines (+76/-25)
1 file modified
tests/basic_deployment.py (+76/-25)
To merge this branch: bzr merge lp:~1chb1n/charms/trusty/neutron-openvswitch/next-amulet-mitaka-1601
Reviewer Review Type Date Requested Status
David Ames (community) Approve
Review via email: mp+282838@code.launchpad.net

Description of the change

Enable mitaka/liberty amulet tests; Update test deployment topology to satisfy workload status; wait for unit status instead of sleeping before amulet tests.

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #17457 neutron-openvswitch-next for 1chb1n mp282838
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/17457/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #16308 neutron-openvswitch-next for 1chb1n mp282838
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/16308/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8821 neutron-openvswitch-next for 1chb1n mp282838
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/14515233/
Build: http://10.245.162.77:8080/job/charm_amulet_test/8821/

105. By Ryan Beisner

fix dict definition typo

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #16423 neutron-openvswitch-next for 1chb1n mp282838
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/16423/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #17578 neutron-openvswitch-next for 1chb1n mp282838
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/17578/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8884 neutron-openvswitch-next for 1chb1n mp282838
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/14572886/
Build: http://10.245.162.77:8080/job/charm_amulet_test/8884/

106. By Ryan Beisner

rebase

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #16617 neutron-openvswitch-next for 1chb1n mp282838
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/16617/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #17783 neutron-openvswitch-next for 1chb1n mp282838
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/17783/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #17788 neutron-openvswitch-next for 1chb1n mp282838
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/17788/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #16624 neutron-openvswitch-next for 1chb1n mp282838
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/16624/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8914 neutron-openvswitch-next for 1chb1n mp282838
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/14584923/
Build: http://10.245.162.77:8080/job/charm_amulet_test/8914/

107. By Ryan Beisner

update amulet tests for systemd-based releases

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #17796 neutron-openvswitch-next for 1chb1n mp282838
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/17796/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #16632 neutron-openvswitch-next for 1chb1n mp282838
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/16632/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8928 neutron-openvswitch-next for 1chb1n mp282838
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/14588851/
Build: http://10.245.162.77:8080/job/charm_amulet_test/8928/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #8933 neutron-openvswitch-next for 1chb1n mp282838
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/8933/

Revision history for this message
David Ames (thedac) wrote :

"I'll allow it". In the interest of test coverage I am going to merge this but I have a couple of caveats in line for future reference.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/018-basic-trusty-liberty' (properties changed: -x to +x)
2=== modified file 'tests/019-basic-trusty-mitaka' (properties changed: -x to +x)
3=== modified file 'tests/020-basic-wily-liberty' (properties changed: -x to +x)
4=== modified file 'tests/basic_deployment.py'
5--- tests/basic_deployment.py 2015-07-13 16:07:30 +0000
6+++ tests/basic_deployment.py 2016-01-20 20:56:46 +0000
7@@ -9,6 +9,8 @@
8 OpenStackAmuletDeployment
9 )
10
11+# This file needs de-linted. The (mis)use of n-o q-a below causes all lint
12+# to go undetected. Remove that & fixme.
13 from charmhelpers.contrib.openstack.amulet.utils import (
14 OpenStackAmuletUtils,
15 DEBUG, # flake8: noqa
16@@ -36,6 +38,11 @@
17 self._add_relations()
18 self._configure_services()
19 self._deploy()
20+
21+ u.log.info('Waiting on extended status checks...')
22+ exclude_services = ['mysql']
23+ self._auto_wait_for_status(exclude_services=exclude_services)
24+
25 self._initialize_tests()
26
27 def _add_services(self):
28@@ -45,9 +52,14 @@
29 and the rest of the service are from lp branches that are
30 compatible with the local charm (e.g. stable or next).
31 """
32+ # Services and relations which are present merely to satisfy required_interfaces
33+ # and workload status are not inspected. Fix me. Inspect those too.
34 this_service = {'name': 'neutron-openvswitch'}
35 other_services = [{'name': 'nova-compute'},
36 {'name': 'rabbitmq-server'},
37+ {'name': 'keystone'}, # satisfy workload stat
38+ {'name': 'mysql'}, # satisfy workload stat
39+ {'name': 'glance'}, # satisfy workload stat
40 {'name': 'neutron-api'}]
41 super(NeutronOVSBasicDeployment, self)._add_services(this_service,
42 other_services)
43@@ -55,11 +67,21 @@
44 def _add_relations(self):
45 """Add all of the relations for the services."""
46 relations = {
47- 'neutron-openvswitch:amqp': 'rabbitmq-server:amqp',
48+ 'neutron-openvswitch:amqp': 'rabbitmq-server:amqp',
49 'neutron-openvswitch:neutron-plugin':
50 'nova-compute:neutron-plugin',
51 'neutron-openvswitch:neutron-plugin-api':
52 'neutron-api:neutron-plugin-api',
53+ # Satisfy workload stat:
54+ 'neutron-api:identity-service': 'keystone:identity-service',
55+ 'neutron-api:shared-db': 'mysql:shared-db',
56+ 'neutron-api:amqp': 'rabbitmq-server:amqp',
57+ 'nova-compute:amqp': 'rabbitmq-server:amqp',
58+ 'nova-compute:image-service': 'glance:image-service',
59+ 'glance:identity-service': 'keystone:identity-service',
60+ 'glance:shared-db': 'mysql:shared-db',
61+ 'glance:amqp': 'rabbitmq-server:amqp',
62+ 'keystone:shared-db': 'mysql:shared-db',
63 }
64 super(NeutronOVSBasicDeployment, self)._add_relations(relations)
65
66@@ -124,22 +146,26 @@
67 self.compute_sentry = self.d.sentry.unit['nova-compute/0']
68 self.rabbitmq_sentry = self.d.sentry.unit['rabbitmq-server/0']
69 self.neutron_api_sentry = self.d.sentry.unit['neutron-api/0']
70+ self.n_ovs_sentry = self.d.sentry.unit['neutron-openvswitch/0']
71
72- def test_services(self):
73+ def test_100_services(self):
74 """Verify the expected services are running on the corresponding
75 service units."""
76+ u.log.debug('Checking system services on units...')
77
78- commands = {
79- self.compute_sentry: ['status nova-compute',
80- 'status neutron-plugin-openvswitch-agent'],
81- self.rabbitmq_sentry: ['service rabbitmq-server status'],
82- self.neutron_api_sentry: ['status neutron-server'],
83+ services = {
84+ self.compute_sentry: ['nova-compute',
85+ 'neutron-plugin-openvswitch-agent'],
86+ self.rabbitmq_sentry: ['rabbitmq-server'],
87+ self.neutron_api_sentry: ['neutron-server'],
88 }
89
90- ret = u.validate_services(commands)
91+ ret = u.validate_services_by_name(services)
92 if ret:
93 amulet.raise_status(amulet.FAIL, msg=ret)
94
95+ u.log.debug('OK')
96+
97 def test_rabbitmq_amqp_relation(self):
98 """Verify data in rabbitmq-server/neutron-openvswitch amqp relation"""
99 unit = self.rabbitmq_sentry
100@@ -189,6 +215,8 @@
101 def check_ml2_setting_propagation(self, service, charm_key,
102 config_file_key, vpair,
103 section):
104+
105+ # Needs love - test actions not clear in log
106 unit = self.compute_sentry
107 conf = "/etc/neutron/plugins/ml2/ml2_conf.ini"
108 for value in vpair:
109@@ -202,6 +230,8 @@
110
111 def test_l2pop_propagation(self):
112 """Verify that neutron-api l2pop setting propagates to neutron-ovs"""
113+
114+ # Needs love - not idempotent
115 self.check_ml2_setting_propagation('neutron-api',
116 'l2-population',
117 'l2_population',
118@@ -210,6 +240,8 @@
119
120 def test_nettype_propagation(self):
121 """Verify that neutron-api nettype setting propagates to neutron-ovs"""
122+
123+ # Needs love - not idempotent
124 self.check_ml2_setting_propagation('neutron-api',
125 'overlay-network-type',
126 'tunnel_types',
127@@ -218,6 +250,8 @@
128
129 def test_secgroup_propagation_local_override(self):
130 """Verify disable-security-groups overrides what neutron-api says"""
131+
132+ # Needs love - not idempotent
133 unit = self.compute_sentry
134 conf = "/etc/neutron/plugins/ml2/ml2_conf.ini"
135 self.d.configure('neutron-api', {'neutron-security-groups': 'True'})
136@@ -237,20 +271,37 @@
137 {'enable_security_group': 'True'})
138
139 def test_z_restart_on_config_change(self):
140- """Verify that the specified services are restarted when the config
141- is changed.
142-
143- Note(coreycb): The method name with the _z_ is a little odd
144- but it forces the test to run last. It just makes things
145- easier because restarting services requires re-authorization.
146- """
147- conf = '/etc/neutron/neutron.conf'
148- self.d.configure('neutron-openvswitch', {'use-syslog': 'True'})
149- if not u.service_restarted(self.compute_sentry,
150- 'neutron-openvswitch-agent', conf,
151- pgrep_full=True, sleep_time=60):
152- self.d.configure('neutron-openvswitch', {'use-syslog': 'False'})
153- msg = ('service neutron-openvswitch-agent did not restart after '
154- 'config change')
155- amulet.raise_status(amulet.FAIL, msg=msg)
156- self.d.configure('neutron-openvswitch', {'use-syslog': 'False'})
157+ """Verify that the specified services are restarted when the
158+ config is changed."""
159+
160+ sentry = self.n_ovs_sentry
161+ juju_service = 'neutron-openvswitch'
162+
163+ # Expected default and alternate values
164+ set_default = {'debug': 'False'}
165+ set_alternate = {'debug': 'True'}
166+
167+ # Services which are expected to restart upon config change,
168+ # and corresponding config files affected by the change
169+ conf_file = '/etc/neutron/neutron.conf'
170+ services = {
171+ 'neutron-openvswitch-agent': conf_file
172+ }
173+
174+ # Make config change, check for svc restart, conf file mod time change
175+ u.log.debug('Making config change on {}...'.format(juju_service))
176+ mtime = u.get_sentry_time(sentry)
177+ self.d.configure(juju_service, set_alternate)
178+
179+ sleep_time = 60
180+ for s, conf_file in services.iteritems():
181+ u.log.debug("Checking that service restarted: {}".format(s))
182+ if not u.validate_service_config_changed(sentry, mtime, s,
183+ conf_file,
184+ sleep_time=sleep_time):
185+ self.d.configure(juju_service, set_default)
186+ msg = "service {} didn't restart after config change".format(s)
187+ amulet.raise_status(amulet.FAIL, msg=msg)
188+
189+ self.d.configure(juju_service, set_default)
190+ u.log.debug('OK')

Subscribers

People subscribed via source and target branches