Example #1
0
 def test_ns_name_disabled_namespace(self):
     with mock.patch('quantum.agent.dhcp_agent.DeviceManager') as dev_mgr:
         cfg.CONF.set_override('use_namespaces', False)
         mock_net = mock.Mock(id='foo')
         dhcp = dhcp_agent.DhcpAgent(HOSTNAME)
         self.assertIsNone(dhcp._ns_name(mock_net))
Example #2
0
 def test_ns_name(self):
     with mock.patch('quantum.agent.dhcp_agent.DeviceManager') as dev_mgr:
         mock_net = mock.Mock(id='foo')
         dhcp = dhcp_agent.DhcpAgent(HOSTNAME)
         self.assertEqual(dhcp._ns_name(mock_net), 'qdhcp-foo')