selftests: bonding: add tests for ether type changes
authorNikolay Aleksandrov <razor@blackwall.org>
Wed, 15 Mar 2023 11:18:42 +0000 (13:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Mar 2023 07:56:41 +0000 (07:56 +0000)
commit222c94ec0ad48b951f0f692a7cf5bcf7a6bcb6b1
tree8cc7bae0c0a272d867825f0cd72b3ec0d93416db
parente667d469098671261d558be0cd93dca4d285ce1e
selftests: bonding: add tests for ether type changes

Add new network selftests for the bonding device which exercise the ether
type changing call paths. They also test for the recent syzbot bug[1] which
causes a warning and results in wrong device flags (IFF_SLAVE missing).
The test adds three bond devices and a nlmon device, enslaves one of the
bond devices to the other and then uses the nlmon device for successful
and unsuccesful enslaves both of which change the bond ether type. Thus
we can test for both MASTER and SLAVE flags at the same time.

If the flags are properly restored we get:
TEST: Change ether type of an enslaved bond device with unsuccessful enslave   [ OK ]
TEST: Change ether type of an enslaved bond device with successful enslave   [ OK ]

[1] https://syzkaller.appspot.com/bug?id=391c7b1f6522182899efba27d891f1743e8eb3ef

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Acked-by: Jonathan Toppins <jtoppins@redhat.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/bonding/Makefile
tools/testing/selftests/drivers/net/bonding/bond-eth-type-change.sh [new file with mode: 0755]