diff mbox series

[V1] tests/TestSuite_telemetry: Adapting python3 code rules

Message ID 20210119083220.16249-1-box.c.chen@intel.com (mailing list archive)
State Accepted
Headers show
Series [V1] tests/TestSuite_telemetry: Adapting python3 code rules | expand

Commit Message

Chen Bo Jan. 19, 2021, 8:32 a.m. UTC
The coding styles of python2 and python3 are different, modify script to adapt to python3.

Signed-off-by: ChenBo <box.c.chen@intel.com>
---
 tests/TestSuite_telemetry.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Chen Bo Jan. 19, 2021, 8:36 a.m. UTC | #1
Tested-by: ChenBo <box.c.chen@intel.com>

Regards,
Chen Bo

> -----Original Message-----
> From: ChenBo <box.c.chen@intel.com>
> Sent: January 19, 2021 16:32
> To: dts@dpdk.org
> Cc: Chen, BoX C <box.c.chen@intel.com>
> Subject: [dts][PATCH V1] tests/TestSuite_telemetry: Adapting python3 code
Zhao, HaiyangX Jan. 19, 2021, 9:13 a.m. UTC | #2
Acked-by: Haiyang Zhao <haiyangx.zhao@intel.com>

Best Regards,
Zhao Haiyang

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Chen, BoX C
> Sent: Tuesday, January 19, 2021 16:37
> To: Chen, BoX C <box.c.chen@intel.com>; dts@dpdk.org
> Subject: Re: [dts] [PATCH V1] tests/TestSuite_telemetry: Adapting python3
> code rules
> 
> Tested-by: ChenBo <box.c.chen@intel.com>
> 
> Regards,
> Chen Bo
> 
> > -----Original Message-----
> > From: ChenBo <box.c.chen@intel.com>
> > Sent: January 19, 2021 16:32
> > To: dts@dpdk.org
> > Cc: Chen, BoX C <box.c.chen@intel.com>
> > Subject: [dts][PATCH V1] tests/TestSuite_telemetry: Adapting python3
> code
Tu, Lijuan Jan. 21, 2021, 8:24 a.m. UTC | #3
> Subject: [dts] [PATCH V1] tests/TestSuite_telemetry: Adapting python3 code
> rules
> 
> The coding styles of python2 and python3 are different, modify script to
> adapt to python3.
> 
> Signed-off-by: ChenBo <box.c.chen@intel.com>

Applied, next time please:
	1, remove prefix "TestSuite" in subject to reduce text count
	2, don't use capitals in general
diff mbox series

Patch

diff --git a/tests/TestSuite_telemetry.py b/tests/TestSuite_telemetry.py
index 81e14a6c..7e474bc2 100644
--- a/tests/TestSuite_telemetry.py
+++ b/tests/TestSuite_telemetry.py
@@ -70,8 +70,8 @@  class TestTelemetry(TestCase):
                     with open(self.json_file, 'w') as fp:
                         fp.write(data)
                 def requestMetrics(self): # Requests metrics for given client
-                    self.socket.client_fd.send(METRICS_REQ)
-                    data = self.socket.client_fd.recv(BUFFER_SIZE)
+                    self.socket.client_fd.send(METRICS_REQ.encode())
+                    data = self.socket.client_fd.recv(BUFFER_SIZE).decode()
                     return data
                 def singleRequestMetrics(self):
                     data = self.requestMetrics()
@@ -128,7 +128,7 @@  class TestTelemetry(TestCase):
         self.query_tool = ';'.join([
             'cd {}'.format(self.target_dir),
             'chmod 777 {}'.format(fileName),
-            './' + fileName])
+            'python3 ' + fileName])
 
     def rename_dpdk_telemetry_tool(self):
         '''