Bugfix: HA test case baremetal down ipmi power off failed - dovetail
[yardstick.git] / yardstick / benchmark / scenarios / networking / netperf.py
index 08d5dd1..9f1a814 100755 (executable)
@@ -104,7 +104,9 @@ class Netperf(base.Scenario):
         cmd_args = "-H %s -l %s -t %s" % (ipaddr, testlen, testname)
 
         # get test specific options
-        default_args = "-O 'THROUGHPUT,THROUGHPUT_UNITS,MEAN_LATENCY'"
+        output_opt = options.get(
+            "output_opt", "THROUGHPUT,THROUGHPUT_UNITS,MEAN_LATENCY")
+        default_args = "-O %s" % output_opt
         cmd_args += " -- %s" % default_args
         option_pair_list = [("send_msg_size", "-m"),
                             ("recv_msg_size", "-M"),
@@ -114,6 +116,10 @@ class Netperf(base.Scenario):
                 cmd_args += " %s %s" % (option_pair[1],
                                         options[option_pair[0]])
 
+        # Enable IP routing for UDP_STREAM test
+        if testname == "UDP_STREAM":
+            cmd_args += " -R 1"
+
         cmd = "sudo bash netperf.sh %s" % (cmd_args)
         LOG.debug("Executing command: %s", cmd)
         status, stdout, stderr = self.client.execute(cmd)
@@ -132,9 +138,9 @@ class Netperf(base.Scenario):
             sla_max_mean_latency = int(
                 self.scenario_cfg["sla"]["mean_latency"])
 
-            assert mean_latency <= sla_max_mean_latency, \
-                "mean_latency %f > sla_max_mean_latency(%f); " % \
-                (mean_latency, sla_max_mean_latency)
+            self.verify_SLA(mean_latency <= sla_max_mean_latency,
+                            "mean_latency %f > sla_max_mean_latency(%f); "
+                            % (mean_latency, sla_max_mean_latency))
 
 
 def _test():