def test_keepalived_spawn(self):
    expected_config = self._get_config()
    manager = keepalived.KeepalivedManager('router1', expected_config, conf_path=cfg.CONF.state_path, root_helper=self.root_helper)
    self.addCleanup(manager.disable)
    manager.spawn()
    process = external_process.ProcessManager(cfg.CONF, 'router1', self.root_helper, namespace=None, 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)
def test_keepalived_spawn(self):
    expected_config = self._get_config()
    manager = keepalived.KeepalivedManager('router1', expected_config, conf_path=cfg.CONF.state_path, root_helper=self.root_helper)
    self.addCleanup(manager.disable)
    manager.spawn()
    process = external_process.ProcessManager(cfg.CONF, 'router1', self.root_helper, namespace=None, 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)