コード例 #1
0
 def test_per_unit_radosgw_key(self):
     self.test_relation.set({'key_name': 'testhostname'})
     ceph_hooks.radosgw_relation('radosgw:1', 'ceph-radosgw/0')
     self.relation_set.assert_called_once_with(
         relation_id='radosgw:1',
         relation_settings={
             'fsid': self.test_fsid,
             'auth': self.test_config.get('auth-supported'),
             'ceph-public-address': '10.10.10.2',
             'testhostname_key': self.test_key,
         })
     self.ceph.get_radosgw_key.assert_called_once_with(name='testhostname')
コード例 #2
0
 def test_per_unit_radosgw_key(self):
     self.test_relation.set({
         'key_name': 'testhostname'
     })
     ceph_hooks.radosgw_relation('radosgw:1', 'ceph-radosgw/0')
     self.relation_set.assert_called_once_with(
         relation_id='radosgw:1',
         relation_settings={
             'fsid': self.test_fsid,
             'auth': self.test_config.get('auth-supported'),
             'ceph-public-address': '10.10.10.2',
             'testhostname_key': self.test_key,
         }
     )
     self.ceph.get_radosgw_key.assert_called_once_with(name='testhostname')
コード例 #3
0
    def test_radosgw_relation(self, mock_apt_install, mock_check_output):
        settings = {'ceph-public-address': '127.0.0.1:1234 [::1]:4321',
                    'radosgw_key': CEPH_KEY,
                    'auth': 'cephx',
                    'fsid': 'some-fsid'}

        mock_check_output.return_value = CEPH_GET_KEY.encode()
        self.relation_get.return_value = {}
        self.test_config.set('monitor-hosts', settings['ceph-public-address'])
        self.test_config.set('fsid', settings['fsid'])
        self.test_config.set('admin-key', 'some-admin-key')
        hooks.radosgw_relation()
        self.relation_set.assert_called_with(relation_id=None,
                                             relation_settings=settings)
        mock_apt_install.assert_called_with(packages=[])
コード例 #4
0
    def test_radosgw_relation(self, mock_apt_install, mock_check_output):
        settings = {
            'ceph-public-address': '127.0.0.1:1234 [::1]:4321',
            'radosgw_key': CEPH_KEY,
            'auth': 'cephx',
            'fsid': 'some-fsid'
        }

        mock_check_output.return_value = CEPH_GET_KEY.encode()
        self.relation_get.return_value = {}
        self.test_config.set('monitor-hosts', settings['ceph-public-address'])
        self.test_config.set('fsid', settings['fsid'])
        self.test_config.set('admin-key', 'some-admin-key')
        hooks.radosgw_relation()
        self.relation_set.assert_called_with(relation_id=None,
                                             relation_settings=settings)
        mock_apt_install.assert_called_with(packages=[])