git: 0da116b051e4 - stable/13 - tests: fix netlink test_dump_ifaces_many test.

From: Alexander V. Chernikov <melifaro_at_FreeBSD.org>
Date: Sat, 08 Apr 2023 19:45:03 UTC
The branch stable/13 has been updated by melifaro:

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

commit 0da116b051e48e21c43b73e6b82ebb4ebdf7c4b0
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2023-02-18 22:26:32 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2023-04-08 19:14:41 +0000

    tests: fix netlink test_dump_ifaces_many test.
    
    Consider only loopback interfaces when counting.
    Otherwise, if pf is loaded, 'pflog0' gets added to the vnet,
     breaking the test.
    
    MFC after:      2 weeks
    
    (cherry picked from commit 79748cec1f1c3437e49d7694e95fc7f438336805)
---
 tests/sys/netlink/test_rtnl_iface.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/sys/netlink/test_rtnl_iface.py b/tests/sys/netlink/test_rtnl_iface.py
index c21bf9cb8977..da3db93b05c6 100644
--- a/tests/sys/netlink/test_rtnl_iface.py
+++ b/tests/sys/netlink/test_rtnl_iface.py
@@ -247,9 +247,7 @@ class TestRtNlIface(NetlinkTestTemplate, SingleVnetTestTemplate):
         """Tests if interface dummp is not missing interfaces"""
 
         ifmap = {}
-        for ifname in (self.vnet.iface_alias_map["if1"].name, "lo0"):
-            ifindex = socket.if_nametoindex(ifname)
-            ifmap[ifindex] = ifname
+        ifmap[socket.if_nametoindex("lo0")] = "lo0"
 
         for i in range(40):
             ifname = "lo{}".format(i + 1)
@@ -300,7 +298,9 @@ class TestRtNlIface(NetlinkTestTemplate, SingleVnetTestTemplate):
 
                 ifindex = rx_msg.base_hdr.ifi_index
                 assert ifindex == rx_msg.base_hdr.ifi_index
-                kernel_ifmap[ifindex] = rx_msg.get_nla(IflattrType.IFLA_IFNAME).text
+                ifname = rx_msg.get_nla(IflattrType.IFLA_IFNAME).text
+                if ifname.startswith("lo"):
+                    kernel_ifmap[ifindex] = ifname
             assert kernel_ifmap == ifmap
 
     #