From 01930f568a2472a3352ab80ea1d3b4cccf4ae0c7 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Thu, 13 May 2021 11:11:33 -0500 Subject: nat: report correct EI per-user session limit Type: fix When enabling the endpoint independent NAT44 plugin, user_sessions determines the maximum number of translations that can be active for a single inside address. If 0 is passed in, a default value is used but 0 is still stored in the field that is used to populate reply messages to nat44_ei_show_running_config, At the time of enabling the plugin, if user_sessions is 0, update the field which is used by nat44_ei_show_running_config to contain the default per-user limit which gets used by the EI nodes. Change-Id: I6b060d85bcd42d91db879b95a8b07c6844bcd2a5 Signed-off-by: Matthew Smith --- test/test_nat44_ei.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/test_nat44_ei.py b/test/test_nat44_ei.py index 4160ea2c344..74a082eee0a 100644 --- a/test/test_nat44_ei.py +++ b/test/test_nat44_ei.py @@ -3806,6 +3806,12 @@ class TestNAT44EI(MethodHolder): "Invalid packet (src IP %s translated to %s, but expected %s)" % (p_sent[IP].src, p_recvd[IP].src, a)) + def test_default_user_sessions(self): + """ NAT44EI default per-user session limit is used and reported """ + nat44_ei_config = self.vapi.nat44_ei_show_running_config() + # a nonzero default should be reported for user_sessions + self.assertNotEqual(nat44_ei_config.user_sessions, 0) + class TestNAT44Out2InDPO(MethodHolder): """ NAT44EI Test Cases using out2in DPO """ -- cgit 1.2.3-korg