Esempio n. 1
0
    def test_daemon_check_extra_config(self, _run_cephadm,
                                       cephadm_module: CephadmOrchestrator):
        _run_cephadm.return_value = ('{}', '', 0)

        with with_host(cephadm_module, 'test'):

            # Also testing deploying mons without explicit network placement
            cephadm_module.check_mon_command({
                'prefix': 'config set',
                'who': 'mon',
                'name': 'public_network',
                'value': '127.0.0.0/8'
            })

            cephadm_module.cache.update_host_devices_networks(
                'test', [], {
                    "127.0.0.0/8": ["127.0.0.1"],
                })

            with with_service(cephadm_module, ServiceSpec(service_type='mon'),
                              CephadmOrchestrator.apply_mon,
                              'test') as d_names:
                [daemon_name] = d_names

                cephadm_module._set_extra_ceph_conf('[mon]\nk=v')

                CephadmServe(cephadm_module)._check_daemons()

                _run_cephadm.assert_called_with(
                    'test',
                    'mon.test',
                    'deploy',
                    ['--name', 'mon.test', '--reconfig', '--config-json', '-'],
                    stdin='{"config": "\\n\\n[mon]\\nk=v\\n", "keyring": ""}',
                    image='')
Esempio n. 2
0
 def test_mds_config_purge(self, cephadm_module: CephadmOrchestrator):
     spec = ServiceSpec('mds', service_id='fsname')
     with with_host(cephadm_module, 'test'):
         with with_service(cephadm_module, spec, host='test'):
             ret, out, err = cephadm_module.check_mon_command({
                 'prefix': 'config get',
                 'who': spec.service_name(),
                 'key': 'mds_join_fs',
             })
             assert out == 'fsname'
         ret, out, err = cephadm_module.check_mon_command({
             'prefix': 'config get',
             'who': spec.service_name(),
             'key': 'mds_join_fs',
         })
         assert not out
Esempio n. 3
0
    def test_upgrade_run(self, use_repo_digest, cephadm_module: CephadmOrchestrator):
        with with_host(cephadm_module, 'test', refresh_hosts=False):
            cephadm_module.set_container_image('global', 'image')
            if use_repo_digest:
                cephadm_module.use_repo_digest = True

                CephadmServe(cephadm_module).convert_tags_to_repo_digest()

            _, image, _ = cephadm_module.check_mon_command({
                'prefix': 'config get',
                'who': 'global',
                'key': 'container_image',
            })
            if use_repo_digest:
                assert image == 'image@repo_digest'
            else:
                assert image == 'image'
Esempio n. 4
0
 def test_rgw_update(self, frontend, ssl, expected, cephadm_module: CephadmOrchestrator):
     with with_host(cephadm_module, 'host1'):
         cephadm_module.cache.update_host_networks('host1', {
             'fd00:fd00:fd00:3000::/64': {
                 'if0': ['fd00:fd00:fd00:3000::1']
             }
         })
         s = RGWSpec(service_id="foo",
                     networks=['fd00:fd00:fd00:3000::/64'],
                     ssl=ssl,
                     rgw_frontend_type=frontend)
         with with_service(cephadm_module, s) as dds:
             _, f, _ = cephadm_module.check_mon_command({
                 'prefix': 'config get',
                 'who': f'client.{dds[0]}',
                 'key': 'rgw_frontends',
             })
             assert f == expected