Merge "Add conditional graphical console validation"
This commit is contained in:
@@ -25,8 +25,8 @@ BAREMETAL_MICROVERSION = None
|
||||
|
||||
# Interfaces that can be set via the baremetal client and by logic in scenario
|
||||
# managers.
|
||||
SUPPORTED_INTERFACES = ['bios', 'deploy', 'rescue', 'boot', 'raid',
|
||||
'management', 'power', 'inspect']
|
||||
SUPPORTED_INTERFACES = (['bios', 'deploy', 'rescue', 'boot', 'raid',
|
||||
'management', 'power', 'inspect', 'console'])
|
||||
|
||||
|
||||
def set_baremetal_api_microversion(baremetal_microversion):
|
||||
|
||||
@@ -634,6 +634,12 @@ class BaremetalStandaloneScenarioTest(BaremetalStandaloneManager):
|
||||
# been set via a different test).
|
||||
inspect_interface = None
|
||||
|
||||
# The console interface to use by the HW type. The console interface of the
|
||||
# node used in the test will be set to this value. If set to None, the
|
||||
# node will retain its existing console_interface value (which may have
|
||||
# been set via a different test).
|
||||
console_interface = None
|
||||
|
||||
# Boolean value specify if image is wholedisk or not.
|
||||
wholedisk_image = None
|
||||
|
||||
|
||||
@@ -14,19 +14,22 @@
|
||||
# under the License.
|
||||
|
||||
from oslo_log import log as logging
|
||||
from tempest.common import compute
|
||||
from tempest.common import utils
|
||||
from tempest.common import waiters
|
||||
from tempest import config
|
||||
from tempest.lib.common import api_version_request
|
||||
from tempest.lib import decorators
|
||||
|
||||
from ironic_tempest_plugin.services.baremetal import base
|
||||
from ironic_tempest_plugin.tests.scenario import baremetal_manager
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class BaremetalBasicOps(baremetal_manager.BaremetalScenarioTest):
|
||||
class BaremetalBasicOps(baremetal_manager.BaremetalScenarioTest,
|
||||
compute.NoVNCValidateMixin):
|
||||
"""This smoke test tests an Ironic driver.
|
||||
|
||||
It follows this basic set of operations:
|
||||
@@ -47,10 +50,15 @@ class BaremetalBasicOps(baremetal_manager.BaremetalScenarioTest):
|
||||
|
||||
credentials = ['primary', 'admin', 'system_admin']
|
||||
|
||||
# Note: 1.31 API microversion is needed to enable the graphical console.
|
||||
# So that we can validate the graphical console functionality.
|
||||
min_microversion = '1.65'
|
||||
|
||||
TEST_RESCUE_MODE = False
|
||||
image_ref = None
|
||||
wholedisk_image = None
|
||||
auto_lease = False
|
||||
console_interface = 'fake-graphical'
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
@@ -70,6 +78,13 @@ class BaremetalBasicOps(baremetal_manager.BaremetalScenarioTest):
|
||||
'cannot test rescue operations.' % cls.__name__)
|
||||
raise cls.skipException(msg)
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
"Setup the default API microversion."
|
||||
super(BaremetalBasicOps, cls).resource_setup()
|
||||
base.set_baremetal_api_microversion(cls.min_microversion)
|
||||
cls.addClassCleanup(base.reset_baremetal_api_microversion)
|
||||
|
||||
@staticmethod
|
||||
def _is_version_supported(version):
|
||||
"""Return whether an API microversion is supported."""
|
||||
@@ -222,9 +237,35 @@ class BaremetalBasicOps(baremetal_manager.BaremetalScenarioTest):
|
||||
# set the lessee.
|
||||
self.assertEqual(iinfo['project_id'], self.node['lessee'])
|
||||
|
||||
def validate_console(self):
|
||||
"""Validate graphical console functionality.
|
||||
|
||||
Tests that nova-novncproxy can connect to the console container.
|
||||
Validation passing here means the novnc console will be available
|
||||
in horizon for an instance using the ironic nova driver.
|
||||
"""
|
||||
body = self.servers_client.get_vnc_console(self.instance['id'],
|
||||
type='novnc')['console']
|
||||
self.assertEqual('novnc', body['type'])
|
||||
# Do the initial HTTP Request to novncproxy to get the NoVNC JavaScript
|
||||
self.validate_novnc_html(body['url'])
|
||||
# Do the WebSockify HTTP Request to novncproxy to do the RFB connection
|
||||
self.websocket = compute.create_websocket(body['url'])
|
||||
self.addCleanup(self.websocket.close)
|
||||
# Validate that we successfully connected and upgraded to Web Sockets
|
||||
self.validate_websocket_upgrade()
|
||||
# Validate the RFB Negotiation to determine if a valid VNC session
|
||||
self.validate_rfb_negotiation()
|
||||
|
||||
def baremetal_server_ops(self):
|
||||
self.add_keypair()
|
||||
self.instance, self.node = self.boot_instance(image_id=self.image_ref)
|
||||
# Validate graphical console if fake-graphical interface is configured.
|
||||
# Note: Only fake-graphical is tested (redfish-graphical excluded as
|
||||
# sushy-tools doesn't support VNC yet). If configured but proxy is
|
||||
# missing, test will fail revealing the misconfiguration.
|
||||
if self.node.get('console_interface') == 'fake-graphical':
|
||||
self.validate_console()
|
||||
self.validate_image()
|
||||
self.validate_ports()
|
||||
self.validate_scheduling()
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
voting: false
|
||||
- ironic-tempest-standalone-advanced
|
||||
- ironic-tempest-bios-ipmi-direct
|
||||
- ironic-tempest-bios-ipmi-autodetect
|
||||
# NOTE(dtantsur): these jobs cover rarely changed tests and are quite
|
||||
# unstable, so keep them non-voting.
|
||||
- ironic-tempest-ipa-wholedisk-direct-tinyipa-multinode:
|
||||
@@ -40,3 +41,4 @@
|
||||
- ironic-standalone-redfish-2026.1
|
||||
- ironic-standalone-redfish-2025.2
|
||||
- ironic-tempest-bios-ipmi-direct
|
||||
- ironic-tempest-bios-ipmi-autodetect
|
||||
|
||||
Reference in New Issue
Block a user