X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FTrafficGenerator.py;h=a73e471f7717d48ce10c4de67a035c5a9ee611ec;hp=007079f254eaf150705fe183bcda5e0e71bef2fa;hb=efcdd3eadfadb2814a9e3b67cce84b5dc89c7108;hpb=13d39ef24703505a44e5983ce42df2a1e3ca67af diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py index 007079f254..a73e471f77 100644 --- a/resources/libraries/python/TrafficGenerator.py +++ b/resources/libraries/python/TrafficGenerator.py @@ -286,6 +286,7 @@ class TrafficGenerator(AbstractMeasurer): self._node, f"sh -c 'cat << EOF > /etc/trex_cfg.yaml\n" f"- version: 2\n" + f" limit_memory: {Constants.TREX_LIMIT_MEMORY}\n" f" interfaces: [\"{if1_pci}\",\"{if2_pci}\"]\n" f" port_info:\n" f" - dest_mac: [{dst_mac0}]\n" @@ -300,6 +301,7 @@ class TrafficGenerator(AbstractMeasurer): self._node, f"sh -c 'cat << EOF > /etc/trex_cfg.yaml\n" f"- version: 2\n" + f" limit_memory: {Constants.TREX_LIMIT_MEMORY}\n" f" interfaces: [\"{if1_pci}\",\"{if2_pci}\"]\n" f" port_info:\n" f" - ip: [{if1_addr}]\n" @@ -343,10 +345,10 @@ class TrafficGenerator(AbstractMeasurer): # Start TRex. cmd = f"sh -c \"cd {Constants.TREX_INSTALL_DIR}/scripts/ && " \ - f"nohup ./t-rex-64 " \ - f"--hdrh{u' --astf' if osi_layer == u'L7' else u''} " \ - f"--prefix $(hostname) -i -c 7 > /tmp/trex.log 2>&1 &\" > " \ - f"/dev/null" + f"nohup ./t-rex-64 -i -c {Constants.TREX_CORE_COUNT} --hdrh " \ + f"{u' --astf' if osi_layer == u'L7' else u''} " \ + f"--prefix $(hostname) {Constants.TREX_EXTRA_CMDLINE} " \ + f"> /tmp/trex.log 2>&1 &\" > /dev/null" try: exec_cmd_no_error(self._node, cmd, sudo=True) except RuntimeError: