aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2017-08-16 05:37:36 -0700
committerOle Trøan <otroan@employees.org>2017-08-16 15:56:32 +0000
commitab9a59c19a2765e001dd24a8f3e51882b6806e2d (patch)
tree5b18ac297b7b9f1f7220dd151930156484d66d04 /test
parentd292ab1e0f600c20d380a93180cccb6226c220e3 (diff)
SNAT: Make proto optional in nat64_bib_dump (VPP-942)
make proto optional in nat64_bib_dump and nat64_st_dump Change-Id: Idd102ce2b1555d38783fd22c84e46b4c48570edc Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'test')
-rw-r--r--test/test_snat.py20
-rw-r--r--test/vpp_papi_provider.py8
2 files changed, 8 insertions, 20 deletions
diff --git a/test/test_snat.py b/test/test_snat.py
index 8fd05fa8..eb47bbb8 100644
--- a/test/test_snat.py
+++ b/test/test_snat.py
@@ -3642,14 +3642,8 @@ class TestNAT64(MethodHolder):
"""
Return number of active NAT64 sessions.
"""
- ses_num = 0
- st = self.vapi.nat64_st_dump(IP_PROTOS.tcp)
- ses_num += len(st)
- st = self.vapi.nat64_st_dump(IP_PROTOS.udp)
- ses_num += len(st)
- st = self.vapi.nat64_st_dump(IP_PROTOS.icmp)
- ses_num += len(st)
- return ses_num
+ st = self.vapi.nat64_st_dump()
+ return len(st)
def clear_nat64(self):
"""
@@ -3716,14 +3710,8 @@ class TestNAT64(MethodHolder):
self.logger.info(self.vapi.cli("show nat64 pool"))
self.logger.info(self.vapi.cli("show nat64 interfaces"))
self.logger.info(self.vapi.cli("show nat64 prefix"))
- self.logger.info(self.vapi.cli("show nat64 bib tcp"))
- self.logger.info(self.vapi.cli("show nat64 bib udp"))
- self.logger.info(self.vapi.cli("show nat64 bib icmp"))
- self.logger.info(self.vapi.cli("show nat64 bib unknown"))
- self.logger.info(self.vapi.cli("show nat64 session table tcp"))
- self.logger.info(self.vapi.cli("show nat64 session table udp"))
- self.logger.info(self.vapi.cli("show nat64 session table icmp"))
- self.logger.info(self.vapi.cli("show nat64 session table unknown"))
+ self.logger.info(self.vapi.cli("show nat64 bib all"))
+ self.logger.info(self.vapi.cli("show nat64 session table all"))
self.clear_nat64()
if __name__ == '__main__':
diff --git a/test/vpp_papi_provider.py b/test/vpp_papi_provider.py
index c99d4583..1daa2a9e 100644
--- a/test/vpp_papi_provider.py
+++ b/test/vpp_papi_provider.py
@@ -1466,10 +1466,10 @@ class VppPapiProvider(object):
'proto': protocol,
'is_add': is_add})
- def nat64_bib_dump(self, protocol):
+ def nat64_bib_dump(self, protocol=255):
"""Dump NAT64 BIB
- :param protocol: IP protocol
+ :param protocol: IP protocol (Default value = 255, all BIBs)
:returns: Dictionary of NAT64 BIB entries
"""
return self.api(self.papi.nat64_bib_dump, {'proto': protocol})
@@ -1499,10 +1499,10 @@ class VppPapiProvider(object):
"""
return self.api(self.papi.nat64_get_timeouts, {})
- def nat64_st_dump(self, protocol):
+ def nat64_st_dump(self, protocol=255):
"""Dump NAT64 session table
- :param protocol: IP protocol
+ :param protocol: IP protocol (Default value = 255, all STs)
:returns: Dictionary of NAT64 sesstion table entries
"""
return self.api(self.papi.nat64_st_dump, {'proto': protocol})