The branch main has been updated by melifaro:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d91f8db5f1822c43cd256f19aae1d059e4b25a26

commit d91f8db5f1822c43cd256f19aae1d059e4b25a26
Author:     Alexander V. Chernikov <melif...@freebsd.org>
AuthorDate: 2023-05-15 11:47:07 +0000
Commit:     Alexander V. Chernikov <melif...@freebsd.org>
CommitDate: 2023-05-15 11:47:07 +0000

    testing: rename IfattrType to IfaAttrType for consistency
    
    All other attribute classes are named as 'type'AttrType and 'type'
     int this case is ifa (interface address).
    
    MFC after:      2 weeks
---
 tests/atf_python/sys/netlink/netlink_route.py | 14 +++++++-------
 tests/sys/netlink/test_rtnl_ifaddr.py         | 26 +++++++++++++-------------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/tests/atf_python/sys/netlink/netlink_route.py 
b/tests/atf_python/sys/netlink/netlink_route.py
index 81f4e89d3e57..cd3ffbe31a00 100644
--- a/tests/atf_python/sys/netlink/netlink_route.py
+++ b/tests/atf_python/sys/netlink/netlink_route.py
@@ -376,7 +376,7 @@ class IfaddrMsg(Structure):
     ]
 
 
-class IfattrType(Enum):
+class IfaAttrType(Enum):
     IFA_UNSPEC = 0
     IFA_ADDRESS = auto()
     IFA_LOCAL = auto()
@@ -570,12 +570,12 @@ rtnl_ifla_attrs = prepare_attrs_map(
 
 rtnl_ifa_attrs = prepare_attrs_map(
     [
-        AttrDescr(IfattrType.IFA_ADDRESS, NlAttrIp),
-        AttrDescr(IfattrType.IFA_LOCAL, NlAttrIp),
-        AttrDescr(IfattrType.IFA_LABEL, NlAttrStr),
-        AttrDescr(IfattrType.IFA_BROADCAST, NlAttrIp),
-        AttrDescr(IfattrType.IFA_ANYCAST, NlAttrIp),
-        AttrDescr(IfattrType.IFA_FLAGS, NlAttrU32),
+        AttrDescr(IfaAttrType.IFA_ADDRESS, NlAttrIp),
+        AttrDescr(IfaAttrType.IFA_LOCAL, NlAttrIp),
+        AttrDescr(IfaAttrType.IFA_LABEL, NlAttrStr),
+        AttrDescr(IfaAttrType.IFA_BROADCAST, NlAttrIp),
+        AttrDescr(IfaAttrType.IFA_ANYCAST, NlAttrIp),
+        AttrDescr(IfaAttrType.IFA_FLAGS, NlAttrU32),
     ]
 )
 
diff --git a/tests/sys/netlink/test_rtnl_ifaddr.py 
b/tests/sys/netlink/test_rtnl_ifaddr.py
index 503eabd27146..1e7d6ca62bd8 100644
--- a/tests/sys/netlink/test_rtnl_ifaddr.py
+++ b/tests/sys/netlink/test_rtnl_ifaddr.py
@@ -6,7 +6,7 @@ from atf_python.sys.net.vnet import SingleVnetTestTemplate
 from atf_python.sys.netlink.base_headers import NlmBaseFlags
 from atf_python.sys.netlink.base_headers import Nlmsghdr
 from atf_python.sys.netlink.netlink import NetlinkTestTemplate
-from atf_python.sys.netlink.netlink_route import IfattrType
+from atf_python.sys.netlink.netlink_route import IfaAttrType
 from atf_python.sys.netlink.netlink_route import NetlinkIfaMessage
 from atf_python.sys.netlink.netlink_route import NlRtMsgType
 from atf_python.sys.netlink.netlink_route import RtScope
@@ -115,12 +115,12 @@ class TestRtNlIfaddr(NetlinkTestTemplate, 
SingleVnetTestTemplate):
         # Ignore IFA_FLAGS for now
         assert msg.base_hdr.ifa_scope == RtScope.RT_SCOPE_UNIVERSE.value
 
-        assert msg.get_nla(IfattrType.IFA_ADDRESS).addr == "192.0.2.1"
-        assert msg.get_nla(IfattrType.IFA_LOCAL).addr == "192.0.2.1"
-        assert msg.get_nla(IfattrType.IFA_BROADCAST).addr == "192.0.2.255"
+        assert msg.get_nla(IfaAttrType.IFA_ADDRESS).addr == "192.0.2.1"
+        assert msg.get_nla(IfaAttrType.IFA_LOCAL).addr == "192.0.2.1"
+        assert msg.get_nla(IfaAttrType.IFA_BROADCAST).addr == "192.0.2.255"
 
         epair_ifname = self.vnet.iface_alias_map["if1"].name
-        assert msg.get_nla(IfattrType.IFA_LABEL).text == epair_ifname
+        assert msg.get_nla(IfaAttrType.IFA_LABEL).text == epair_ifname
 
     def test_6_broadcast(self):
         """Tests header/attr output for listing IPv6 ifas on broadcast iface"""
@@ -137,12 +137,12 @@ class TestRtNlIfaddr(NetlinkTestTemplate, 
SingleVnetTestTemplate):
         # Ignore IFA_FLAGS for now
         assert msg.base_hdr.ifa_scope == RtScope.RT_SCOPE_UNIVERSE.value
 
-        assert msg.get_nla(IfattrType.IFA_ADDRESS).addr == "2001:db8::1"
-        assert msg.get_nla(IfattrType.IFA_LOCAL) is None
-        assert msg.get_nla(IfattrType.IFA_BROADCAST) is None
+        assert msg.get_nla(IfaAttrType.IFA_ADDRESS).addr == "2001:db8::1"
+        assert msg.get_nla(IfaAttrType.IFA_LOCAL) is None
+        assert msg.get_nla(IfaAttrType.IFA_BROADCAST) is None
 
         epair_ifname = self.vnet.iface_alias_map["if1"].name
-        assert msg.get_nla(IfattrType.IFA_LABEL).text == epair_ifname
+        assert msg.get_nla(IfaAttrType.IFA_LABEL).text == epair_ifname
 
         # Local: fe80::/64
         msg = lmsg
@@ -150,12 +150,12 @@ class TestRtNlIfaddr(NetlinkTestTemplate, 
SingleVnetTestTemplate):
         # Ignore IFA_FLAGS for now
         assert msg.base_hdr.ifa_scope == RtScope.RT_SCOPE_LINK.value
 
-        addr = ipaddress.ip_address(msg.get_nla(IfattrType.IFA_ADDRESS).addr)
+        addr = ipaddress.ip_address(msg.get_nla(IfaAttrType.IFA_ADDRESS).addr)
         assert addr.is_link_local
         # Verify that ifindex is not emmbedded
         assert struct.unpack("!H", addr.packed[2:4])[0] == 0
-        assert msg.get_nla(IfattrType.IFA_LOCAL) is None
-        assert msg.get_nla(IfattrType.IFA_BROADCAST) is None
+        assert msg.get_nla(IfaAttrType.IFA_LOCAL) is None
+        assert msg.get_nla(IfaAttrType.IFA_BROADCAST) is None
 
         epair_ifname = self.vnet.iface_alias_map["if1"].name
-        assert msg.get_nla(IfattrType.IFA_LABEL).text == epair_ifname
+        assert msg.get_nla(IfaAttrType.IFA_LABEL).text == epair_ifname

Reply via email to