:type test_type: str
:return: nothing
"""
- trex_path = "/opt/trex-core-1.91"
+
+ trex_path = "/opt/trex-core-2.00"
topo = Topology()
logger.error('trex-cfg failed: {0}'.format(stdout + stderr))
raise RuntimeError('trex-cfg failed')
+ (ret, _, _) = ssh.exec_command(
+ "sh -c 'pgrep t-rex && sudo pkill t-rex'")
+
(ret, _, _) = ssh.exec_command(
"sh -c 'cd {0}/scripts/ && "
- "sudo nohup ./t-rex-64 -i -c 4 --iom 0 > /dev/null 2>&1 &'"
+ "sudo nohup ./t-rex-64 -i -c 7 --iom 0 > /dev/null 2>&1 &'"
"> /dev/null"\
.format(trex_path))
if int(ret) != 0:
"--p{4}_dst_start_ip 10.10.10.2'".\
format(duration, rate, framesize, _p0, _p1),\
timeout=int(duration)+60)
+ elif traffic_type in ["3-node-IPv6"]:
+ (ret, stdout, stderr) = ssh.exec_command(
+ "sh -c '/tmp/openvpp-testing/resources/tools/t-rex/"
+ "t-rex-stateless.py "
+ "-d {0} -r {1} -s {2} -6 "
+ "--p{3}_src_start_ip 2001:1::2 "
+ "--p{3}_src_end_ip 2001:1::FE "
+ "--p{3}_dst_start_ip 2001:2::2 "
+ "--p{4}_src_start_ip 2001:2::2 "
+ "--p{4}_src_end_ip 2001:2::FE "
+ "--p{4}_dst_start_ip 2001:1::2'".\
+ format(duration, rate, framesize, _p0, _p1),\
+ timeout=int(duration)+60)
else:
raise NotImplementedError('Unsupported traffic type')
logger.trace(stdout)
logger.trace(stderr)
- # last line from console output
- line = stdout.splitlines()[-1]
+ if int(ret) != 0:
+ raise RuntimeError('T-rex stateless runtime error')
+ else:
+ # last line from console output
+ line = stdout.splitlines()[-1]
- self._result = line
- logger.info('TrafficGen result: {0}'.format(self._result))
+ self._result = line
+ logger.info('TrafficGen result: {0}'.format(self._result))
- self._received = self._result.split(', ')[1].split('=')[1]
- self._sent = self._result.split(', ')[2].split('=')[1]
- self._loss = self._result.split(', ')[3].split('=')[1]
+ self._received = self._result.split(', ')[1].split('=')[1]
+ self._sent = self._result.split(', ')[2].split('=')[1]
+ self._loss = self._result.split(', ')[3].split('=')[1]
def send_traffic_on(self, node, duration, rate,
framesize, traffic_type):