diff options
author | Jan Gelety <jgelety@cisco.com> | 2020-11-25 21:49:11 +0100 |
---|---|---|
committer | Vratko Polak <vrpolak@cisco.com> | 2020-12-02 13:39:48 +0000 |
commit | d6af9d72acaca4dff70dce1b55dcc03f73061c7b (patch) | |
tree | c01328679bc1b051093d3af4e13cb9d3c240f821 /resources/libraries | |
parent | b2ff2bb435a765c588b5ae9f8461bbf9b5064651 (diff) |
API: deprecated NAT APIs
Jira: CSIT-1597
Change-Id: Ib48d20ba087bc9828970c3acc081ac6e4447c20c
Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/libraries')
-rw-r--r-- | resources/libraries/python/NATUtil.py | 20 | ||||
-rw-r--r-- | resources/libraries/robot/shared/test_teardown.robot | 7 |
2 files changed, 16 insertions, 11 deletions
diff --git a/resources/libraries/python/NATUtil.py b/resources/libraries/python/NATUtil.py index 422feaedb8..0f8e746663 100644 --- a/resources/libraries/python/NATUtil.py +++ b/resources/libraries/python/NATUtil.py @@ -202,19 +202,25 @@ class NATUtil: return resetter @staticmethod - def show_nat_config(node): - """Show the NAT configuration. + def show_nat44_config(node): + """Show the NAT44 plugin running configuration. :param node: DUT node. :type node: dict """ - cmd = u"nat_show_config" - err_msg = f"Failed to get NAT configuration on host {node[u'host']}" + cmd = u"nat44_show_running_config" + err_msg = f"Failed to get NAT44 configuration on host {node[u'host']}" - with PapiSocketExecutor(node) as papi_exec: - reply = papi_exec.add(cmd).get_reply(err_msg) + try: + with PapiSocketExecutor(node) as papi_exec: + reply = papi_exec.add(cmd).get_reply(err_msg) + except AssertionError: + # Perhaps VPP is an older version + old_cmd = u"nat_show_config" + with PapiSocketExecutor(node) as papi_exec: + reply = papi_exec.add(old_cmd).get_reply(err_msg) - logger.debug(f"NAT Configuration:\n{pformat(reply)}") + logger.debug(f"NAT44 Configuration:\n{pformat(reply)}") @staticmethod def show_nat44_summary(node): diff --git a/resources/libraries/robot/shared/test_teardown.robot b/resources/libraries/robot/shared/test_teardown.robot index 09ebd9d01e..c3d1e8a5ca 100644 --- a/resources/libraries/robot/shared/test_teardown.robot +++ b/resources/libraries/robot/shared/test_teardown.robot @@ -116,9 +116,8 @@ | | ... | Additional teardown for tests which uses DET44 feature. | | | | FOR | ${dut} | IN | @{duts} -#| | | Run Keyword If Test Failed -#| | | ... | Show DET44 verbose | ${nodes['${dut}']} -| | | Show DET44 verbose | ${nodes['${dut}']} +| | | Run Keyword If Test Failed +| | | ... | Show DET44 verbose | ${nodes['${dut}']} | | END | Additional Test Tear Down Action For nat-ed @@ -126,7 +125,7 @@ | | ... | Additional teardown for tests which uses NAT feature. | | | | FOR | ${dut} | IN | @{duts} -| | | Show NAT Config | ${nodes['${dut}']} +| | | Show NAT44 Config | ${nodes['${dut}']} | | | Show NAT44 Summary | ${nodes['${dut}']} | | | Show NAT Base Data | ${nodes['${dut}']} | | | Vpp Get Ip Table Summary | ${nodes['${dut}']} |