def setUp(self): super(TestOvsdbMonitor, self).setUp() self.monitor = ovsdb_monitor.OvsdbMonitor('Bridge', root_helper=self.root_helper) self.addCleanup(self.monitor.stop) self.monitor.start()
def test___init___with_format(self): with mock.patch( 'neutron.agent.linux.async_process.AsyncProcess.__init__' ) as init: ovsdb_monitor.OvsdbMonitor('Interface', format='blob') cmd = init.call_args_list[0][0][0] self.assertEqual('--format=blob', cmd[-1])
def test___init___with_columns(self): columns = ['col1', 'col2'] with mock.patch( 'neutron.agent.linux.async_process.AsyncProcess.__init__' ) as init: ovsdb_monitor.OvsdbMonitor('Interface', columns=columns) cmd = init.call_args_list[0][0][0] self.assertEqual('col1,col2', cmd[-1])
def test__init__with_connection_columns(self): conn_info = 'tcp:10.10.10.10:6640' columns = ['col1', 'col2'] with mock.patch( 'neutron.agent.linux.async_process.AsyncProcess.__init__' ) as init: ovsdb_monitor.OvsdbMonitor('Interface', columns=columns, ovsdb_connection=conn_info) cmd_all = init.call_args_list[0][0][0] cmd_expect = [ 'ovsdb-client', 'monitor', 'tcp:10.10.10.10:6640', 'Interface', 'col1,col2' ] self.assertEqual(cmd_expect, cmd_all)
def setUp(self): super(TestOvsdbMonitor, self).setUp() self.root_helper = 'sudo' self.monitor = ovsdb_monitor.OvsdbMonitor('Interface', root_helper=self.root_helper)
def setUp(self): super(TestOvsdbMonitor, self).setUp() self.monitor = ovsdb_monitor.OvsdbMonitor('Interface')
def test___init__(self): ovsdb_monitor.OvsdbMonitor('Interface')