fix(trex): use reset instead of clear_profile 52/36152/13
authorVratko Polak <vrpolak@cisco.com>
Tue, 17 May 2022 13:32:04 +0000 (15:32 +0200)
committerPeter Mikus <pmikus@cisco.com>
Wed, 18 May 2022 04:46:25 +0000 (04:46 +0000)
Now sure why clear_profile gets stuck with v2.97
(unless block=False), but calling reset() works,
and will be less risky next time we bump TRex version.

- Only ASTF for now.

Change-Id: Ib6906fb8ce269e888bf0e0438d3309931d5e9981
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
GPL/tools/trex/trex_astf_profile.py
GPL/tools/trex/trex_astf_stop.py

index 936a8df..a4f03be 100644 (file)
@@ -220,8 +220,7 @@ def simple_burst(
                 for warning in client.get_warnings():
                     print(warning)
 
                 for warning in client.get_warnings():
                     print(warning)
 
-            # Now finish the complete reset.
-            client.reset()
+            # No profile cleanup here, reset will be done in the finally block.
 
             print(u"##### Statistics #####")
             print(json.dumps(stats, indent=4, separators=(u",", u": ")))
 
             print(u"##### Statistics #####")
             print(json.dumps(stats, indent=4, separators=(u",", u": ")))
@@ -385,7 +384,7 @@ def simple_burst(
             if async_start:
                 client.disconnect(stop_traffic=False, release_ports=True)
             else:
             if async_start:
                 client.disconnect(stop_traffic=False, release_ports=True)
             else:
-                client.clear_profile()
+                client.reset()
                 client.disconnect()
                 print(
                     f"multiplier={multiplier!r}; "
                 client.disconnect()
                 print(
                     f"multiplier={multiplier!r}; "
index 7291552..9185478 100644 (file)
@@ -84,7 +84,7 @@ def main():
 
     # If TRexError happens, let the script fail with stack trace.
     finally:
 
     # If TRexError happens, let the script fail with stack trace.
     finally:
-        client.clear_profile()
+        client.reset()
         client.disconnect()
 
     # TODO: check xstats format
         client.disconnect()
 
     # TODO: check xstats format