From 4839fbdc5e48aa8a32bf08ca20c4b922aa26cb32 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Mon, 27 Jul 2026 16:35:37 +0300 Subject: vpp: T8468: Apply MAC address changes on VPP interfaces The interface config filter stripped the "mac" node, so a MAC address configured on a VPP interface never reached the dataplane. Allow "mac" through the filter; VPP applies it to the hardware interface via lcp-sync. Some DPDK drivers (e.g. vmxnet3) cannot change the MAC and would fail to bring the interface up. Reject such a change at verify time - both when setting the MAC and when adding an interface that already has one to VPP. --- smoketest/scripts/cli/test_vpp.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'smoketest/scripts/cli') diff --git a/smoketest/scripts/cli/test_vpp.py b/smoketest/scripts/cli/test_vpp.py index bda2da0f9..16ce29f8b 100755 --- a/smoketest/scripts/cli/test_vpp.py +++ b/smoketest/scripts/cli/test_vpp.py @@ -103,6 +103,9 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): # out the current configuration :) cls.cli_delete(cls, base_path) cls.cli_delete(cls, interfaces_path) + # drop any pre-existing custom MAC so the MAC test baseline is the + # interface hardware address (hw-id) + cls.cli_delete(cls, ['interfaces', 'ethernet', interface, 'mac']) def setUp(self): # always forward to base class @@ -121,8 +124,9 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.cli_delete(interfaces_path) self.cli_commit() - # delete address for Ethernet interface + # delete address and any custom MAC for the Ethernet interface self.cli_delete(['interfaces', 'ethernet', interface, 'address']) + self.cli_delete(['interfaces', 'ethernet', interface, 'mac']) self.cli_commit() self.assertFalse(os.path.exists(VPP_CONF)) @@ -183,6 +187,21 @@ class TestVPP(VyOSUnitTestSHIM.TestCase): self.cli_delete(['interfaces', 'ethernet', interface, 'mtu']) self.cli_commit() + # A custom MAC address must reach the VPP dataplane, and removing it must + # restore the hardware address (hw-id). Rejection of drivers that cannot + # change the MAC (e.g. vmxnet3) is not covered here, as the CI dataplane + # NIC uses a supported driver. + hw_mac = VPPControl().get_mac(interface) + mac = '02:00:de:ad:be:01' + self.cli_set(['interfaces', 'ethernet', interface, 'mac', mac]) + self.cli_commit() + self.assertEqual(VPPControl().get_mac(interface), mac) + + # removing the custom MAC reverts to the hardware address (hw-id) + self.cli_delete(['interfaces', 'ethernet', interface, 'mac']) + self.cli_commit() + self.assertEqual(VPPControl().get_mac(interface), hw_mac) + # set interface address as dhcp self.cli_set(['interfaces', 'ethernet', interface, 'address', 'dhcp']) self.cli_commit() -- cgit v1.2.3