cyclictest: use raw strings to escape \[8
[yardstick.git] / yardstick / benchmark / scenarios / networking / pktgen_dpdk.py
index 503ea97..7e3044d 100644 (file)
@@ -6,6 +6,7 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
+from __future__ import absolute_import
 import pkg_resources
 import logging
 import time
@@ -36,7 +37,7 @@ class PktgenDPDKLatency(base.Scenario):
         self.setup_done = False
 
     def setup(self):
-        '''scenario setup'''
+        """scenario setup"""
         self.pktgen_dpdk_script = pkg_resources.resource_filename(
             'yardstick.benchmark.scenarios.networking',
             PktgenDPDKLatency.PKTGEN_DPDK_SCRIPT)
@@ -136,10 +137,12 @@ class PktgenDPDKLatency(base.Scenario):
         # wait for finishing test
         time.sleep(1)
 
-        cmd = "cat ~/result.log -vT \
-               |awk '{match($0,/\[8;40H +[0-9]+/)} \
-               {print substr($0,RSTART,RLENGTH)}' \
-               |grep -v ^$ |awk '{if ($2 != 0) print $2}'"
+        cmd = r"""\
+cat ~/result.log -vT \
+|awk '{match($0,/\[8;40H +[0-9]+/)} \
+{print substr($0,RSTART,RLENGTH)}' \
+|grep -v ^$ |awk '{if ($2 != 0) print $2}'\
+"""
         client_status, client_stdout, client_stderr = self.client.execute(cmd)
 
         if client_status: