Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
CSIT-395 Update TRex version to v2.09
[csit.git]
/
resources
/
libraries
/
python
/
TrafficGenerator.py
diff --git
a/resources/libraries/python/TrafficGenerator.py
b/resources/libraries/python/TrafficGenerator.py
index
459a6cc
..
307a28f
100644
(file)
--- a/
resources/libraries/python/TrafficGenerator.py
+++ b/
resources/libraries/python/TrafficGenerator.py
@@
-155,7
+155,7
@@
class TrafficGenerator(object):
self._node = tg_node
if tg_node['subtype'] == NodeSubTypeTG.TREX:
self._node = tg_node
if tg_node['subtype'] == NodeSubTypeTG.TREX:
- trex_path = "/opt/trex-core-2.0
7
"
+ trex_path = "/opt/trex-core-2.0
9
"
ssh = SSH()
ssh.connect(tg_node)
ssh = SSH()
ssh.connect(tg_node)
@@
-215,18
+215,20
@@
class TrafficGenerator(object):
.format(stdout + stderr))
raise RuntimeError('trex config generation error')
.format(stdout + stderr))
raise RuntimeError('trex config generation error')
- (ret, stdout, stderr) = ssh.exec_command(
- "sh -c 'cd {0}/scripts/ && sudo ./trex-cfg'".format(trex_path))
- if int(ret) != 0:
- logger.error('trex-cfg failed: {0}'.format(stdout + stderr))
- raise RuntimeError('trex-cfg failed')
-
max_startup_retries = 3
while max_startup_retries > 0:
# kill T-rex only if it is already running
(ret, _, _) = ssh.exec_command(
"sh -c 'pgrep t-rex && sudo pkill t-rex'")
max_startup_retries = 3
while max_startup_retries > 0:
# kill T-rex only if it is already running
(ret, _, _) = ssh.exec_command(
"sh -c 'pgrep t-rex && sudo pkill t-rex'")
+ # configure T-rex
+ (ret, stdout, stderr) = ssh.exec_command(
+ "sh -c 'cd {0}/scripts/ && sudo ./trex-cfg'"\
+ .format(trex_path))
+ if int(ret) != 0:
+ logger.error('trex-cfg failed: {0}'.format(stdout + stderr))
+ raise RuntimeError('trex-cfg failed')
+
# start T-rex
(ret, _, _) = ssh.exec_command(
"sh -c 'cd {0}/scripts/ && "
# start T-rex
(ret, _, _) = ssh.exec_command(
"sh -c 'cd {0}/scripts/ && "