Fix test_hostnames test
This test should not try to obtain the node hostnames via ssh when there is no ssh_client available for the node. Change-Id: I999ceac724ccbbedf305f5b0550a49798952d627
This commit is contained in:
parent
a0ca923161
commit
6fb2680a18
@ -14,6 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from oslo_log import log
|
||||||
import pytest
|
import pytest
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
@ -24,6 +25,9 @@ from tobiko.shell import sh
|
|||||||
from tobiko.openstack import topology
|
from tobiko.openstack import topology
|
||||||
|
|
||||||
|
|
||||||
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.minimal
|
@pytest.mark.minimal
|
||||||
class OpenstackNodesTest(testtools.TestCase):
|
class OpenstackNodesTest(testtools.TestCase):
|
||||||
|
|
||||||
@ -42,6 +46,9 @@ class OpenstackNodesTest(testtools.TestCase):
|
|||||||
def test_hostnames(self):
|
def test_hostnames(self):
|
||||||
hostnames = dict()
|
hostnames = dict()
|
||||||
for node in self.topology.nodes:
|
for node in self.topology.nodes:
|
||||||
|
if node.ssh_client is None:
|
||||||
|
LOG.debug(f'Node {node.hostname} has no ssh_client')
|
||||||
|
continue
|
||||||
hostname = sh.get_hostname(ssh_client=node.ssh_client)
|
hostname = sh.get_hostname(ssh_client=node.ssh_client)
|
||||||
self.assertTrue(hostname.startswith(node.name))
|
self.assertTrue(hostname.startswith(node.name))
|
||||||
other = hostnames.setdefault(hostname, node)
|
other = hostnames.setdefault(hostname, node)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user