~corey.bryant/charms/trusty/keystone/mkdir755

« back to all changes in this revision

Viewing changes to tests/basic_deployment.py

  • Committer: james.page at ubuntu
  • Date: 2015-04-16 19:55:16 UTC
  • mfrom: (88.4.67 keystone)
  • Revision ID: james.page@ubuntu.com-20150416195516-mr74d2ad5zqmd1tb
[coreycb,r=james-page] Add deploy from source support

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
 
3
3
import amulet
 
4
import os
 
5
import yaml
4
6
 
5
7
from charmhelpers.contrib.openstack.amulet.deployment import (
6
8
    OpenStackAmuletDeployment
13
15
)
14
16
 
15
17
# Use DEBUG to turn on debug logging
16
 
u = OpenStackAmuletUtils(ERROR)
 
18
u = OpenStackAmuletUtils(DEBUG)
17
19
 
18
20
 
19
21
class KeystoneBasicDeployment(OpenStackAmuletDeployment):
20
22
    """Amulet tests on a basic keystone deployment."""
21
23
 
22
 
    def __init__(self, series=None, openstack=None, source=None, stable=False):
 
24
    def __init__(self, series=None, openstack=None, source=None, git=False, stable=False):
23
25
        """Deploy the entire test environment."""
24
26
        super(KeystoneBasicDeployment, self).__init__(series, openstack, source, stable)
 
27
        self.git = git
25
28
        self._add_services()
26
29
        self._add_relations()
27
30
        self._configure_services()
50
53
        """Configure all of the services."""
51
54
        keystone_config = {'admin-password': 'openstack',
52
55
                           'admin-token': 'ubuntutesting'}
 
56
        if self.git:
 
57
            branch = 'stable/' + self._get_openstack_release_string()
 
58
            amulet_http_proxy = os.environ.get('AMULET_HTTP_PROXY')
 
59
            openstack_origin_git = {
 
60
                'repositories': [
 
61
                    {'name': 'requirements',
 
62
                     'repository': 'git://git.openstack.org/openstack/requirements',
 
63
                     'branch': branch},
 
64
                    {'name': 'keystone',
 
65
                     'repository': 'git://git.openstack.org/openstack/keystone',
 
66
                     'branch': branch},
 
67
                ],
 
68
                'directory': '/mnt/openstack-git',
 
69
                'http_proxy': amulet_http_proxy,
 
70
                'https_proxy': amulet_http_proxy,
 
71
            }
 
72
            keystone_config['openstack-origin-git'] = yaml.dump(openstack_origin_git)
 
73
 
53
74
        mysql_config = {'dataset-size': '50%'}
54
75
        cinder_config = {'block-device': 'None'}
55
76
        configs = {'keystone': keystone_config,