summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorNataliia Solomko <natalirs1985@gmail.com>2026-07-27 16:35:37 +0300
committerNataliia Solomko <natalirs1985@gmail.com>2026-07-29 13:45:21 +0300
commit4839fbdc5e48aa8a32bf08ca20c4b922aa26cb32 (patch)
tree9ed8a75655e90e5bf40cfbd12a03bd786988e1db /smoketest/scripts/cli
parentb81e435210f499b225b5d27fd16c370c0095da3a (diff)
downloadvyos-1x-4839fbdc5e48aa8a32bf08ca20c4b922aa26cb32.tar.gz
vyos-1x-4839fbdc5e48aa8a32bf08ca20c4b922aa26cb32.zip
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.
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_vpp.py21
1 files changed, 20 insertions, 1 deletions
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()