From a291832963f1c809ce204539dd9eafd2921f0c89 Mon Sep 17 00:00:00 2001 From: James Parker Date: Thu, 26 Oct 2023 13:27:44 -0400 Subject: [PATCH] Add test support for bochs display device Add test coverage for bochs display device [1]. Bochs is considered a safe and simplified alternative to use over VGA when UEFI is enabled. Test creates an image with firmware type of UEFI and video model of bochs. Boots guest and confirms the model is present. [1] https://blueprints.launchpad.net/nova/+spec/add-bochs-display-device Change-Id: I85f6fdda6a1c1042de2870a9d9f13f4cc6b32974 --- devstack/plugin.sh | 1 + devstack/settings | 1 + .../api/compute/test_hw_video_type.py | 14 ++++++++++++++ whitebox_tempest_plugin/config.py | 3 +++ 4 files changed, 19 insertions(+) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 57e80ea5..44a9e063 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -31,6 +31,7 @@ function configure { iniset $TEMPEST_CONFIG compute-feature-enabled virtio_rng "$COMPUTE_FEATURE_VIRTIO_RNG" iniset $TEMPEST_CONFIG compute-feature-enabled rbd_download "$COMPUTE_FEATURE_RBD_DOWNLOAD" iniset $TEMPEST_CONFIG compute-feature-enabled uefi_secure_boot "$COMPUTE_FEATURE_UEFI_SECURE_BOOT" + iniset $TEMPEST_CONFIG compute-feature-enabled bochs_display_support "$COMPUTE_FEATURE_BOCHS_DISPLAY" iniset $TEMPEST_CONFIG compute-feature-enabled vtpm_device_supported "$COMPUTE_FEATURE_VTPM_ENABLED" iniset $TEMPEST_CONFIG compute-feature-enabled live_migrate_back_and_forth "$COMPUTE_FEATURE_LIVE_MIGRATE_BACK_AND_FORTH" diff --git a/devstack/settings b/devstack/settings index 44881a7d..23a946e8 100644 --- a/devstack/settings +++ b/devstack/settings @@ -15,5 +15,6 @@ WHITEBOX_SHARED_CPUS_PER_NUMA=${WHITEBOX_SHARED_CPUS_PER_NUMA:-2} COMPUTE_FEATURE_VIRTIO_RNG=${COMPUTE_FEATURE_VIRTIO_RNG:-'True'} COMPUTE_FEATURE_RBD_DOWNLOAD=${COMPUTE_FEATURE_RBD_DOWNLOAD:-'False'} COMPUTE_FEATURE_UEFI_SECURE_BOOT=${COMPUTE_FEATURE_UEFI_SECURE_BOOT:-'True'} +COMPUTE_FEATURE_BOCHS_DISPLAY=${COMPUTE_FEATURE_BOCHS_DISPLAY:-'True'} COMPUTE_FEATURE_VTPM_ENABLED=${COMPUTE_FEATURE_VTPM_ENABLED:-'True'} COMPUTE_FEATURE_LIVE_MIGRATE_BACK_AND_FORTH=${COMPUTE_FEATURE_LIVE_MIGRATE_BACK_AND_FORTH:-'True'} diff --git a/whitebox_tempest_plugin/api/compute/test_hw_video_type.py b/whitebox_tempest_plugin/api/compute/test_hw_video_type.py index ad4e5457..559dcaaa 100644 --- a/whitebox_tempest_plugin/api/compute/test_hw_video_type.py +++ b/whitebox_tempest_plugin/api/compute/test_hw_video_type.py @@ -73,3 +73,17 @@ class HwVideoModelTest(base.BaseWhiteboxComputeTest): expected_video_model = CONF.whitebox.default_video_model server = self.create_test_server(wait_until='ACTIVE') self._assert_hw_video_type(server, expected_video_model) + + @testtools.skipUnless(CONF.compute_feature_enabled.bochs_display_support, + 'Requires expected default video model') + @testtools.skipUnless(CONF.compute_feature_enabled.uefi_boot, + 'Requires support of uefi boot') + def test_bochs_display_device(self): + image_properties = {'hw_firmware_type': 'uefi', + 'hw_machine_type': 'q35', + 'hw_video_model': 'bochs'} + + uefi_image_id = self.copy_default_image(**image_properties) + server = self.create_test_server( + image_id=uefi_image_id, wait_until='ACTIVE') + self._assert_hw_video_type(server, 'bochs') diff --git a/whitebox_tempest_plugin/config.py b/whitebox_tempest_plugin/config.py index 761fab1c..45f543b2 100644 --- a/whitebox_tempest_plugin/config.py +++ b/whitebox_tempest_plugin/config.py @@ -322,4 +322,7 @@ compute_features_group_opts = [ 'default value of [DEFAULT]state_path in the nova-compute' 'config, then [whitebox-nova-compute]state_path also ' 'needs to be configured'), + cfg.BoolOpt('bochs_display_support', + default=False, + help="Guests support bochs display device"), ]