summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/examples/stl_imix.py
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-03-30 13:58:11 +0300
committerHanoh Haim <hhaim@cisco.com>2016-03-30 13:58:11 +0300
commit422c7c52632ebb6fbc5d5ff638b6ef0e1bc56f6b (patch)
tree5794318455a66a03828f98a5d6e825f47df3084e /scripts/automation/trex_control_plane/stl/examples/stl_imix.py
parent2ec326cbe088f3ee5634336e326ae8c3561c7461 (diff)
parentb91c216db1aa10ca7cc81b8c74b04ab79df251fe (diff)
Merge GA to Python API
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/examples/stl_imix.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/examples/stl_imix.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/automation/trex_control_plane/stl/examples/stl_imix.py b/scripts/automation/trex_control_plane/stl/examples/stl_imix.py
index 56fd3cfd..7e43488b 100644
--- a/scripts/automation/trex_control_plane/stl/examples/stl_imix.py
+++ b/scripts/automation/trex_control_plane/stl/examples/stl_imix.py
@@ -12,7 +12,7 @@ import argparse
# and attach it to both sides and inject
# at a certain rate for some time
# finally it checks that all packets arrived
-def imix_test (server):
+def imix_test (server, mult):
# create client
@@ -37,7 +37,8 @@ def imix_test (server):
print("Mapped ports to sides {0} <--> {1}".format(dir_0, dir_1))
# load IMIX profile
- profile = STLProfile.load_py('../../../../stl/imix.py')
+ profile_file = os.path.join(stl_path.STL_PROFILES_PATH, 'imix.py')
+ profile = STLProfile.load_py(profile_file)
streams = profile.get_streams()
# add both streams to ports
@@ -47,9 +48,8 @@ def imix_test (server):
# clear the stats before injecting
c.clear_stats()
- # choose rate and start traffic for 10 seconds on 5 mpps
+ # choose rate and start traffic for 10 seconds
duration = 10
- mult = "30%"
print("Injecting {0} <--> {1} on total rate of '{2}' for {3} seconds".format(dir_0, dir_1, mult, duration))
c.start(ports = (dir_0 + dir_1), mult = mult, duration = duration, total = True)
@@ -107,8 +107,13 @@ parser.add_argument('-s', '--server',
help='Remote trex address',
default='127.0.0.1',
type = str)
+parser.add_argument('-m', '--mult',
+ dest='mult',
+ help='Multiplier of traffic, see Stateless help for more info',
+ default='30%',
+ type = str)
args = parser.parse_args()
# run the tests
-imix_test(args.server)
+imix_test(args.server, args.mult)