]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Decode command execution output to a str for python3
authorJouni Malinen <j@w1.fi>
Sat, 2 Feb 2019 10:48:30 +0000 (12:48 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 2 Feb 2019 10:51:13 +0000 (12:51 +0200)
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>
tests/hwsim/hostapd.py
tests/hwsim/remotehost.py
tests/hwsim/wpasupplicant.py

index 9deab15aad754490c2f812959c7dfc7325dd50fa..69d3e31350e46a113a9c7a06971aaefa31f039b4 100644 (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)
 
index bf1ccd2166d0c4f2f72f27febac809466ce0331f..f18da4994ba0cb688ac19466bfe65347c3b10461 100644 (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):
index 0cc6ea8c946acdac7ae47a723586dbdcad5a3280..1d538f1f70167d61674c2a81e9a1efbb43b661e1 100644 (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)