Browse Source

tests: wait_for_ssh is now in ssh.SSH

keep-around/5ec0ee4aa414f225a8ff9a4bc906b009a0592eff
Loïc Dachary 7 months ago
committed by Loic Dachary
parent
commit
0c2ddb11ad
Signed by: dachary GPG Key ID: 992D23B392F9E4F2
  1. 3
      enough/common/__init__.py
  2. 7
      tests/enough/common/test_init.py

3
enough/common/__init__.py

@ -11,6 +11,7 @@ from enough.common.host import host_factory
from enough.common.service import service_factory
from enough.common.openstack import OpenStack, Heat
from enough.common.libvirt import Libvirt
from enough.common.ssh import SSH
from enough.common import retry
from enough.common import ansible_utils
@ -287,7 +288,7 @@ class Enough(object):
raise Enough.VolumeResizeNoSize(f'no size found for {volume} in the openstack_volumes '
f'variable ({volumes}) for {host}')
r = self.openstack.volume_resize(host, volume, int(volume_size))
self.openstack.wait_for_ssh(d['ansible_host'], d['ansible_port'])
SSH.wait_for_ssh(d['ansible_host'], d['ansible_port'])
return r
def info(self):

7
tests/enough/common/test_init.py

@ -7,7 +7,8 @@ import yaml
from enough import settings
from enough.common import Enough
from enough.common.openstack import OpenStackBase, OpenStack
from enough.common.openstack import OpenStack
from enough.common.ssh import SSH
from tests import prepare_config_dir
@ -247,7 +248,7 @@ def test_restore_remote(request, tmpdir):
assert ip != clone_ip
OpenStackBase.wait_for_ssh(clone_ip, clone_port)
SSH.wait_for_ssh(clone_ip, clone_port)
sh.ssh_keygen('-R', clone_ip, _ok_code=(0, 255))
res = sh.ssh('-oStrictHostKeyChecking=no',
'-i', clone.dotenough.private_key(), f'-p{clone_port}',
@ -283,7 +284,7 @@ def test_restore_local(request, tmpdir):
assert e == e.restore_local(snapshot)
assert 'sample-volume' in e.openstack.o.volume.list()
OpenStackBase.wait_for_ssh(ip, port)
SSH.wait_for_ssh(ip, port)
sh.ssh_keygen('-R', ip, _ok_code=(0, 255))
res = sh.ssh('-oStrictHostKeyChecking=no', '-i', e.dotenough.private_key(),
f'-p{port}', f'debian@{ip}', 'test', '-e', '/srv/STONE')

Loading…
Cancel
Save