tests: Decode command execution output to a str for python3

Need to convert from bytes to str to allow the following string
operations to work with python3.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2019-02-02 12:48:30 +02:00
parent 58be42b264
commit 45b0b88f80
3 changed files with 5 additions and 5 deletions

View file

@ -55,7 +55,7 @@ class HostapdGlobal:
stdout=subprocess.PIPE, shell=shell)
out = proc.communicate()[0]
ret = proc.returncode
return ret, out
return ret, out.decode()
else:
return self.host.execute(cmd_array)
@ -162,7 +162,7 @@ class Hostapd:
stdout=subprocess.PIPE, shell=shell)
out = proc.communicate()[0]
ret = proc.returncode
return ret, out
return ret, out.decode()
else:
return self.host.execute(cmd_array)

View file

@ -55,7 +55,7 @@ class Host():
logger.debug("status: " + str(status))
logger.debug("buf: " + str(buf))
return status, buf
return status, buf.decode()
def execute(self, command):
if self.host is None:
@ -73,7 +73,7 @@ class Host():
logger.debug(self.name + " status: " + str(status))
logger.debug(self.name + " buf: " + str(buf))
return status, buf
return status, buf.decode()
# async execute
def execute_run(self, command, res):

View file

@ -64,7 +64,7 @@ class WpaSupplicant:
stdout=subprocess.PIPE, shell=shell)
out = proc.communicate()[0]
ret = proc.returncode
return ret, out
return ret, out.decode()
else:
return self.host.execute(cmd_array)