def test_resource_map_apache24(self, _path_exists, _manage_plugin): _path_exists.return_value = True _manage_plugin.return_value = True _map = nutils.resource_map() confs = [nutils.NEUTRON_CONF, nutils.NEUTRON_DEFAULT, nutils.APACHE_24_CONF] [self.assertIn(q_conf, _map.keys()) for q_conf in confs] self.assertTrue(nutils.APACHE_CONF not in _map.keys())
def test_resource_map_apache24(self, _path_exists): _path_exists.return_value = True _map = nutils.resource_map() confs = [ nutils.NEUTRON_CONF, nutils.NEUTRON_DEFAULT, nutils.APACHE_24_CONF ] [self.assertIn(q_conf, _map.keys()) for q_conf in confs] self.assertTrue(nutils.APACHE_CONF not in _map.keys())
def test_resource_map_apache24(self, _path_exists, _manage_plugin): self.os_release.return_value = 'havana' _path_exists.return_value = True _manage_plugin.return_value = True _map = nutils.resource_map() confs = [nutils.NEUTRON_CONF, nutils.NEUTRON_DEFAULT, nutils.APACHE_24_CONF] [self.assertIn(q_conf, _map.keys()) for q_conf in confs] self.assertTrue(nutils.APACHE_CONF not in _map.keys())
def test_resource_map_liberty(self, _path_exists, _manage_plugin): _path_exists.return_value = False _manage_plugin.return_value = True self.os_release.return_value = 'liberty' _map = nutils.resource_map() confs = [nutils.NEUTRON_CONF, nutils.NEUTRON_DEFAULT, nutils.APACHE_CONF, nutils.NEUTRON_LBAAS_CONF, nutils.NEUTRON_VPNAAS_CONF] [self.assertIn(q_conf, _map.keys()) for q_conf in confs] self.assertTrue(nutils.APACHE_24_CONF not in _map.keys())
def test_resource_map_queens(self, _path_exists, _manage_plugin): _path_exists.return_value = False _manage_plugin.return_value = True self.os_release.return_value = 'queens' _map = nutils.resource_map() confs = [nutils.NEUTRON_CONF, nutils.NEUTRON_DEFAULT, nutils.APACHE_CONF, nutils.NEUTRON_LBAAS_CONF, nutils.NEUTRON_VPNAAS_CONF] [self.assertIn(q_conf, _map.keys()) for q_conf in confs] self.assertTrue(nutils.APACHE_24_CONF not in _map.keys())
def test_resource_map_noplugin(self, _path_exists, _manage_plugin): _path_exists.return_value = True _manage_plugin.return_value = False _map = nutils.resource_map() found_sdn_ctxt = False found_sdnconfig_ctxt = False for ctxt in _map[nutils.NEUTRON_CONF]['contexts']: if isinstance(ctxt, ncontext.NeutronApiSDNContext): found_sdn_ctxt = True for ctxt in _map[nutils.NEUTRON_DEFAULT]['contexts']: if isinstance(ctxt, ncontext.NeutronApiSDNConfigFileContext): found_sdnconfig_ctxt = True self.assertTrue(found_sdn_ctxt and found_sdnconfig_ctxt)