def test_get_parent_port_by_host_ip_trunk_not_found(self):
cls = nested_vif.NestedPodVIFDriver
m_driver = mock.Mock(spec=cls)
neutron = self.useFixture(k_fix.MockNeutronClient()).client
node_subnet_id = mock.sentinel.node_subnet_id
oslo_cfg.CONF.set_override('worker_nodes_subnet',
node_subnet_id,
group='pod_vif_nested')
node_fixed_ip = mock.sentinel.node_fixed_ip
ports = {'ports': []}
neutron.list_ports.return_value = ports
self.assertRaises(kl_exc.NoResourceException,
cls._get_parent_port_by_host_ip, m_driver, neutron,
node_fixed_ip)
fixed_ips = ['subnet_id=%s' % str(node_subnet_id),
'ip_address=%s' % str(node_fixed_ip)]
neutron.list_ports.assert_called_once_with(fixed_ips=fixed_ips)
评论列表
文章目录