mirror of
https://github.com/rancher/os.git
synced 2025-09-03 07:44:21 +00:00
make tests run on arm64
This commit is contained in:
@@ -90,8 +90,8 @@ def wait_for_ssh(qemu, ssh_command=['./scripts/ssh', '--qemu'], command=['docker
|
||||
i += 1
|
||||
print('\nWaiting for ssh and docker... ' + str(i))
|
||||
time.sleep(1)
|
||||
if i > 60:
|
||||
raise 'Failed to connect to SSH'
|
||||
if i > 150:
|
||||
raise AssertionError('Failed to connect to SSH')
|
||||
assert qemu.returncode is None
|
||||
|
||||
|
||||
@@ -101,11 +101,19 @@ class SSH:
|
||||
self._ssh_command = ssh_command
|
||||
self._waited = False
|
||||
|
||||
def check_call(self, *args, **kw):
|
||||
def wait(self):
|
||||
if not self._waited:
|
||||
wait_for_ssh(self._qemu, ssh_command=self._ssh_command)
|
||||
self._waited = True
|
||||
|
||||
def check_call(self, *args, **kw):
|
||||
self.wait()
|
||||
kw['stderr'] = subprocess.STDOUT
|
||||
kw['universal_newlines'] = True
|
||||
return subprocess.check_call(self._ssh_command + list(args), **kw)
|
||||
|
||||
def check_output(self, *args, **kw):
|
||||
self.wait()
|
||||
kw['stderr'] = subprocess.STDOUT
|
||||
kw['universal_newlines'] = True
|
||||
return subprocess.check_output(self._ssh_command + list(args), **kw)
|
||||
|
Reference in New Issue
Block a user