~openstack-charmers-next/charms/wily/ceph-osd/trunk

« back to all changes in this revision

Viewing changes to tests/basic_deployment.py

  • Committer: Gerrit Code Review
  • Author(s): Jenkins
  • Date: 2016-03-24 17:39:12 UTC
  • mfrom: (74.1.1 trunk)
  • Revision ID: review@openstack.org-20160324173912-zk35qe8ud8aages8
Merge "Rolling upgrades of ceph osd cluster"

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
           and the rest of the service are from lp branches that are
44
44
           compatible with the local charm (e.g. stable or next).
45
45
           """
46
 
        this_service = {'name': 'ceph-osd'}
47
 
        other_services = [{'name': 'ceph', 'units': 3},
 
46
        this_service = {'name': 'ceph-osd', 'units': 3}
 
47
        other_services = [{'name': 'ceph-mon', 'units': 3},
48
48
                          {'name': 'mysql'},
49
49
                          {'name': 'keystone'},
50
50
                          {'name': 'rabbitmq-server'},
60
60
            'nova-compute:shared-db': 'mysql:shared-db',
61
61
            'nova-compute:amqp': 'rabbitmq-server:amqp',
62
62
            'nova-compute:image-service': 'glance:image-service',
63
 
            'nova-compute:ceph': 'ceph:client',
 
63
            'nova-compute:ceph': 'ceph-mon:client',
64
64
            'keystone:shared-db': 'mysql:shared-db',
65
65
            'glance:shared-db': 'mysql:shared-db',
66
66
            'glance:identity-service': 'keystone:identity-service',
67
67
            'glance:amqp': 'rabbitmq-server:amqp',
68
 
            'glance:ceph': 'ceph:client',
 
68
            'glance:ceph': 'ceph-mon:client',
69
69
            'cinder:shared-db': 'mysql:shared-db',
70
70
            'cinder:identity-service': 'keystone:identity-service',
71
71
            'cinder:amqp': 'rabbitmq-server:amqp',
72
72
            'cinder:image-service': 'glance:image-service',
73
 
            'cinder:ceph': 'ceph:client',
74
 
            'ceph-osd:mon': 'ceph:osd'
 
73
            'cinder:ceph': 'ceph-mon:client',
 
74
            'ceph-osd:mon': 'ceph-mon:osd'
75
75
        }
76
76
        super(CephOsdBasicDeployment, self)._add_relations(relations)
77
77
 
86
86
            'auth-supported': 'none',
87
87
            'fsid': '6547bd3e-1397-11e2-82e5-53567c8d32dc',
88
88
            'monitor-secret': 'AQCXrnZQwI7KGBAAiPofmKEXKxu5bUzoYLVkbQ==',
89
 
            'osd-reformat': 'yes',
90
 
            'ephemeral-unmount': '/mnt',
91
 
            'osd-devices': '/dev/vdb /srv/ceph'
92
89
        }
93
90
 
94
91
        # Include a non-existent device as osd-devices is a whitelist,
102
99
        configs = {'keystone': keystone_config,
103
100
                   'mysql': mysql_config,
104
101
                   'cinder': cinder_config,
105
 
                   'ceph': ceph_config,
 
102
                   'ceph-mon': ceph_config,
106
103
                   'ceph-osd': ceph_osd_config}
107
104
        super(CephOsdBasicDeployment, self)._configure_services(configs)
108
105
 
115
112
        self.nova_sentry = self.d.sentry.unit['nova-compute/0']
116
113
        self.glance_sentry = self.d.sentry.unit['glance/0']
117
114
        self.cinder_sentry = self.d.sentry.unit['cinder/0']
118
 
        self.ceph0_sentry = self.d.sentry.unit['ceph/0']
119
 
        self.ceph1_sentry = self.d.sentry.unit['ceph/1']
120
 
        self.ceph2_sentry = self.d.sentry.unit['ceph/2']
 
115
        self.ceph0_sentry = self.d.sentry.unit['ceph-mon/0']
 
116
        self.ceph1_sentry = self.d.sentry.unit['ceph-mon/1']
 
117
        self.ceph2_sentry = self.d.sentry.unit['ceph-mon/2']
121
118
        self.ceph_osd_sentry = self.d.sentry.unit['ceph-osd/0']
 
119
        self.ceph_osd1_sentry = self.d.sentry.unit['ceph-osd/1']
 
120
        self.ceph_osd2_sentry = self.d.sentry.unit['ceph-osd/2']
122
121
        u.log.debug('openstack release val: {}'.format(
123
122
            self._get_openstack_release()))
124
123
        u.log.debug('openstack release str: {}'.format(
177
176
        # Process name and quantity of processes to expect on each unit
178
177
        ceph_processes = {
179
178
            'ceph-mon': 1,
180
 
            'ceph-osd': 2
181
179
        }
182
180
 
183
181
        # Units with process names and PID quantities expected
214
212
            ceph_services = [
215
213
                'ceph-mon-all',
216
214
                'ceph-mon id=`hostname`',
217
 
                'ceph-osd-all',
218
 
                'ceph-osd id={}'.format(u.get_ceph_osd_id_cmd(0)),
219
 
                'ceph-osd id={}'.format(u.get_ceph_osd_id_cmd(1))
220
215
            ]
221
216
            services[self.ceph0_sentry] = ceph_services
222
217
            services[self.ceph1_sentry] = ceph_services
233
228
 
234
229
    def test_200_ceph_osd_ceph_relation(self):
235
230
        """Verify the ceph-osd to ceph relation data."""
236
 
        u.log.debug('Checking ceph-osd:ceph mon relation data...')
 
231
        u.log.debug('Checking ceph-osd:ceph-mon relation data...')
237
232
        unit = self.ceph_osd_sentry
238
 
        relation = ['mon', 'ceph:osd']
 
233
        relation = ['mon', 'ceph-mon:osd']
239
234
        expected = {
240
235
            'private-address': u.valid_ip
241
236
        }
242
237
 
243
238
        ret = u.validate_relation_data(unit, relation, expected)
244
239
        if ret:
245
 
            message = u.relation_error('ceph-osd to ceph', ret)
 
240
            message = u.relation_error('ceph-osd to ceph-mon', ret)
246
241
            amulet.raise_status(amulet.FAIL, msg=message)
247
242
 
248
243
    def test_201_ceph0_to_ceph_osd_relation(self):