def test_ctxt(self, _harelation_ids, _ctxtrelation_ids, _haconfig, _ctxtconfig, _get_host_ip, _local_unit, _unit_get, _mkdir): _get_host_ip.return_value = '10.0.0.10' _unit_get.return_value = '10.0.0.10' _ctxtconfig.side_effect = self.test_config.get _haconfig.side_effect = self.test_config.get _harelation_ids.return_value = [] haproxy_context = context.HAProxyContext() self.determine_api_port.return_value = 70 expect = { 'cephradosgw_bind_port': 70, 'service_ports': {'cephradosgw-server': [80, 70]} } self.assertEqual(expect, haproxy_context())
CEPH_DIR = '/etc/ceph' CEPH_CONF = '{}/ceph.conf'.format(CEPH_DIR) VERSION_PACKAGE = 'radosgw' UNUSED_APACHE_SITE_FILES = ["/etc/apache2/sites-available/000-default.conf"] APACHE_PORTS_FILE = "/etc/apache2/ports.conf" APACHE_SITE_CONF = '/etc/apache2/sites-available/openstack_https_frontend' APACHE_SITE_24_CONF = '/etc/apache2/sites-available/' \ 'openstack_https_frontend.conf' BASE_RESOURCE_MAP = OrderedDict([ (HAPROXY_CONF, { 'contexts': [ context.HAProxyContext(singlenode_mode=True), ceph_radosgw_context.HAProxyContext() ], 'services': ['haproxy'], }), (CEPH_CONF, { 'contexts': [ceph_radosgw_context.MonContext()], 'services': [], }), (APACHE_SITE_CONF, { 'contexts': [ceph_radosgw_context.ApacheSSLContext()], 'services': ['apache2'], }), (APACHE_SITE_24_CONF, { 'contexts': [ceph_radosgw_context.ApacheSSLContext()], 'services': ['apache2'], }),