from oslo_config import cfg
-from neutron.agent.common import config
from neutron.agent.linux import external_process
from neutron.agent.linux import keepalived
-from neutron.openstack.common import log as logging
from neutron.tests.functional import base as functional_base
from neutron.tests.unit.agent.linux import test_keepalived
-LOG = logging.getLogger(__name__)
-
class KeepalivedManagerTestCase(functional_base.BaseSudoTestCase,
test_keepalived.KeepalivedConfBaseMixin):
def setUp(self):
super(KeepalivedManagerTestCase, self).setUp()
self.check_sudo_enabled()
- self._configure()
-
- def _configure(self):
- cfg.CONF.set_override('debug', False)
- config.setup_logging()
def test_keepalived_spawn(self):
expected_config = self._get_config()
pids_path=cfg.CONF.state_path)
self.assertTrue(process.active)
- config_path = manager._get_full_config_file_path('keepalived.conf')
- with open(config_path, 'r') as config_file:
- config_contents = config_file.read()
- self.assertEqual(expected_config.get_config_str(), config_contents)
+ self.assertEqual(expected_config.get_config_str(),
+ manager.get_conf_on_disk())
expected = self.get_expected_keepalive_configuration(router)
self.assertEqual(expected,
- router.keepalived_manager.config.get_config_str())
+ router.keepalived_manager.get_conf_on_disk())
# Add a new FIP and change the GW IP address
router.router = copy.deepcopy(router.router)