T-REX: change relative rate values to absolute units
[csit.git] / resources / libraries / python / TrafficGenerator.py
index 2037d49..4b71b59 100644 (file)
@@ -51,13 +51,14 @@ class TrafficGenerator(object):
             ssh.connect(node)
 
             (ret, stdout, stderr) = ssh.exec_command(
-                "sh -c 'cd {0}/scripts/ && sudo modprobe uio && "
-                "sudo insmod ./ko/src/igb_uio.ko'"\
+                "sh -c 'cd {0}/scripts/ && "
+                "sudo ./trex-cfg'"\
                 .format(trex_path))
 
             (ret, stdout, stderr) = 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 4 --iom 0 > /dev/null 2>&1 &'"
+                "> /dev/null"\
                 .format(trex_path))
 
     @staticmethod
@@ -82,7 +83,7 @@ class TrafficGenerator(object):
         :param nodes_info: Dictionary containing information on all nodes
         in topology.
         :param duration: Duration of test traffic generation in seconds
-        :param rate: Percentage of linerate
+        :param rate: Offered load per interface (e.g. 1%, 3gbps, 4mpps, ...)
         :param framesize: Frame size (L2) in Bytes
         :param traffic_type: Traffic profile
         :type nodes_info: dict
@@ -109,7 +110,7 @@ class TrafficGenerator(object):
             if traffic_type in ["3-node-xconnect", "3-node-bridge"]:
                 (ret, stdout, stderr) = ssh.exec_command(
                     "sh -c '/tmp/openvpp-testing/resources/tools/t-rex-stateless.py "
-                    "-d {0} -r {1}% -s {2} "
+                    "-d {0} -r {1} -s {2} "
                     "--p1_src_start_ip 10.10.10.1 "
                     "--p1_src_end_ip 10.10.10.254 "
                     "--p1_dst_start_ip 20.20.20.1 "
@@ -120,7 +121,7 @@ class TrafficGenerator(object):
             elif traffic_type in ["3-node-IPv4"]:
                 (ret, stdout, stderr) = ssh.exec_command(
                     "sh -c '/tmp/openvpp-testing/resources/tools/t-rex-stateless.py "
-                    "-d {0} -r {1}% -s {2} "
+                    "-d {0} -r {1} -s {2} "
                     "--p1_src_start_ip 10.10.10.2 "
                     "--p1_src_end_ip 10.10.10.254 "
                     "--p1_dst_start_ip 20.20.20.2 "