aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2023-06-26 15:57:57 +0000
committerNeale Ranns <neale@graphiant.com>2023-06-29 05:11:10 +0000
commite1cc8753605a40b24f132a99e915a2650ce7df51 (patch)
tree517f4945e1948b691e77e0daf97ccac8d80f7447 /test
parentc8767c42aadb5bd63206e117673991ef799e2d18 (diff)
ip-neighbor: add api for getting neighbor db config
There is an API call to change neighbor database configuration (i.e. limit on peer number, aging, and recycling). With this change, make getting current values of these settings available via the API. Type: improvement Change-Id: Ie9394e086b68cf9b28ad98dea162f203f8043cbb Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_neighbor.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/test_neighbor.py b/test/test_neighbor.py
index f663e735d78..b600a97c3c2 100644
--- a/test/test_neighbor.py
+++ b/test/test_neighbor.py
@@ -2247,6 +2247,14 @@ class NeighborAgeTestCase(VppTestCase):
self.assertEqual(arp.psrc, sip)
self.assertEqual(arp.pdst, dip)
+ def verify_ip_neighbor_config(self, af, max_number, max_age, recycle):
+ config = self.vapi.ip_neighbor_config_get(af)
+
+ self.assertEqual(config.af, af)
+ self.assertEqual(config.max_number, max_number)
+ self.assertEqual(config.max_age, max_age)
+ self.assertEqual(config.recycle, recycle)
+
def test_age(self):
"""Aging/Recycle"""
@@ -2263,6 +2271,13 @@ class NeighborAgeTestCase(VppTestCase):
self.pg_enable_capture(self.pg_interfaces)
#
+ # Verify neighbor configuration defaults
+ #
+ self.verify_ip_neighbor_config(
+ af=vaf.ADDRESS_IP4, max_number=50000, max_age=0, recycle=False
+ )
+
+ #
# Set the neighbor configuration:
# limi = 200
# age = 0 seconds
@@ -2271,6 +2286,9 @@ class NeighborAgeTestCase(VppTestCase):
self.vapi.ip_neighbor_config(
af=vaf.ADDRESS_IP4, max_number=200, max_age=0, recycle=False
)
+ self.verify_ip_neighbor_config(
+ af=vaf.ADDRESS_IP4, max_number=200, max_age=0, recycle=False
+ )
self.vapi.cli("sh ip neighbor-config")
@@ -2298,6 +2316,9 @@ class NeighborAgeTestCase(VppTestCase):
self.vapi.ip_neighbor_config(
af=vaf.ADDRESS_IP4, max_number=200, max_age=0, recycle=True
)
+ self.verify_ip_neighbor_config(
+ af=vaf.ADDRESS_IP4, max_number=200, max_age=0, recycle=True
+ )
# now new additions are allowed
VppNeighbor(
@@ -2321,6 +2342,9 @@ class NeighborAgeTestCase(VppTestCase):
self.vapi.ip_neighbor_config(
af=vaf.ADDRESS_IP4, max_number=200, max_age=2, recycle=True
)
+ self.verify_ip_neighbor_config(
+ af=vaf.ADDRESS_IP4, max_number=200, max_age=2, recycle=True
+ )
self.vapi.cli("sh ip4 neighbor-sorted")
@@ -2399,6 +2423,9 @@ class NeighborAgeTestCase(VppTestCase):
self.vapi.ip_neighbor_config(
af=vaf.ADDRESS_IP4, max_number=200, max_age=1000, recycle=True
)
+ self.verify_ip_neighbor_config(
+ af=vaf.ADDRESS_IP4, max_number=200, max_age=1000, recycle=True
+ )
#
# load up some neighbours again, then disable the aging
@@ -2414,6 +2441,9 @@ class NeighborAgeTestCase(VppTestCase):
self.vapi.ip_neighbor_config(
af=vaf.ADDRESS_IP4, max_number=200, max_age=0, recycle=False
)
+ self.verify_ip_neighbor_config(
+ af=vaf.ADDRESS_IP4, max_number=200, max_age=0, recycle=False
+ )
self.virtual_sleep(10)
self.assertTrue(