44
44
self.assertIn("MULTICAST", block)
46
46
def test_skip_loopback(self):
47
"""The C{lo} interface is reported by L{get_active_device_info}."""
47
"""The C{lo} interface is not reported by L{get_active_device_info}."""
48
48
device_info = get_active_device_info()
49
49
interfaces = [i["interface"] for i in device_info]
50
50
self.assertNotIn("lo", interfaces)
52
def test_skip_vlan(self):
53
"""VLAN interfaces are not reported by L{get_active_device_info}."""
54
mock_get_active_interfaces = self.mocker.replace(get_active_interfaces)
55
mock_get_active_interfaces(ANY)
56
self.mocker.passthrough(
57
result_callback=lambda result: list(result) + ["eth0.1"])
59
device_info = get_active_device_info()
60
interfaces = [i["interface"] for i in device_info]
61
self.assertNotIn("eth0.1", interfaces)
63
def test_skip_alias(self):
64
"""Interface aliases are not reported by L{get_active_device_info}."""
65
mock_get_active_interfaces = self.mocker.replace(get_active_interfaces)
66
mock_get_active_interfaces(ANY)
67
self.mocker.passthrough(
68
result_callback=lambda result: list(result) + ["eth0:foo"])
70
device_info = get_active_device_info()
71
interfaces = [i["interface"] for i in device_info]
72
self.assertNotIn("eth0:foo", interfaces)
52
74
def test_duplicate_network_interfaces(self):
54
76
L{get_active_interfaces} doesn't return duplicate network interfaces.