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
from slapos.recipe.librecipe import generateHashFromFiles
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
from slapos.util import bytes2str
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
......@@ -187,7 +188,7 @@ class TestSSH(SlaprunnerTestCase):
channel.settimeout(30)
received = ''
while True:
r = channel.recv(1024)
r = bytes2str(channel.recv(1024))
self.logger.debug("received >%s<", r)
if not r:
break
......@@ -199,7 +200,7 @@ class TestSSH(SlaprunnerTestCase):
# simple commands can also be executed ( this would be like `ssh bash -c 'pwd'` )
self.assertEqual(
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):
......@@ -213,7 +214,7 @@ class TestSlapOS(SlaprunnerTestCase):
'show',
),
env={})
self.assertIn('slaprunner', proxy_show_output)
self.assertIn(b'slaprunner', proxy_show_output)
def test_shared_part_list(self):
# 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