- ssh = SSH()
- ssh.connect(node)
-
- (ret, stdout, _) = ssh.exec_command(
- "sh -c '{}/resources/tools/trex/"
- "trex_stateless_stop.py'".format(Constants.REMOTE_FW_DIR))
-
- if int(ret) != 0:
- raise RuntimeError('TRex stateless runtime error')
-
+ x_args = ""
+ for index, value in enumerate(self._xstats):
+ if value is not None:
+ # Nested quoting is fun.
+ value = value.replace("'", "\"")
+ x_args += " --xstat{i}='\"'\"'{v}'\"'\"'".format(
+ i=index, v=value)
+ stdout, _ = exec_cmd_no_error(
+ node, "sh -c '{d}/resources/tools/trex/trex_stateless_stop.py{a}'"\
+ .format(d=Constants.REMOTE_FW_DIR, a=x_args),
+ message='TRex stateless runtime error')