def test_error_if_bgp_ipv4_conflict_no_conflict(self, m_exit, m_client): """ Test check that node IP is not already in use by another node, no error. """ m_client.get_hostnames_from_ips = Mock() m_client.get_hostnames_from_ips.return_value = {} node.error_if_bgp_ip_conflict("10.0.0.1", "abcd::beef") self.assertFalse(m_exit.called)
def test_error_if_ip_conflict_ipv6_key_error(self, m_exit, m_hostname, m_client): """ Test that function accepts IP being owned by same host. """ calico_ctl.node.hostname = "host" m_client.get_hostnames_from_ips = Mock() m_client.get_hostnames_from_ips.return_value = {"10.0.0.1": "host"} node.error_if_bgp_ip_conflict("10.0.0.1", "abcd::beef") self.assertFalse(m_exit.called)
def test_error_if_ip_conflict_ipv6_key_error(self, m_exit, m_hostname, m_client): """ Test that function accepts IP being owned by same host. """ calico_ctl.node.hostname = "host" m_client.get_hostnames_from_ips = Mock() m_client.get_hostnames_from_ips.return_value = {"10.0.0.1":"host"} node.error_if_bgp_ip_conflict("10.0.0.1", "abcd::beef") self.assertFalse(m_exit.called)