On Wed, Aug 24, 2022 at 10:29:20PM +0200, netdev@xxxxxxxxxxxxxxxxxxxx wrote: > On 2022-08-21 09:08, Ido Schimmel wrote: > > > > I assume you want a hub to simulate multiple MACs behind the same port. > > You don't need a hub for that. You can set the MAC using mausezahn. See > > '-a' option: > > > > " > > -a <src-mac|keyword> > > Use specified source MAC address with hexadecimal notation such > > as 00:00:aa:bb:cc:dd. By default the interface MAC address will be > > used. The keywords ''rand'' > > and ''own'' refer to a random MAC address (only unicast > > addresses are created) and the own address, respectively. You can also > > use the keywords mentioned below > > although broadcast-type source addresses are officially invalid. > > " > > > > > Ido, I am not so known to the selftests, so I am wondering why I don't see > either check_err or check_fail fail, whichever I use, when I think they > should and then they are not really checking... > > > local mac=10:20:30:30:20:10 > > > $MZ $h1 -t udp -a $mac -b rand > bridge fdb show dev $swp1 | grep -q "$mac vlan 1 master br0 locked" > check_err $? "MAB station move: no locked entry on first injection" > > $MZ $h2 -t udp -a $mac -b rand > bridge fdb show dev $swp1 | grep -q "$mac vlan 1 master br0 locked" > check_err $? "MAB station move: locked entry did not move" > > What is wrong here? Did you try adding a sleep between mausezahn and the FDB dump? At least that is what learning_test() is doing. It is possible that the packet is not sent / processed fast enough for the bridge to learn it before the dump. > > For a mv88e6xxx test I guess I can make a check to verify that this driver > is in use? Not in a generic forwarding test. Maybe in tools/testing/selftests/drivers/net/dsa/ My preference would be to get as much tests as possible in tools/testing/selftests/net/forwarding/bridge_locked_port.sh. I'm not sure which tests you are planning for mv88e6xxx, but we can pass / fail test cases based on the flags we observe in the FDB dump. For example, if the entry has the "sticky" flag, then the expectation is that the roaming test will fail. Otherwise, it should pass.