aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/Constants.py3
-rw-r--r--resources/libraries/python/TrafficGenerator.py14
2 files changed, 11 insertions, 6 deletions
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py
index 99c1e87d55..9a58ed1a17 100644
--- a/resources/libraries/python/Constants.py
+++ b/resources/libraries/python/Constants.py
@@ -196,6 +196,9 @@ class Constants:
# TRex number of cores
TREX_CORE_COUNT = get_int_from_env(u"TREX_CORE_COUNT", 7)
+ # Trex force start regardles ports state
+ TREX_SEND_FORCE = get_pessimistic_bool_from_env(u"TREX_SEND_FORCE")
+
# TRex extra commandline arguments
TREX_EXTRA_CMDLINE = get_str_from_env(u"TREX_EXTRA_CMDLINE", u"")
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py
index 1b519d5713..f48792db3d 100644
--- a/resources/libraries/python/TrafficGenerator.py
+++ b/resources/libraries/python/TrafficGenerator.py
@@ -519,17 +519,19 @@ class TrafficGenerator(AbstractMeasurer):
warmup_time = float(warmup_time)
command = f"sh -c \"" \
f"{Constants.REMOTE_FW_DIR}/resources/tools/trex/" \
- f"trex_stateless_profile.py" \
- f" --profile {Constants.REMOTE_FW_DIR}/resources/" \
- f"traffic_profiles/trex/{traffic_profile}.py" \
- f" --duration {duration!r} --frame_size {frame_size} " \
+ f"trex_stateless_profile.py " \
+ f"--profile {Constants.REMOTE_FW_DIR}/resources/" \
+ f"traffic_profiles/trex/{traffic_profile}.py " \
+ f"--duration {duration!r} --frame_size {frame_size} " \
f"--rate {rate!r} --warmup_time {warmup_time!r} " \
- f"--port_0 {p_0} --port_1 {p_1}" \
- f" --traffic_directions {traffic_directions}"
+ f"--port_0 {p_0} --port_1 {p_1} " \
+ f"--traffic_directions {traffic_directions}"
if async_call:
command += u" --async_start"
if latency:
command += u" --latency"
+ if Constants.TREX_SEND_FORCE:
+ command += u" --force"
command += u"\""
stdout, _ = exec_cmd_no_error(