Check the default video model

Add test to check the default video model of the guest. This is meant to
add coverage for [1], which has changed the default video model from
cirrus to virtio.

[1] https://review.opendev.org/c/openstack/nova/+/798680/

Change-Id: I1fb093b1f6cfb6a4f34d9a77b9f81a876b1e0638
This commit is contained in:
James Parker 2021-11-23 12:03:56 -05:00
parent 55fbe42447
commit 4ec22346dd
4 changed files with 18 additions and 1 deletions

View File

@ -16,6 +16,7 @@ function configure {
iniset $TEMPEST_CONFIG whitebox cpu_model $WHITEBOX_CPU_MODEL
iniset $TEMPEST_CONFIG whitebox cpu_model_extra_flags $WHITEBOX_CPU_MODEL_EXTRA_FLAGS
iniset $TEMPEST_CONFIG whitebox rx_queue_size $WHITEBOX_RX_QUEUE_SIZE
iniset $TEMPEST_CONFIG whitebox default_video_model $WHITEBOX_DEFAULT_VIDEO_MODEL
iniset $TEMPEST_CONFIG whitebox-nova-compute config_path "$WHITEBOX_NOVA_COMPUTE_CONFIG_PATH"
iniset $TEMPEST_CONFIG whitebox-nova-compute stop_command "$WHITEBOX_NOVA_COMPUTE_STOP_COMMAND"

View File

@ -4,6 +4,7 @@ WHITEBOX_AVAILABLE_CINDER_STORAGE=${WHITEBOX_AVAILABLE_CINDER_STORAGE:-24}
SMT_HOSTS=${SMT_HOSTS:-''}
WHITEBOX_FILE_BACKED_MEMORY_SIZE=${WHITEBOX_FILE_BACKED_MEMORY_SIZE:-8192}
WHITEBOX_RX_QUEUE_SIZE=${WHITEBOX_RX_QUEUE_SIZE:-1024}
WHITEBOX_DEFAULT_VIDEO_MODEL=${WHITEBOX_DEFAULT_VIDEO_MODEL:-'virtio'}
WHITEBOX_NOVA_COMPUTE_CONFIG_PATH=${WHITEBOX_NOVA_COMPUTE_CONFIG_PATH:-/etc/nova/nova-cpu.conf}
WHITEBOX_NOVA_COMPUTE_STOP_COMMAND=${WHITEBOX_NOVA_COMPUTE_STOP_COMMAND:-'systemctl stop devstack@n-cpu'}

View File

@ -14,9 +14,13 @@
# under the License.
from tempest.common import waiters
from tempest import config
import testtools
from whitebox_tempest_plugin.api.compute import base
CONF = config.CONF
class HwVideoModelTest(base.BaseWhiteboxComputeTest):
"""Tests the support of different hardware video model type
@ -58,3 +62,10 @@ class HwVideoModelTest(base.BaseWhiteboxComputeTest):
waiters.wait_for_server_status(self.servers_client, server['id'],
'ACTIVE')
self._assert_hw_video_type(server, 'none')
@testtools.skipUnless(CONF.whitebox.default_video_model,
'Requires expected default video model')
def test_default_hw_device(self):
expected_video_model = CONF.whitebox.default_video_model
server = self.create_test_server()
self._assert_hw_video_type(server, expected_video_model)

View File

@ -113,7 +113,11 @@ general_opts = [
cfg.IntOpt(
'rx_queue_size',
help='The queue size set in the [libvirt]/rx_queue_size config option '
'on the compute hosts.')
'on the compute hosts.'),
cfg.StrOpt(
'default_video_model',
default=None,
help='The expected default video display for the guest')
]
nova_compute_group = cfg.OptGroup(