From 250d14332d04569f01117e614a25de290e629800 Mon Sep 17 00:00:00 2001 From: Maros Mullner Date: Tue, 26 May 2020 08:11:49 +0200 Subject: NAT44 EI tests Signed-off-by: Maros Mullner Change-Id: Ib5f58f60a1409ed139e2846793bf52fdc02a6571 --- GPL/tools/trex/trex_stateless_profile.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'GPL/tools') diff --git a/GPL/tools/trex/trex_stateless_profile.py b/GPL/tools/trex/trex_stateless_profile.py index a0de5c0cd3..cda68d01d8 100644 --- a/GPL/tools/trex/trex_stateless_profile.py +++ b/GPL/tools/trex/trex_stateless_profile.py @@ -116,7 +116,8 @@ def simple_burst( try: print(f"### Profile file:\n{profile_file}") profile = STLProfile.load( - profile_file, direction=0, port_id=0, framesize=framesize + profile_file, direction=0, port_id=0, framesize=framesize, + rate=rate ) streams = profile.get_streams() except STLError as err: @@ -135,9 +136,13 @@ def simple_burst( if u"macsrc" in profile_file: client.set_port_attr(ports=[port_0, port_1], promiscuous=True) if isinstance(framesize, int): - client.add_streams(streams[0], ports=[port_0]) + last_stream_a = int((len(streams) - 2 ) / 2) + client.add_streams(streams[0:last_stream_a], ports=[port_0]) if traffic_directions > 1: - client.add_streams(streams[1], ports=[port_1]) + last_stream_b = (last_stream_a * 2) + client.add_streams( + streams[last_stream_a:last_stream_b], ports=[port_1]) + print(last_stream_a, last_stream_b, streams) elif isinstance(framesize, str): client.add_streams(streams[0:3], ports=[port_0]) if traffic_directions > 1: @@ -145,9 +150,10 @@ def simple_burst( if latency: try: if isinstance(framesize, int): - client.add_streams(streams[2], ports=[port_0]) + client.add_streams(streams[last_stream_b], ports=[port_0]) if traffic_directions > 1: - client.add_streams(streams[3], ports=[port_1]) + client.add_streams( + streams[last_stream_b + 1], ports=[port_1]) elif isinstance(framesize, str): latency = False except STLError: @@ -196,7 +202,7 @@ def simple_burst( lost_b = 0 # Choose rate and start traffic: - client.start(ports=ports, mult=rate, duration=duration) + client.start(ports=ports, mult=rate, duration=duration, force=force) if async_start: # For async stop, we need to export the current snapshot. -- cgit 1.2.3-korg