def setUp(self): super(TestHaproxyNSDriver, self).setUp() conf = mock.Mock() conf.haproxy.loadbalancer_state_path = '/the/path' conf.interface_driver = 'intdriver' conf.haproxy.user_group = 'test_group' conf.haproxy.send_gratuitous_arp = 3 conf.AGENT.root_helper = 'sudo_test' self.conf = conf self.mock_importer = mock.patch.object(namespace_driver, 'importutils').start() self.rpc_mock = mock.Mock() self.driver = namespace_driver.HaproxyNSDriver(conf, self.rpc_mock) self.vif_driver = mock.Mock() self.driver.vif_driver = self.vif_driver self.fake_config = { 'pool': { 'id': 'pool_id', 'status': 'ACTIVE', 'admin_state_up': True }, 'vip': { 'id': 'vip_id', 'port': { 'id': 'port_id' }, 'status': 'ACTIVE', 'admin_state_up': True } }
def setUp(self): super(TestHaproxyNSDriver, self).setUp() self.vif_driver = mock.Mock() self.vip_plug_callback = mock.Mock() self.driver = namespace_driver.HaproxyNSDriver( 'sudo', '/the/path', self.vif_driver, self.vip_plug_callback ) self.fake_config = { 'pool': {'id': 'pool_id'}, 'vip': {'id': 'vip_id', 'port': {'id': 'port_id'}} }