Modify test_pointer_device_type to use conf hvs

This patch modifies the pointer device type test to use the hypervisor
IP from the config file, if available. This makes it possible to run
the test in deployments where the IP returned by 'nova
hypervisor-show' isn't reachable from the node running tempest.

Change-Id: I65dfa65892e196d685b47d286e4f5b5b434d6676
This commit is contained in:
Artom Lifshitz
2017-11-14 13:47:15 -05:00
parent fe19cf8fa1
commit 6043d26b78

View File

@@ -26,6 +26,7 @@ from oslo_log import log as logging
from tempest.common import utils
from tempest import config
from whitebox_tempest_plugin.common import utils as whitebox_utils
from whitebox_tempest_plugin.services import clients
from whitebox_tempest_plugin.tests.scenario import base
@@ -52,13 +53,8 @@ class PointerDeviceTypeFromImages(base.BaseTest):
# Retrieve the server's hypervizor hostname
server = self.servers_client.show_server(server_id)['server']
hostname = server['OS-EXT-SRV-ATTR:host']
hypers = self.hypervisor_client.list_hypervisors(
detail=True)['hypervisors']
compute_node_address = None
for hypervisor in hypers:
if hypervisor['service']['host'] == hostname:
compute_node_address = hypervisor['host_ip']
compute_node_address = whitebox_utils.get_hypervisor_ip(
self.hypervisor_client, hostname)
self.assertIsNotNone(compute_node_address)
# Retrieve input device from virsh dumpxml