Esempio n. 1
0
 def daemon_loop(self):
     with polling.get_polling_manager(
         self.minimize_polling,
         self.root_helper,
         self.ovsdb_monitor_respawn_interval) as pm:
         LOG.debug("daemon_loop,pm=%s" % pm)
         self.rpc_loop(polling_manager=pm)
Esempio n. 2
0
 def test_manage_polling_minimizer(self):
     mock_target = 'neutron.agent.linux.polling.InterfacePollingMinimizer'
     with mock.patch('%s.start' % mock_target) as mock_start:
         with mock.patch('%s.stop' % mock_target) as mock_stop:
             with polling.get_polling_manager(minimize_polling=True) as pm:
                 self.assertEqual(pm.__class__,
                                  polling.InterfacePollingMinimizer)
             mock_stop.assert_has_calls([mock.call()])
         mock_start.assert_has_calls([mock.call()])
Esempio n. 3
0
 def test_manage_polling_minimizer(self):
     mock_target = 'neutron.agent.linux.polling.InterfacePollingMinimizer'
     with mock.patch('%s.start' % mock_target) as mock_start:
         with mock.patch('%s.stop' % mock_target) as mock_stop:
             with polling.get_polling_manager(minimize_polling=True) as pm:
                 self.assertEqual(pm.__class__,
                                  polling.InterfacePollingMinimizer)
             mock_stop.assert_has_calls(mock.call())
         mock_start.assert_has_calls(mock.call())
Esempio n. 4
0
 def test_manage_polling_minimizer(self):
     mock_target = "neutron.agent.linux.polling.InterfacePollingMinimizer"
     with mock.patch("%s.start" % mock_target) as mock_start:
         with mock.patch("%s.stop" % mock_target) as mock_stop:
             with polling.get_polling_manager(minimize_polling=True, root_helper="test") as pm:
                 self.assertEqual(pm._monitor.root_helper, "test")
                 self.assertEqual(pm.__class__, polling.InterfacePollingMinimizer)
             mock_stop.assert_has_calls(mock.call())
         mock_start.assert_has_calls(mock.call())
Esempio n. 5
0
 def daemon_loop(self):
     with polling.get_polling_manager(
             self.minimize_polling, self.root_helper,
             self.ovsdb_monitor_respawn_interval) as pm:
         LOG.debug("daemon_loop,pm=%s" % pm)
         self.rpc_loop(polling_manager=pm)
Esempio n. 6
0
 def test_return_always_poll_by_default(self):
     with polling.get_polling_manager() as pm:
         self.assertEqual(pm.__class__, polling.AlwaysPoll)
Esempio n. 7
0
 def test_return_always_poll_by_default(self):
     with polling.get_polling_manager() as pm:
         self.assertEqual(pm.__class__, polling.AlwaysPoll)