Merge lp:~gnuoy/openstack-mojo-specs/add-designate-ha-tests into lp:openstack-mojo-specs
- add-designate-ha-tests
- Merge into mojo-openstack-specs
Status: | Merged |
---|---|
Merged at revision: | 327 |
Proposed branch: | lp:~gnuoy/openstack-mojo-specs/add-designate-ha-tests |
Merge into: | lp:openstack-mojo-specs |
Diff against target: |
747 lines (+578/-8) 9 files modified
helper/bundles/designate-next-ha.yaml (+406/-0) helper/collect/collect-next-reactive-xenial (+1/-0) helper/setup/preflight.py (+1/-0) helper/tests/expand_and_shrink_bind.py (+59/-0) helper/utils/mojo_os_utils.py (+80/-1) specs/full_stack/next_deploy_designate/mitaka/manifest (+8/-2) specs/full_stack/next_deploy_designate/newton/manifest (+8/-2) specs/full_stack/next_deploy_designate/ocata/manifest (+7/-1) specs/full_stack/next_deploy_designate/pike/manifest (+8/-2) |
To merge this branch: | bzr merge lp:~gnuoy/openstack-mojo-specs/add-designate-ha-tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
David Ames (community) | Approve | ||
Review via email: mp+336756@code.launchpad.net |
Commit message
Description of the change
Liam Young (gnuoy) wrote : | # |
I'll remove the stray debug prints.
The reactive-next.yaml and new designate-next.yaml differ only in the way designate is deployed. In designate-next.yaml designate and designate-bind are deployed in an HA configuration so that the bind resilience tests can be run. I decided to extend the existing next_deploy_
I think ultimately you are correct and designate-next.yaml is the beginnings of an HA version of reactive-next.yaml but I think a full HA version of reactive-next.yaml is beyond the scope of this change.
Finally, the original tests that are part of next_deploy_
- 331. By Liam Young <email address hidden>
-
Tidy up
Preview Diff
1 | === added file 'helper/bundles/designate-next-ha.yaml' |
2 | --- helper/bundles/designate-next-ha.yaml 1970-01-01 00:00:00 +0000 |
3 | +++ helper/bundles/designate-next-ha.yaml 2018-02-02 09:55:24 +0000 |
4 | @@ -0,0 +1,406 @@ |
5 | +# vim: set ts=2 et: |
6 | +# deployer bundle for development ('next') charms |
7 | +# UOSCI relies on this for OS-on-OS deployment testing |
8 | +base-services: |
9 | + services: |
10 | + rabbitmq-server: |
11 | + charm: rabbitmq-server |
12 | + constraints: mem=1G |
13 | + ceph-mon: |
14 | + charm: ceph-mon |
15 | + num_units: 3 |
16 | + options: |
17 | + expected-osd-count: 3 |
18 | + ceph-osd: |
19 | + charm: ceph-osd |
20 | + constraints: mem=1G |
21 | + num_units: 3 |
22 | + options: |
23 | + ephemeral-unmount: /mnt |
24 | + osd-devices: /dev/vdb /dev/sdb /dev/xvdb |
25 | + osd-reformat: 'yes' |
26 | + ntp: |
27 | + charm: ntp |
28 | + num_units: 0 |
29 | + keystone: |
30 | + charm: keystone |
31 | + constraints: mem=1G |
32 | + options: |
33 | + admin-password: openstack |
34 | + admin-token: ubuntutesting |
35 | + openstack-dashboard: |
36 | + charm: openstack-dashboard |
37 | + constraints: mem=1G |
38 | + nova-compute: |
39 | + charm: nova-compute |
40 | + num_units: 3 |
41 | + constraints: mem=4G |
42 | + options: |
43 | + enable-live-migration: True |
44 | + enable-resize: True |
45 | + migration-auth-type: ssh |
46 | + nova-cloud-controller: |
47 | + charm: nova-cloud-controller |
48 | + constraints: mem=2G |
49 | + options: |
50 | + network-manager: Neutron |
51 | + neutron-gateway: |
52 | + charm: neutron-gateway |
53 | + constraints: mem=4G |
54 | + options: |
55 | + instance-mtu: 1300 |
56 | + bridge-mappings: physnet1:br-ex |
57 | + neutron-api: |
58 | + charm: neutron-api |
59 | + constraints: mem=1G |
60 | + options: |
61 | + neutron-security-groups: True |
62 | + flat-network-providers: physnet1 |
63 | + enable-ml2-dns: True |
64 | + dns-domain: mojo.serverstack. |
65 | + reverse-dns-lookup: True |
66 | + ipv4-ptr-zone-prefix-size: 24 |
67 | + neutron-openvswitch: |
68 | + charm: neutron-openvswitch |
69 | + cinder: |
70 | + charm: cinder |
71 | + options: |
72 | + block-device: "None" |
73 | + glance-api-version: 2 |
74 | + constraints: mem=1G |
75 | + cinder-ceph: |
76 | + charm: cinder-ceph |
77 | + glance: |
78 | + charm: glance |
79 | + constraints: mem=1G |
80 | + swift-proxy: |
81 | + charm: swift-proxy |
82 | + constraints: mem=1G |
83 | + options: |
84 | + zone-assignment: manual |
85 | + replicas: 3 |
86 | + swift-hash: fdfef9d4-8b06-11e2-8ac0-531c923c8fae |
87 | + swift-storage-z1: |
88 | + charm: swift-storage |
89 | + constraints: mem=1G |
90 | + options: |
91 | + zone: 1 |
92 | + block-device: vdb |
93 | + overwrite: "true" |
94 | + swift-storage-z2: |
95 | + charm: swift-storage |
96 | + constraints: mem=1G |
97 | + options: |
98 | + zone: 2 |
99 | + block-device: vdb |
100 | + overwrite: "true" |
101 | + swift-storage-z3: |
102 | + charm: swift-storage |
103 | + constraints: mem=1G |
104 | + options: |
105 | + zone: 3 |
106 | + block-device: vdb |
107 | + overwrite: "true" |
108 | + ceilometer: |
109 | + charm: ceilometer |
110 | + constraints: mem=1G |
111 | + ceilometer-agent: |
112 | + charm: ceilometer-agent |
113 | + heat: |
114 | + charm: heat |
115 | + mongodb: |
116 | + charm: mongodb |
117 | + constraints: mem=1G |
118 | + relations: |
119 | + - [ keystone, mysql ] |
120 | + - [ nova-cloud-controller, mysql ] |
121 | + - [ nova-cloud-controller, rabbitmq-server ] |
122 | + - [ nova-cloud-controller, glance ] |
123 | + - [ nova-cloud-controller, keystone ] |
124 | + - [ nova-compute, nova-cloud-controller ] |
125 | + - - nova-compute |
126 | + - rabbitmq-server:amqp |
127 | + - [ nova-compute, glance ] |
128 | + - [ nova-compute, ceph-mon ] |
129 | + - [ glance, mysql ] |
130 | + - [ glance, keystone ] |
131 | + - [ glance, ceph-mon ] |
132 | + - [ glance, "cinder:image-service" ] |
133 | + - [ glance, rabbitmq-server ] |
134 | + - [ cinder, mysql ] |
135 | + - [ cinder, rabbitmq-server ] |
136 | + - [ cinder, nova-cloud-controller ] |
137 | + - [ cinder, keystone ] |
138 | + - [ cinder, cinder-ceph ] |
139 | + - [ cinder-ceph, ceph-mon ] |
140 | + - [ neutron-gateway, nova-cloud-controller ] |
141 | + - [ openstack-dashboard, keystone ] |
142 | + - [ swift-proxy, keystone ] |
143 | + - [ swift-proxy, swift-storage-z1 ] |
144 | + - [ swift-proxy, swift-storage-z2 ] |
145 | + - [ swift-proxy, swift-storage-z3 ] |
146 | + - - ceilometer |
147 | + - keystone:identity-service |
148 | + - [ ceilometer, rabbitmq-server ] |
149 | + - [ ceilometer, mongodb ] |
150 | + - [ ceilometer-agent, nova-compute ] |
151 | + - [ ceilometer-agent, ceilometer ] |
152 | + - [ heat, mysql ] |
153 | + - [ heat, keystone ] |
154 | + - [ heat, rabbitmq-server ] |
155 | + - [ "neutron-gateway:amqp", rabbitmq-server ] |
156 | + - [ neutron-api, mysql ] |
157 | + - [ neutron-api, rabbitmq-server ] |
158 | + - [ neutron-api, nova-cloud-controller ] |
159 | + - [ neutron-api, neutron-openvswitch ] |
160 | + - [ neutron-api, keystone ] |
161 | + - [ neutron-api, neutron-gateway ] |
162 | + - [ neutron-openvswitch, nova-compute ] |
163 | + - [ neutron-openvswitch, rabbitmq-server ] |
164 | + - [ ceph-osd, ceph-mon ] |
165 | + - [ ntp, ceph-osd ] |
166 | +openstack-services: |
167 | + inherits: base-services |
168 | + services: |
169 | + mysql: |
170 | + charm: mysql |
171 | + constraints: mem=4G |
172 | + options: |
173 | + root-password: ChangeMe123 |
174 | + sst-password: ChangeMe123 |
175 | +openstack-services-trusty-mitaka: |
176 | + inherits: openstack-services |
177 | + services: |
178 | + aodh: |
179 | + charm: aodh |
180 | + constraints: mem=1G |
181 | + designate: |
182 | + charm: designate |
183 | + num_units: 3 |
184 | + constraints: mem=1G |
185 | + options: |
186 | + nova-domain: 'mojo.serverstack.com.' |
187 | + neutron-domain: 'mojo.serverstack.com.' |
188 | + nova-domain-email: 'bob@mojo.serverstack.com' |
189 | + neutron-domain-email: 'bob@mojo.serverstack.com' |
190 | + nameservers: "ns1.mojo.serverstack.com." |
191 | + vip: "{{ MOJO_OS_VIP10 }}" |
192 | + designate-hacluster: |
193 | + charm: hacluster |
194 | + options: |
195 | + corosync_transport: unicast |
196 | + cluster_count: 3 |
197 | + designate-bind: |
198 | + num_units: 3 |
199 | + charm: designate-bind |
200 | + tempest: |
201 | + charm: tempest |
202 | + constraints: mem=1G |
203 | + relations: |
204 | + - [ aodh, rabbitmq-server ] |
205 | + - [ aodh, mysql ] |
206 | + - [ aodh, keystone ] |
207 | + - [ designate, keystone ] |
208 | + - [ designate, mysql ] |
209 | + - [ designate, rabbitmq-server ] |
210 | + - [ designate, designate-bind ] |
211 | + - [ designate, memcached ] |
212 | + - [ designate, neutron-api ] |
213 | + - [ designate, designate-hacluster ] |
214 | + # designate <-> nova-compute needed for legacy notifications |
215 | + - [ designate, nova-compute ] |
216 | + - [ keystone, tempest ] |
217 | +openstack-services-xenial: |
218 | + inherits: openstack-services-trusty-mitaka |
219 | + services: |
220 | + barbican: |
221 | + charm: barbican |
222 | + constraints: mem=1G |
223 | + relations: |
224 | + - [ barbican, rabbitmq-server ] |
225 | + - [ barbican, mysql ] |
226 | + - [ barbican, keystone ] |
227 | +openstack-services-xenial-ocata: |
228 | + inherits: openstack-services-xenial |
229 | + services: |
230 | + gnocchi: |
231 | + charm: gnocchi |
232 | + memcached: |
233 | + charm: cs:memcached |
234 | + relations: |
235 | + - [ gnocchi, ceph-mon ] |
236 | + - [ gnocchi, mysql ] |
237 | + - [ gnocchi, rabbitmq-server ] |
238 | + - [ gnocchi, memcached ] |
239 | + - [ gnocchi, ceilometer ] |
240 | + - [ gnocchi, keystone ] |
241 | + - [ cinder-ceph, nova-compute ] |
242 | +# icehouse |
243 | +trusty-icehouse: |
244 | + inherits: openstack-services |
245 | + series: trusty |
246 | +trusty-icehouse-proposed: |
247 | + inherits: trusty-icehouse |
248 | + overrides: |
249 | + source: proposed |
250 | + openstack-origin: distro-proposed |
251 | +trusty-icehouse-trunk: |
252 | + inherits: trusty-icehouse |
253 | + overrides: |
254 | + openstack-origin: ppa:openstack-ubuntu-testing/icehouse |
255 | + source: ppa:openstack-ubuntu-testing/icehouse |
256 | + offline-compression: "no" |
257 | +# kilo |
258 | +trusty-kilo: |
259 | + inherits: openstack-services |
260 | + series: trusty |
261 | + overrides: |
262 | + openstack-origin: cloud:trusty-kilo |
263 | + source: cloud:trusty-kilo |
264 | +trusty-kilo-proposed: |
265 | + inherits: trusty-kilo |
266 | + overrides: |
267 | + openstack-origin: cloud:trusty-kilo/proposed |
268 | + source: cloud:trusty-kilo/proposed |
269 | +trusty-kilo-staging: |
270 | + inherits: trusty-kilo |
271 | + overrides: |
272 | + openstack-origin: ppa:ubuntu-cloud-archive/kilo-staging |
273 | + source: ppa:ubuntu-cloud-archive/kilo-staging |
274 | +# liberty |
275 | +trusty-liberty: |
276 | + inherits: openstack-services |
277 | + series: trusty |
278 | + overrides: |
279 | + openstack-origin: cloud:trusty-liberty |
280 | + source: cloud:trusty-liberty |
281 | +trusty-liberty-proposed: |
282 | + inherits: trusty-liberty |
283 | + overrides: |
284 | + openstack-origin: cloud:trusty-liberty/proposed |
285 | + source: cloud:trusty-liberty/proposed |
286 | +trusty-liberty-staging: |
287 | + inherits: trusty-liberty |
288 | + overrides: |
289 | + openstack-origin: ppa:ubuntu-cloud-archive/liberty-staging |
290 | + source: ppa:ubuntu-cloud-archive/liberty-staging |
291 | +# mitaka |
292 | +trusty-mitaka: |
293 | + #NOTE(coreycb): Temporarily disable reactive charms until |
294 | + # https://bugs.launchpad.net/bugs/1643027 is resolved. |
295 | + #inherits: openstack-services-trusty-mitaka |
296 | + inherits: openstack-services |
297 | + series: trusty |
298 | + overrides: |
299 | + openstack-origin: cloud:trusty-mitaka |
300 | + source: cloud:trusty-mitaka |
301 | +trusty-mitaka-proposed: |
302 | + inherits: trusty-mitaka |
303 | + overrides: |
304 | + openstack-origin: cloud:trusty-mitaka/proposed |
305 | + source: cloud:trusty-mitaka/proposed |
306 | +trusty-mitaka-staging: |
307 | + inherits: trusty-mitaka |
308 | + overrides: |
309 | + openstack-origin: ppa:ubuntu-cloud-archive/mitaka-staging |
310 | + source: ppa:ubuntu-cloud-archive/mitaka-staging |
311 | +xenial-mitaka: |
312 | + inherits: openstack-services-xenial |
313 | + series: xenial |
314 | +xenial-mitaka-proposed: |
315 | + inherits: xenial-mitaka |
316 | + overrides: |
317 | + source: proposed |
318 | + openstack-origin: distro-proposed |
319 | +# newton |
320 | +xenial-newton: |
321 | + inherits: openstack-services-xenial |
322 | + series: xenial |
323 | + overrides: |
324 | + openstack-origin: cloud:xenial-newton |
325 | + source: cloud:xenial-newton |
326 | +xenial-newton-proposed: |
327 | + inherits: xenial-newton |
328 | + overrides: |
329 | + openstack-origin: cloud:xenial-newton/proposed |
330 | + source: cloud:xenial-newton/proposed |
331 | +xenial-newton-staging: |
332 | + inherits: xenial-newton |
333 | + overrides: |
334 | + openstack-origin: ppa:ubuntu-cloud-archive/newton-staging |
335 | + source: ppa:ubuntu-cloud-archive/newton-staging |
336 | +xenial-newton-branch: |
337 | + inherits: xenial-newton |
338 | + overrides: |
339 | + openstack-origin: ppa:openstack-ubuntu-testing/newton |
340 | + source: ppa:openstack-ubuntu-testing/newton |
341 | +# ocata |
342 | +xenial-ocata: |
343 | + inherits: openstack-services-xenial-ocata |
344 | + series: xenial |
345 | + overrides: |
346 | + openstack-origin: cloud:xenial-ocata |
347 | + source: cloud:xenial-ocata |
348 | +xenial-ocata-proposed: |
349 | + inherits: xenial-ocata |
350 | + overrides: |
351 | + openstack-origin: cloud:xenial-ocata/proposed |
352 | + source: cloud:xenial-ocata/proposed |
353 | +xenial-ocata-staging: |
354 | + inherits: xenial-ocata |
355 | + overrides: |
356 | + openstack-origin: ppa:ubuntu-cloud-archive/ocata-staging |
357 | + source: ppa:ubuntu-cloud-archive/ocata-staging |
358 | +xenial-ocata-branch: |
359 | + inherits: xenial-ocata |
360 | + overrides: |
361 | + openstack-origin: ppa:openstack-ubuntu-testing/ocata |
362 | + source: ppa:openstack-ubuntu-testing/ocata |
363 | +zesty-ocata: |
364 | + inherits: openstack-services-xenial-ocata |
365 | + series: zesty |
366 | +zesty-ocata-proposed: |
367 | + inherits: zesty-ocata |
368 | + overrides: |
369 | + source: proposed |
370 | + openstack-origin: distro-proposed |
371 | +zesty-ocata-branch: |
372 | + inherits: zesty-ocata |
373 | + overrides: |
374 | + openstack-origin: ppa:openstack-ubuntu-testing/ocata |
375 | + source: ppa:openstack-ubuntu-testing/ocata |
376 | +# pike |
377 | +xenial-pike: |
378 | + inherits: openstack-services-xenial-ocata |
379 | + series: xenial |
380 | + overrides: |
381 | + openstack-origin: cloud:xenial-pike |
382 | + source: cloud:xenial-pike |
383 | +xenial-pike-proposed: |
384 | + inherits: xenial-pike |
385 | + overrides: |
386 | + openstack-origin: cloud:xenial-pike/proposed |
387 | + source: cloud:xenial-pike/proposed |
388 | +xenial-pike-staging: |
389 | + inherits: xenial-pike |
390 | + overrides: |
391 | + openstack-origin: ppa:ubuntu-cloud-archive/pike-staging |
392 | + source: ppa:ubuntu-cloud-archive/pike-staging |
393 | +xenial-pike-branch: |
394 | + inherits: xenial-pike |
395 | + overrides: |
396 | + openstack-origin: ppa:openstack-ubuntu-testing/pike |
397 | + source: ppa:openstack-ubuntu-testing/pike |
398 | +artful-pike: |
399 | + inherits: openstack-services-xenial-ocata |
400 | + series: artful |
401 | +artful-pike-proposed: |
402 | + inherits: artful-pike |
403 | + overrides: |
404 | + source: proposed |
405 | + openstack-origin: distro-proposed |
406 | +artful-pike-branch: |
407 | + inherits: artful-pike |
408 | + overrides: |
409 | + openstack-origin: ppa:openstack-ubuntu-testing/pike |
410 | + source: ppa:openstack-ubuntu-testing/pike |
411 | |
412 | === modified file 'helper/collect/collect-next-reactive-xenial' |
413 | --- helper/collect/collect-next-reactive-xenial 2018-01-18 00:23:37 +0000 |
414 | +++ helper/collect/collect-next-reactive-xenial 2018-02-02 09:55:24 +0000 |
415 | @@ -7,6 +7,7 @@ |
416 | cinder-ceph cs:~openstack-charmers-next/cinder-ceph |
417 | cinder cs:~openstack-charmers-next/cinder |
418 | glance cs:~openstack-charmers-next/glance |
419 | +hacluster cs:~openstack-charmers-next/hacluster |
420 | heat cs:~openstack-charmers-next/heat |
421 | keystone cs:~openstack-charmers-next/keystone |
422 | mongodb cs:~thedac/mongodb |
423 | |
424 | === modified file 'helper/setup/preflight.py' |
425 | --- helper/setup/preflight.py 2017-09-08 22:30:38 +0000 |
426 | +++ helper/setup/preflight.py 2018-02-02 09:55:24 +0000 |
427 | @@ -23,6 +23,7 @@ |
428 | 'MOJO_OS_VIP07', |
429 | 'MOJO_OS_VIP08', |
430 | 'MOJO_OS_VIP09', |
431 | + 'MOJO_OS_VIP10', |
432 | ] |
433 | |
434 | |
435 | |
436 | === added file 'helper/tests/expand_and_shrink_bind.py' |
437 | --- helper/tests/expand_and_shrink_bind.py 1970-01-01 00:00:00 +0000 |
438 | +++ helper/tests/expand_and_shrink_bind.py 2018-02-02 09:55:24 +0000 |
439 | @@ -0,0 +1,59 @@ |
440 | +#!/usr/bin/env python |
441 | +import sys |
442 | +import utils.mojo_utils as mojo_utils |
443 | +import utils.mojo_os_utils as mojo_os_utils |
444 | +import argparse |
445 | +import time |
446 | + |
447 | +TEST_DOMAIN = 'mojo-ha-tests.com.' |
448 | +TEST_DOMAIN_EMAIL = 'fred@mojo-ha-tests.com' |
449 | +TEST_WWW_RECORD = "www.{}".format(TEST_DOMAIN) |
450 | +TEST_RECORD = {TEST_WWW_RECORD: '10.0.0.23'} |
451 | + |
452 | + |
453 | +def main(argv): |
454 | + mojo_utils.setup_logging() |
455 | + # Setup client |
456 | + overcloud_novarc = mojo_utils.get_overcloud_auth() |
457 | + keystone_session = mojo_os_utils.get_keystone_session(overcloud_novarc, |
458 | + scope='PROJECT') |
459 | + client = mojo_os_utils.get_designate_session_client(keystone_session) |
460 | + |
461 | + # Create test domain and record in test domain |
462 | + domain = mojo_os_utils.create_designate_dns_domain( |
463 | + client, |
464 | + TEST_DOMAIN, |
465 | + TEST_DOMAIN_EMAIL) |
466 | + record = mojo_os_utils.create_designate_dns_record( |
467 | + client, |
468 | + domain.id, |
469 | + TEST_WWW_RECORD, |
470 | + "A", |
471 | + TEST_RECORD[TEST_WWW_RECORD]) |
472 | + |
473 | + # Test record is in bind and designate |
474 | + mojo_os_utils.check_dns_entry( |
475 | + client, |
476 | + TEST_RECORD[TEST_WWW_RECORD], |
477 | + TEST_DOMAIN, |
478 | + record_name=TEST_WWW_RECORD) |
479 | + |
480 | + mojo_utils.add_unit('designate-bind') |
481 | + |
482 | + mojo_os_utils.check_dns_entry( |
483 | + client, |
484 | + TEST_RECORD[TEST_WWW_RECORD], |
485 | + TEST_DOMAIN, |
486 | + record_name=TEST_WWW_RECORD) |
487 | + |
488 | + mojo_utils.delete_oldest('designate-bind') |
489 | + |
490 | + mojo_os_utils.check_dns_entry( |
491 | + client, |
492 | + TEST_RECORD[TEST_WWW_RECORD], |
493 | + TEST_DOMAIN, |
494 | + record_name=TEST_WWW_RECORD) |
495 | + |
496 | + |
497 | +if __name__ == "__main__": |
498 | + sys.exit(main(sys.argv)) |
499 | |
500 | === modified file 'helper/utils/mojo_os_utils.py' |
501 | --- helper/utils/mojo_os_utils.py 2018-01-23 13:23:09 +0000 |
502 | +++ helper/utils/mojo_os_utils.py 2018-02-02 09:55:24 +0000 |
503 | @@ -20,6 +20,9 @@ |
504 | from neutronclient.v2_0 import client as neutronclient |
505 | |
506 | import designateclient.v1 as designateclient_v1 |
507 | +import designateclient.v1.domains as des_domains |
508 | +import designateclient.v1.records as des_records |
509 | +import designateclient.exceptions as des_exceptions |
510 | |
511 | import logging |
512 | import re |
513 | @@ -1060,6 +1063,66 @@ |
514 | return [r for r in designate_client.records.list(domain) if r.data == ip] |
515 | |
516 | |
517 | +def create_designate_dns_domain(designate_client, domain_name, email, |
518 | + recreate=True): |
519 | + """Create the given domain in designate |
520 | + |
521 | + @param designate_client: designateclient.v1.Client Client to query |
522 | + designate |
523 | + @param domain_name: str Name of domain to lookup |
524 | + @param email: str Email address to associate with domain |
525 | + @param recreate: boolean Whether to delete any matching domains first. |
526 | + """ |
527 | + if recreate: |
528 | + delete_designate_dns_domain(designate_client, domain_name) |
529 | + for i in range(1, 10): |
530 | + try: |
531 | + domain = des_domains.Domain(name=domain_name, email=email) |
532 | + dom_obj = designate_client.domains.create(domain) |
533 | + except des_exceptions.Conflict: |
534 | + print("Waiting for delete {}/10".format(i)) |
535 | + time.sleep(10) |
536 | + else: |
537 | + break |
538 | + else: |
539 | + raise des_exceptions.Conflict |
540 | + else: |
541 | + domain = des_domains.Domain(name=domain_name, email=email) |
542 | + dom_obj = designate_client.domains.create(domain) |
543 | + return dom_obj |
544 | + |
545 | + |
546 | +def create_designate_dns_record(designate_client, domain_id, name, rtype, |
547 | + data): |
548 | + """Create the given record in designmate |
549 | + |
550 | + @param designate_client: designateclient.v1.Client Client to query |
551 | + designate |
552 | + @param domain_id: str UUID of domain to create record in |
553 | + @param name: str DNS fqdn entry to be created |
554 | + @param rtype: str record type eg A, CNAME etc |
555 | + @param data: str data to be associated with record |
556 | + @returns designateclient.v1.records.Record |
557 | + """ |
558 | + record = des_records.Record(name=name, type=rtype, data=data) |
559 | + return designate_client.records.create(domain_id, record) |
560 | + |
561 | + |
562 | +def delete_designate_dns_domain(designate_client, domain_name): |
563 | + """Delete the domains matching the given domain_name |
564 | + |
565 | + @param designate_client: designateclient.v1.Client Client to query |
566 | + designate |
567 | + @param domain_name: str Name of domain to lookup |
568 | + @raises AssertionError: if domain deletion fails |
569 | + """ |
570 | + dns_zone_id = get_designate_domain_objects(designate_client, domain_name) |
571 | + old_doms = get_designate_domain_objects(designate_client, domain_name) |
572 | + for old_dom in old_doms: |
573 | + logging.info("Deleting old domain {}".format(old_dom.id)) |
574 | + designate_client.domains.delete(old_dom.id) |
575 | + |
576 | + |
577 | def check_dns_record_exists(dns_server_ip, query_name, expected_ip, |
578 | retry_count=1): |
579 | """Lookup a DNS record against the given dns server address |
580 | @@ -1077,7 +1140,7 @@ |
581 | for i in range(1, retry_count + 1): |
582 | try: |
583 | answers = my_resolver.query(query_name) |
584 | - except dns.resolver.NXDOMAIN: |
585 | + except (dns.resolver.NXDOMAIN, dns.resolver.NoNameservers): |
586 | logging.info( |
587 | 'Attempt {}/{} to lookup {}@{} failed. Sleeping before ' |
588 | 'retrying'.format(i, retry_count, query_name, |
589 | @@ -1095,6 +1158,22 @@ |
590 | assert str(rdata) == expected_ip |
591 | |
592 | |
593 | +def check_dns_entry(des_client, ip, domain, record_name, juju_status=None): |
594 | + """Check that record for ip address is in designate and in bind if bind |
595 | + server is available. |
596 | + |
597 | + @param ip: str IP address to lookup |
598 | + @param domain: str domain to look for record in |
599 | + @param record_name: str record name |
600 | + @param juju_status: dict Current juju status |
601 | + """ |
602 | + if not juju_status: |
603 | + juju_status = mojo_utils.get_juju_status() |
604 | + check_dns_entry_in_designate(des_client, ip, domain, |
605 | + record_name=record_name) |
606 | + check_dns_entry_in_bind(ip, record_name, juju_status=juju_status) |
607 | + |
608 | + |
609 | def check_dns_entry_in_designate(des_client, ip, domain, record_name=None): |
610 | """Look for records in designate that match the given ip in the given |
611 | domain |
612 | |
613 | === added symlink 'specs/full_stack/next_deploy_designate/mitaka/designate-next-ha.yaml' |
614 | === target is u'../../../../helper/bundles/designate-next-ha.yaml' |
615 | === added symlink 'specs/full_stack/next_deploy_designate/mitaka/expand_and_shrink_bind.py' |
616 | === target is u'../../../../helper/tests/expand_and_shrink_bind.py' |
617 | === modified file 'specs/full_stack/next_deploy_designate/mitaka/manifest' |
618 | --- specs/full_stack/next_deploy_designate/mitaka/manifest 2018-01-19 12:15:27 +0000 |
619 | +++ specs/full_stack/next_deploy_designate/mitaka/manifest 2018-02-02 09:55:24 +0000 |
620 | @@ -1,8 +1,11 @@ |
621 | +# Validate env variables |
622 | +script config=preflight.py |
623 | + |
624 | # Collect the charm branches from Launchpad |
625 | collect config=collect-next-reactive-${MOJO_SERIES} |
626 | |
627 | -# Use juju deployer with reactive-next.yaml bundle |
628 | -deploy config=reactive-next.yaml delay=0 wait=False target=${MOJO_SERIES}-mitaka |
629 | +# Use juju deployer with designate-next-ha.yaml bundle |
630 | +deploy config=designate-next-ha.yaml delay=0 wait=False target=${MOJO_SERIES}-mitaka |
631 | |
632 | # Check juju statuses are green and that hooks have finished |
633 | verify config=check_juju.py |
634 | @@ -25,4 +28,7 @@ |
635 | # Test DNS records |
636 | verify config=validate_designate.py |
637 | |
638 | +# Expand and shrink bind service checking DNS records persist at each stage |
639 | +script config=expand_and_shrink_bind.py |
640 | + |
641 | # Success |
642 | |
643 | === added symlink 'specs/full_stack/next_deploy_designate/mitaka/preflight.py' |
644 | === target is u'../../../../helper/setup/preflight.py' |
645 | === removed symlink 'specs/full_stack/next_deploy_designate/mitaka/reactive-next.yaml' |
646 | === target was u'../../../../helper/bundles/reactive-next.yaml' |
647 | === added symlink 'specs/full_stack/next_deploy_designate/newton/designate-next-ha.yaml' |
648 | === target is u'../../../../helper/bundles/designate-next-ha.yaml' |
649 | === added symlink 'specs/full_stack/next_deploy_designate/newton/expand_and_shrink_bind.py' |
650 | === target is u'../../../../helper/tests/expand_and_shrink_bind.py' |
651 | === modified file 'specs/full_stack/next_deploy_designate/newton/manifest' |
652 | --- specs/full_stack/next_deploy_designate/newton/manifest 2018-01-19 12:15:27 +0000 |
653 | +++ specs/full_stack/next_deploy_designate/newton/manifest 2018-02-02 09:55:24 +0000 |
654 | @@ -1,8 +1,11 @@ |
655 | +# Validate env variables |
656 | +script config=preflight.py |
657 | + |
658 | # Collect the charm branches from Launchpad |
659 | collect config=collect-next-reactive-${MOJO_SERIES} |
660 | |
661 | -# Use juju deployer with reactive-next.yaml bundle |
662 | -deploy config=reactive-next.yaml delay=0 wait=False target=${MOJO_SERIES}-newton |
663 | +# Use juju deployer with designate-next-ha.yaml bundle |
664 | +deploy config=designate-next-ha.yaml delay=0 wait=False target=${MOJO_SERIES}-newton |
665 | |
666 | # Check juju statuses are green and that hooks have finished |
667 | verify config=check_juju.py |
668 | @@ -25,4 +28,7 @@ |
669 | # Test DNS records |
670 | verify config=validate_designate.py |
671 | |
672 | +# Expand and shrink bind service checking DNS records persist at each stage |
673 | +script config=expand_and_shrink_bind.py |
674 | + |
675 | # Success |
676 | |
677 | === added symlink 'specs/full_stack/next_deploy_designate/newton/preflight.py' |
678 | === target is u'../../../../helper/setup/preflight.py' |
679 | === removed symlink 'specs/full_stack/next_deploy_designate/newton/reactive-next.yaml' |
680 | === target was u'../../../../helper/bundles/reactive-next.yaml' |
681 | === added symlink 'specs/full_stack/next_deploy_designate/ocata/designate-next-ha.yaml' |
682 | === target is u'../../../../helper/bundles/designate-next-ha.yaml' |
683 | === added symlink 'specs/full_stack/next_deploy_designate/ocata/expand_and_shrink_bind.py' |
684 | === target is u'../../../../helper/tests/expand_and_shrink_bind.py' |
685 | === modified file 'specs/full_stack/next_deploy_designate/ocata/manifest' |
686 | --- specs/full_stack/next_deploy_designate/ocata/manifest 2018-01-19 12:15:27 +0000 |
687 | +++ specs/full_stack/next_deploy_designate/ocata/manifest 2018-02-02 09:55:24 +0000 |
688 | @@ -1,8 +1,11 @@ |
689 | +# Validate env variables |
690 | +script config=preflight.py |
691 | + |
692 | # Collect the charm branches from Launchpad |
693 | collect config=collect-next-reactive-${MOJO_SERIES} |
694 | |
695 | # Use juju deployer with reactive-next.yaml bundle |
696 | -deploy config=reactive-next.yaml delay=0 wait=False target=${MOJO_SERIES}-ocata |
697 | +deploy config=designate-next-ha.yaml delay=0 wait=False target=${MOJO_SERIES}-ocata |
698 | |
699 | # Check juju statuses are green and that hooks have finished |
700 | verify config=check_juju.py |
701 | @@ -25,4 +28,7 @@ |
702 | # Test DNS records |
703 | verify config=validate_designate.py |
704 | |
705 | +# Expand and shrink bind service checking DNS records persist at each stage |
706 | +script config=expand_and_shrink_bind.py |
707 | + |
708 | # Success |
709 | |
710 | === added symlink 'specs/full_stack/next_deploy_designate/ocata/preflight.py' |
711 | === target is u'../../../../helper/setup/preflight.py' |
712 | === removed symlink 'specs/full_stack/next_deploy_designate/ocata/reactive-next.yaml' |
713 | === target was u'../../../../helper/bundles/reactive-next.yaml' |
714 | === added symlink 'specs/full_stack/next_deploy_designate/pike/designate-next-ha.yaml' |
715 | === target is u'../../../../helper/bundles/designate-next-ha.yaml' |
716 | === added symlink 'specs/full_stack/next_deploy_designate/pike/expand_and_shrink_bind.py' |
717 | === target is u'../../../../helper/tests/expand_and_shrink_bind.py' |
718 | === modified file 'specs/full_stack/next_deploy_designate/pike/manifest' |
719 | --- specs/full_stack/next_deploy_designate/pike/manifest 2018-01-19 12:15:27 +0000 |
720 | +++ specs/full_stack/next_deploy_designate/pike/manifest 2018-02-02 09:55:24 +0000 |
721 | @@ -1,8 +1,11 @@ |
722 | +# Validate env variables |
723 | +script config=preflight.py |
724 | + |
725 | # Collect the charm branches from Launchpad |
726 | collect config=collect-next-reactive-${MOJO_SERIES} |
727 | |
728 | -# Use juju deployer with reactive-next.yaml bundle |
729 | -deploy config=reactive-next.yaml delay=0 wait=False target=${MOJO_SERIES}-pike |
730 | +# Use juju deployer with designate-next-ha.yaml bundle |
731 | +deploy config=designate-next-ha.yaml delay=0 wait=False target=${MOJO_SERIES}-pike |
732 | |
733 | # Check juju statuses are green and that hooks have finished |
734 | verify config=check_juju.py |
735 | @@ -25,4 +28,7 @@ |
736 | # Test DNS records |
737 | verify config=validate_designate.py |
738 | |
739 | +# Expand and shrink bind service checking DNS records persist at each stage |
740 | +script config=expand_and_shrink_bind.py |
741 | + |
742 | # Success |
743 | |
744 | === added symlink 'specs/full_stack/next_deploy_designate/pike/preflight.py' |
745 | === target is u'../../../../helper/setup/preflight.py' |
746 | === removed symlink 'specs/full_stack/next_deploy_designate/pike/reactive-next.yaml' |
747 | === target was u'../../../../helper/bundles/reactive-next.yaml' |
A couple of stray debug prints.
But also we seem to be using the first version of the next_deploy_ designate spec while changing the bundle from reactive-next.yaml to designate- next.yaml.
Do the original tests all pass?
Should we get rid of one or the other of the bundles?
The original intent of reactive-next.yaml was to have a place for all of the new charms.
Should this be the HA version of that?