@@ -1595,6 +1595,30 @@ def test_20_kernel_options_hugepages(self):
15951595 self .assertIn (f' hugepagesz={ hp_size_1g } hugepages={ hp_count_1g } ' , tmp )
15961596 self .assertIn (f' hugepagesz={ hp_size_2m } hugepages={ hp_count_2m } ' , tmp )
15971597
1598+ def test_21_static_arp (self ):
1599+ host = '192.0.2.10'
1600+ mac = '00:01:02:03:04:0a'
1601+ path_static_arp = ['protocols' , 'static' , 'arp' ]
1602+
1603+ self .cli_set (['interfaces' , 'ethernet' , interface , 'address' , '192.0.2.1/24' ])
1604+ self .cli_set (
1605+ path_static_arp + ['interface' , interface , 'address' , host , 'mac' , mac ]
1606+ )
1607+ self .cli_commit ()
1608+
1609+ # Change VPP configuration
1610+ self .cli_set (base_path + ['settings' , 'unix' , 'poll-sleep-usec' , '50' ])
1611+
1612+ # Ensure arp entry is not disappeared
1613+ _ , neighbors = rc_cmd ('sudo ip neighbor' )
1614+ self .assertIn (f'{ host } dev { interface } lladdr { mac } ' , neighbors )
1615+
1616+ # Check VPP IP neighbors
1617+ _ , vpp_neighbors = rc_cmd ('sudo vppctl show ip neighbors' )
1618+ self .assertRegex (vpp_neighbors , rf'{ host } \s+S\s+{ mac } \s+{ interface } ' )
1619+
1620+ self .cli_delete (path_static_arp )
1621+
15981622
15991623if __name__ == '__main__' :
16001624 unittest .main (verbosity = 2 , failfast = VyOSUnitTestSHIM .TestCase .debug_on ())
0 commit comments