~corey.bryant/charms/trusty/nova-compute/amulet-git-fixups

« back to all changes in this revision

Viewing changes to tests/basic_deployment.py

  • Committer: Corey Bryant
  • Date: 2015-07-14 17:47:59 UTC
  • Revision ID: corey.bryant@canonical.com-20150714174759-0ndzi03xq2xqtlgu
Update tests for kilo

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
        if self._get_openstack_release() >= self.precise_folsom:
186
186
            endpoint_vol['id'] = u.not_null
187
187
            endpoint_id['id'] = u.not_null
188
 
        expected = {'s3': [endpoint_vol], 'compute': [endpoint_vol],
189
 
                    'ec2': [endpoint_vol], 'identity': [endpoint_id]}
 
188
        if self._get_openstack_release() >= self.trusty_kilo:
 
189
            expected = {'compute': [endpoint_vol], 'identity': [endpoint_id]}
 
190
        else:
 
191
            expected = {'s3': [endpoint_vol], 'compute': [endpoint_vol],
 
192
                        'ec2': [endpoint_vol], 'identity': [endpoint_id]}
190
193
        actual = self.keystone_demo.service_catalog.get_endpoints()
191
194
 
192
195
        ret = u.validate_svc_catalog_endpoint_data(expected, actual)
212
215
 
213
216
    def test_ec2_api_endpoint(self):
214
217
        """Verify the EC2 api endpoint data."""
 
218
        if self._get_openstack_release() >= self.trusty_kilo:
 
219
            return
 
220
 
215
221
        endpoints = self.keystone.endpoints.list()
216
222
        admin_port = internal_port = public_port = '8773'
217
223
        expected = {'id': u.not_null,
229
235
 
230
236
    def test_s3_api_endpoint(self):
231
237
        """Verify the S3 api endpoint data."""
 
238
        if self._get_openstack_release() >= self.trusty_kilo:
 
239
            return
 
240
 
232
241
        endpoints = self.keystone.endpoints.list()
233
242
        admin_port = internal_port = public_port = '3333'
234
243
        expected = {'id': u.not_null,
385
394
                                              mysql_relation['db_host'],
386
395
                                              'nova')
387
396
 
388
 
        expected = {'dhcpbridge_flagfile': '/etc/nova/nova.conf',
389
 
                    'dhcpbridge': '/usr/bin/nova-dhcpbridge',
390
 
                    'logdir': '/var/log/nova',
391
 
                    'state_path': '/var/lib/nova',
392
 
                    'lock_path': '/var/lock/nova',
393
 
                    'force_dhcp_release': 'True',
394
 
                    'libvirt_use_virtio_for_bridges': 'True',
395
 
                    'verbose': 'False',
396
 
                    'use_syslog': 'False',
397
 
                    'ec2_private_dns_show_ip': 'True',
398
 
                    'api_paste_config': '/etc/nova/api-paste.ini',
399
 
                    'enabled_apis': 'ec2,osapi_compute,metadata',
400
 
                    'auth_strategy': 'keystone',
401
 
                    'compute_driver': 'libvirt.LibvirtDriver',
402
 
                    'sql_connection': db_uri,
 
397
        expected = {
 
398
            'DEFAULT': {
 
399
                'dhcpbridge_flagfile': '/etc/nova/nova.conf',
 
400
                'dhcpbridge': '/usr/bin/nova-dhcpbridge',
 
401
                'logdir': '/var/log/nova',
 
402
                'state_path': '/var/lib/nova',
 
403
                'force_dhcp_release': 'True',
 
404
                'verbose': 'False',
 
405
                'use_syslog': 'False',
 
406
                'ec2_private_dns_show_ip': 'True',
 
407
                'api_paste_config': '/etc/nova/api-paste.ini',
 
408
                'enabled_apis': 'ec2,osapi_compute,metadata',
 
409
                'auth_strategy': 'keystone',
 
410
                'flat_interface': 'eth1',
 
411
                'network_manager': 'nova.network.manager.FlatDHCPManager',
 
412
                'volume_api_class': 'nova.volume.cinder.API',
 
413
            }
 
414
        }
 
415
        if self._get_openstack_release() < self.trusty_kilo:
 
416
            d = 'DEFAULT'
 
417
            expected[d]['lock_path'] = '/var/lock/nova'
 
418
            expected[d]['libvirt_use_virtio_for_bridges'] = 'True'
 
419
            expected[d]['compute_driver'] = 'libvirt.LibvirtDriver'
 
420
            expected[d]['sql_connection'] = db_uri
 
421
            expected[d]['rabbit_userid'] = 'nova'
 
422
            expected[d]['rabbit_virtual_host'] = 'openstack'
 
423
            expected[d]['rabbit_password'] = rabbitmq_relation['password']
 
424
            expected[d]['rabbit_host'] = rabbitmq_relation['hostname']
 
425
            expected[d]['glance_api_servers'] = glance_relation['glance-api-server']
 
426
        else:
 
427
            oslo_concurrency = {
 
428
                'oslo_concurrency': {
 
429
                    'lock_path': '/var/lock/nova'
 
430
                }
 
431
            }
 
432
            database = {
 
433
                'database': {
 
434
                    'connection': db_uri
 
435
                }
 
436
            }
 
437
            oslo_messaging_rabbit = {
 
438
                'oslo_messaging_rabbit': {
403
439
                    'rabbit_userid': 'nova',
404
440
                    'rabbit_virtual_host': 'openstack',
405
441
                    'rabbit_password': rabbitmq_relation['password'],
406
442
                    'rabbit_host': rabbitmq_relation['hostname'],
407
 
                    'glance_api_servers': glance_relation['glance-api-server'],
408
 
                    'flat_interface': 'eth1',
409
 
                    'network_manager': 'nova.network.manager.FlatDHCPManager',
410
 
                    'volume_api_class': 'nova.volume.cinder.API'}
 
443
                }
 
444
            }
 
445
            glance = {
 
446
                'glance': {
 
447
                    'api_servers': glance_relation['glance-api-server']
 
448
                }
 
449
            }
 
450
            expected.update(oslo_concurrency)
 
451
            expected.update(database)
 
452
            expected.update(oslo_messaging_rabbit)
 
453
            expected.update(glance)
411
454
 
412
 
        ret = u.validate_config_data(unit, conf, 'DEFAULT', expected)
413
 
        if ret:
414
 
            message = "nova config error: {}".format(ret)
415
 
            amulet.raise_status(amulet.FAIL, msg=message)
 
455
        for section, pairs in expected.iteritems():
 
456
            ret = u.validate_config_data(unit, conf, section, pairs)
 
457
            if ret:
 
458
                message = "nova config error: {}".format(ret)
 
459
                amulet.raise_status(amulet.FAIL, msg=message)
416
460
 
417
461
    def test_image_instance_create(self):
418
462
        """Create an image/instance, verify they exist, and delete them."""