~gnuoy/charms/trusty/glance/keystoneauth

« back to all changes in this revision

Viewing changes to tests/basic_deployment.py

  • Committer: James Page
  • Date: 2016-03-10 11:46:02 UTC
  • Revision ID: james.page@ubuntu.com-20160310114602-kbv3vr0a0n18xynv
Drop charm supplied paste.ini configurations

The glance-api-paste.ini and glance-registry-paste.ini configuration
files provided as part of the glance packages should be used; drop
charm templates and associated code paths.

This was required in early OpenStack versions where keystone auth
credentials where rendered into the paste ini file.

Existing deployments will go through a upgrade step to replace the
previously provided paste files from the charm with those provided
by the glance-api and glance-registry packages.

Change-Id: I016b8cb7823b98e8dffa91b3b427ed88a7b619bc

Show diffs side-by-side

added added

removed removed

Lines of Context:
476
476
                message = "glance registry paste config error: {}".format(ret)
477
477
                amulet.raise_status(amulet.FAIL, msg=message)
478
478
 
479
 
    def _get_filter_factory_expected_dict(self):
480
 
        """Return expected authtoken filter factory dict for OS release"""
481
 
        if self._get_openstack_release() >= self.trusty_kilo:
482
 
            # Kilo and later
483
 
            val = 'keystonemiddleware.auth_token:filter_factory'
484
 
        else:
485
 
            # Juno and earlier
486
 
            val = 'keystoneclient.middleware.auth_token:filter_factory'
487
 
 
488
 
        return {'filter:authtoken': {'paste.filter_factory': val}}
489
 
 
490
 
    def test_304_glance_api_paste_auth_config(self):
491
 
        """Verify authtoken section config in glance-api-paste.ini using
492
 
           glance/keystone relation data."""
493
 
        u.log.debug('Checking glance api paste config file...')
494
 
        unit = self.glance_sentry
495
 
        conf = '/etc/glance/glance-api-paste.ini'
496
 
        expected = self._get_filter_factory_expected_dict()
497
 
 
498
 
        for section, pairs in expected.iteritems():
499
 
            ret = u.validate_config_data(unit, conf, section, pairs)
500
 
            if ret:
501
 
                message = "glance api paste config error: {}".format(ret)
502
 
                amulet.raise_status(amulet.FAIL, msg=message)
503
 
 
504
 
    def test_306_glance_registry_paste_auth_config(self):
505
 
        """Verify authtoken section config in glance-registry-paste.ini using
506
 
           glance/keystone relation data."""
507
 
        u.log.debug('Checking glance registry paste config file...')
508
 
        unit = self.glance_sentry
509
 
        conf = '/etc/glance/glance-registry-paste.ini'
510
 
        expected = self._get_filter_factory_expected_dict()
511
 
 
512
 
        for section, pairs in expected.iteritems():
513
 
            ret = u.validate_config_data(unit, conf, section, pairs)
514
 
            if ret:
515
 
                message = "glance registry paste config error: {}".format(ret)
516
 
                amulet.raise_status(amulet.FAIL, msg=message)
517
 
 
518
479
    def test_410_glance_image_create_delete(self):
519
480
        """Create new cirros image in glance, verify, then delete it."""
520
481
        u.log.debug('Creating, checking and deleting glance image...')