API: deprecated NAT APIs 52/30152/5
authorJan Gelety <jgelety@cisco.com>
Wed, 25 Nov 2020 20:49:11 +0000 (21:49 +0100)
committerVratko Polak <vrpolak@cisco.com>
Wed, 2 Dec 2020 13:39:48 +0000 (13:39 +0000)
Jira: CSIT-1597

Change-Id: Ib48d20ba087bc9828970c3acc081ac6e4447c20c
Signed-off-by: Jan Gelety <jgelety@cisco.com>
resources/api/vpp/supported_crcs.yaml
resources/libraries/python/NATUtil.py
resources/libraries/robot/shared/test_teardown.robot

index cbe38bc..2d25a42 100644 (file)
     nat44_interface_dump: '0x51077d14'  # dev teardown
     nat44_plugin_enable_disable: '0xdea0d501'  # dev
     nat44_plugin_enable_disable_reply: '0xe8d4e804'  # dev
     nat44_interface_dump: '0x51077d14'  # dev teardown
     nat44_plugin_enable_disable: '0xdea0d501'  # dev
     nat44_plugin_enable_disable_reply: '0xe8d4e804'  # dev
+    nat44_show_running_config: '0x51077d14'  # dev teardown
+    nat44_show_running_config_reply: '0x93d8e267'  # dev teardown
     nat44_static_mapping_details: '0x1a433ef7'  # dev teardown
     nat44_static_mapping_dump: '0x51077d14'  # dev teardown
     nat44_user_details: '0x355896c2'  # dev teardown
     nat44_user_dump: '0x51077d14'  # dev teardown
     nat44_user_session_details: '0x1965fd69'  # dev teardown
     nat44_user_session_dump: '0xe1899c98'  # dev teardown
     nat44_static_mapping_details: '0x1a433ef7'  # dev teardown
     nat44_static_mapping_dump: '0x51077d14'  # dev teardown
     nat44_user_details: '0x355896c2'  # dev teardown
     nat44_user_dump: '0x51077d14'  # dev teardown
     nat44_user_session_details: '0x1965fd69'  # dev teardown
     nat44_user_session_dump: '0xe1899c98'  # dev teardown
-    nat_show_config: '0x51077d14'  # dev teardown
-    nat_show_config_reply: '0x7903ef06'  # dev teardown
     nat_worker_details: '0x84bf06fc'  # dev teardown
     nat_worker_dump: '0x51077d14'  # dev teardown
     # TODO: Which test to run to verify nat* messages?
     nat_worker_details: '0x84bf06fc'  # dev teardown
     nat_worker_dump: '0x51077d14'  # dev teardown
     # TODO: Which test to run to verify nat* messages?
index 422feae..0f8e746 100644 (file)
@@ -202,19 +202,25 @@ class NATUtil:
         return resetter
 
     @staticmethod
         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
         """
 
         :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):
 
     @staticmethod
     def show_nat44_summary(node):
index 09ebd9d..c3d1e8a 100644 (file)
 | | ... | Additional teardown for tests which uses DET44 feature.
 | |
 | | FOR | ${dut} | IN | @{duts}
 | | ... | 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
 | | END
 
 | Additional Test Tear Down Action For nat-ed
 | | ... | Additional teardown for tests which uses NAT feature.
 | |
 | | FOR | ${dut} | IN | @{duts}
 | | ... | 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}']}
 | | | Show NAT44 Summary | ${nodes['${dut}']}
 | | | Show NAT Base Data | ${nodes['${dut}']}
 | | | Vpp Get Ip Table Summary | ${nodes['${dut}']}