Commit 3bb802c6 authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

slaprunner/test: add support for Python 3

parent 89a2521f
...@@ -42,6 +42,7 @@ import six ...@@ -42,6 +42,7 @@ import six
from slapos.recipe.librecipe import generateHashFromFiles from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
from slapos.util import bytes2str
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass( setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath( os.path.abspath(
...@@ -187,7 +188,7 @@ class TestSSH(SlaprunnerTestCase): ...@@ -187,7 +188,7 @@ class TestSSH(SlaprunnerTestCase):
channel.settimeout(30) channel.settimeout(30)
received = '' received = ''
while True: while True:
r = channel.recv(1024) r = bytes2str(channel.recv(1024))
self.logger.debug("received >%s<", r) self.logger.debug("received >%s<", r)
if not r: if not r:
break break
...@@ -199,7 +200,7 @@ class TestSSH(SlaprunnerTestCase): ...@@ -199,7 +200,7 @@ class TestSSH(SlaprunnerTestCase):
# simple commands can also be executed ( this would be like `ssh bash -c 'pwd'` ) # simple commands can also be executed ( this would be like `ssh bash -c 'pwd'` )
self.assertEqual( self.assertEqual(
self.computer_partition_root_path, self.computer_partition_root_path,
client.exec_command("pwd")[1].read(1000).strip()) bytes2str(client.exec_command("pwd")[1].read(1000)).strip())
class TestSlapOS(SlaprunnerTestCase): class TestSlapOS(SlaprunnerTestCase):
...@@ -213,7 +214,7 @@ class TestSlapOS(SlaprunnerTestCase): ...@@ -213,7 +214,7 @@ class TestSlapOS(SlaprunnerTestCase):
'show', 'show',
), ),
env={}) env={})
self.assertIn('slaprunner', proxy_show_output) self.assertIn(b'slaprunner', proxy_show_output)
def test_shared_part_list(self): def test_shared_part_list(self):
# this slapos used shared_part_list # this slapos used shared_part_list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment