Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176895044
D49226.1793586808.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D49226.1793586808.diff
View Options
diff --git a/tests/sys/netlink/test_rtnl_ifaddr.py b/tests/sys/netlink/test_rtnl_ifaddr.py
--- a/tests/sys/netlink/test_rtnl_ifaddr.py
+++ b/tests/sys/netlink/test_rtnl_ifaddr.py
@@ -33,7 +33,10 @@
def setup_method(self, method):
method_name = method.__name__
if "4" in method_name:
- self.IPV4_PREFIXES = ["192.0.2.1/24"]
+ if "nofilter" in method_name:
+ self.IPV4_PREFIXES = ["192.0.2.1/24", "169.254.169.254/16"]
+ else:
+ self.IPV4_PREFIXES = ["192.0.2.1/24"]
if "6" in method_name:
self.IPV6_PREFIXES = ["2001:db8::1/64"]
super().setup_method(method)
@@ -49,14 +52,21 @@
for rx_msg in self.read_msg_list(msg.nl_hdr.nlmsg_seq, NlRtMsgType.RTM_NEWADDR):
ifname = socket.if_indextoname(rx_msg.base_hdr.ifa_index)
family = rx_msg.base_hdr.ifa_family
- ret.append((ifname, family, rx_msg))
+ scope = rx_msg.base_hdr.ifa_scope
+ ret.append((ifname, family, scope))
ifname = "lo0"
- assert len([r for r in ret if r[0] == ifname]) > 0
+ assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET and r[2] == RtScope.RT_SCOPE_HOST.value]) == 1
+ assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6 and r[2] == RtScope.RT_SCOPE_HOST.value]) == 1
+ assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6 and r[2] == RtScope.RT_SCOPE_LINK.value]) == 1
+ assert len([r for r in ret if r[0] == ifname]) == 3
ifname = self.vnet.iface_alias_map["if1"].name
- assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET]) == 1
- assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6]) == 2
+ assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET and r[2] == RtScope.RT_SCOPE_LINK.value]) == 1
+ assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET and r[2] == RtScope.RT_SCOPE_UNIVERSE.value]) == 1
+ assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6 and r[2] == RtScope.RT_SCOPE_LINK.value]) == 1
+ assert len([r for r in ret if r[0] == ifname and r[1] == socket.AF_INET6 and r[2] == RtScope.RT_SCOPE_UNIVERSE.value]) == 1
+ assert len([r for r in ret if r[0] == ifname]) == 4
def test_46_filter_iface(self):
"""Tests that listing outputs both IPv4/IPv6 for the specific interface"""
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 2, 2:33 AM (19 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41301591
Default Alt Text
D49226.1793586808.diff (2 KB)
Attached To
Mode
D49226: netlink: Fix getting route scope of interface's IPv4 addresses
Attached
Detach File
Event Timeline