Commit Graph

334 Commits

Author SHA1 Message Date
jamepark4 766ff042bd Add vIOMMU device tests
Adds tests to verify [1] which allows operators to add vIOMMU devices to
their guests via flavor configuration. Tests do a basic smoke test that
creates a guest with the vIOMMU flavor requirements and confirms to
relevant XML element is present on the domain. Test also resizes a
standard guest to a flavor with vIOMMU, and confirms to XML is present.
Then revert and confirm the element is no longer present.

[1] https://blueprints.launchpad.net/nova/+spec/libvirt-viommu-device
Change-Id: I92c3538f985f0db0ef24ce2c49a797d3fcb69252
2024-02-20 11:50:17 -05:00
Zuul 4b4ba3d8d9 Merge "Add test support for bochs display device" 2024-02-09 17:03:50 +00:00
James Parker a291832963 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
2024-02-07 13:52:47 -05:00
Artom Lifshitz c474ef3235 "Fix" double declaration of barbican-templest-plugin
Apparently downstream CI can't handle the second
barbican-tempest-plugin entry. Make it conditional on the Pyton
version as well.

Change-Id: I2c34afe243a73912837b6fc7efdff21eacf920a0
2023-12-22 12:54:42 -05:00
Zuul 9d66d41682 Merge "Test coverage for stable compute UUID" 2023-12-22 03:05:29 +00:00
Artom Lifshitz 57363d6e71 Cap barbican to 1.6.0 for Python 3.6
This is downstream 16.2 CI leaking upstream, but
barbican-tempest-plugin started requiring tempest>=27.0 as of
1.7.0/238cdf1b8d. Downstream 16.2 CI is for train, and we cap tempest
to 26.0, probably because that's the last tempest release to support
train. Cap our barbican-tempest-plugin requirement on Python 3.6 to a
version that doesn't need newer Tempest.

Change-Id: I624952d8661e901ba11cf4bb5a20eb3b5c8df1d7
2023-12-21 19:45:37 +00:00
Balazs Gibizer bd86fab09d Test coverage for stable compute UUID
This only covers that happy path of the feature. We agreed that the
error paths are hard to cover here and we rely on the nova functional
test instead.

There are two new config options:
* [compute_feature_enable]stable_compute_uuid_supported defaulted to
  False to skip the tests for old deployments not having the feature.
* [whitebox-nova-compute]state_path defaulted to /var/lib/nova, to allow
  running the tests in deployments that are using a non default nova
  state path configuration (like devstack)

The devstack plugin is modified to set [whitebox-nova-compute]state_path
according to the devstack nova configuration.

Change-Id: I520bd61b6ab479a36098586f7296822703a24fb0
2023-12-20 11:44:57 +01:00
Balazs Gibizer 912befd4cb Add barbican-tempest-plugin to requirements.txt
The vTPM tests needs the barbican plugin so we are adding it.

Change-Id: I3b8be4207818bdf4a0efc413786de917d73d8f8c
2023-12-18 14:57:12 +00:00
Balazs Gibizer a9d3bf9f4a Use compute-feature-enabled as the config group name
The tempest config group name is compute-feature-enabled the python code
needs to use CONF.compute_feature_enabled to access that group. But the
test skipping message should point to the group config name instead of
the python variable name to avoid confusion

Change-Id: I5b852d9f8dbb9392329d82c70a1686f96628a5e8
2023-12-08 18:10:07 +01:00
James Parker 625a048e5f Add plugin specific sriov vnic port parameter
Current implementation of NUMA Affinity SR-IOV tests run into an issue
when paired with Neutron test plugins designed to test OVS ports.
Neutron plugin creates ports based on network.port_vnic_type if that is
present otherwise it defaults to a virtualized port. Attach/Detach tests
on Neutron side will fail for older releases when paired with Whitebox
since it will attempt to create SR-IOV ports when attach/detach is not
supported.

Updating Whitebox to have its own plugin specific vnic configuration
that is used first otherwise it falls back to network.port_vnic_type.

Change-Id: Idee8bfc7867b3a818e75165ebbc927142d00bed2
2023-11-17 11:27:26 -05:00
Artom Lifshitz 7be8f52fe3 Remove unit tests
Building on 3fe1d72fa6, remove the unit
test code altogether, and their corresponding tox jobs.

Change-Id: I36a531093d0b5926b8964786fb1ea16ec6a3c038
2023-11-16 12:05:00 -05:00
Zuul 133a20999a Merge "Add global nodes variable" 2023-11-16 16:53:03 +00:00
James Parker 3fe1d72fa6 Add global nodes variable
For multi-rhel environments the container/service names are different
based on the RHEL version. Introduce the capacity to define the expected
container/service names for each of the compute nodes in a deployment.

Current compute yaml file follows the below format:
computerhel8-0.redhat.local:
  services:
    libvirt:
      container_name: nova_libvirt
      start_command: 'systemctl start tripleo_nova_libvirt'
      stop_command: 'systemctl stop tripleo_nova_libvirt'
    nova-compute:
      container_name: nova_compute
      config_path: '/var/lib/config-data/puppet-generated/nova_libvirt/etc/nova/nova.conf'
      start_command: 'systemctl start tripleo_nova_compute'
      stop_command: 'systemctl stop tripleo_nova_compute'
compute-0.redhat.local:
  services:
    libvirt:
      container_name: nova_virtqemud
      start_command: 'systemctl start tripleo_nova_virtqemud'
      stop_command: 'systemctl stop tripleo_nova_virtqemud'
    nova-compute:
      container_name: nova_compute
      config_path: '/var/lib/config-data/puppet-generated/nova_libvirt/etc/nova/nova.conf'
      start_command: 'systemctl start tripleo_nova_compute'
      stop_command: 'systemctl stop tripleo_nova_compute'

Also removed the unit test execution since they do not support this
latest change and do not feel the tests are adding any value to commit
validation at this time.

Change-Id: I98ac827feb4be77af9a482d8ce43d0f1d062e54d
2023-11-13 13:39:53 -05:00
James Parker 175d343fc4 Update requirements for paramiko for Downstream Train
Current (Train/16.x) deployments downstream come with a Undercloud
installed with pip 9. When installing paramiko it attempts to install
cyrptography 3.3 which needs pip 10 or greater to install. In the past
downstream has been installing whitebox into its own virtualenv and
upgrading the associated pip accordingly without any issues. Downstream
we are hoping to extend whitebox coverage to other test teams but their
current environment does not support virtualenv installation at this
time.

When using python3.6 cap the two paramiko dependencies (see below) that
require pip 10:

  * cryptography<3.3
  * bcrypt<3.2

This will allows the environment to continue using pip9 instead of
pip10+.

Change-Id: I947b3c1089d26f4f1e375290163ae16cb09473be
2023-10-20 12:42:23 -04:00
Dan Smith 5fff0da47a Test nova's cpu host state management
Change-Id: Icc4956f97607373f54e71b3f2fa1b29c5b7d610d
2023-10-16 10:29:32 -07:00
Dan Smith 746a981d60 Fix some dedicated CPU assumptions
Set our dedicated-per-numa value to 3 in the job to leave some room
for excluding cpu0 (which is special) in the next patch. Also try to
determine the appropriate number of dedicated cpus per test server
for cpu pinning by choosing half the minimum available amount on any
compute node.

Change-Id: If0bfd74f7ea9c3cfc7c2f21a939445ccb09e501d
2023-10-12 10:33:09 -07:00
Zuul 9fd80a8b5a Merge "Enable LM back and forth flag for SRIOV" 2023-10-05 15:43:14 +00:00
Artom Lifshitz c0026887ce Use old value for service report interval
Since [1] Devstack has been setting really long service report
intervals, and a correspondingly long service down time threshold.
While that makes sense for "normal" CI, in whitebox we don't have
the load problems that "normal" CI has, while also simultaneously
restarting services and needing the API to reflect their status
changes fairly quickly. Revert to the old value of 10 for the service
report internal, and therefore 10 * 6 for the service down time
threshold.

[1] https://review.opendev.org/c/openstack/devstack/+/890439

Change-Id: I3e8a830f11e11eaa3592ee5354f071bf73dd3435
2023-10-04 14:23:27 -04:00
James Parker c059764085 Enable LM back and forth flag for SRIOV
With the inclusion of the Mixed RHEL deployments Live Migration is only
supported from older to new hypervisors. Current SR-IOV live migration
tests migrate back and forth by default. Add the
compute_feature_enabled.live_migrate_back_and_forth to the SR-IOV live
migration tests so that when testing Mixed RHEL deployments tests stop
after initial live migration.

By default the flag is false so adding the configuration as True to
devstack if SR-IOV tests are ever enabled upstream.

Change-Id: I0b188a484dcefd846613d05fe4c49e710778a952
2023-07-24 14:44:40 -04:00
James Parker 29b3aa6ded Update network reference for sr-iov attach/detach
The vDPA change [1] updated how network names are referenced for the
SRIOVAttachAndDetach class. It was updated from self.sriov_network to
self.network. There were subsequent references within the class that
still use self.sriov_network. This commit adjusts those references to
now use self.network.

[1] f7104a681d

Change-Id: If95e963e1a4e1d4ed592991b52c045b5fb92d2aa
2023-06-20 16:46:23 -04:00
James Parker 401cb527c6 Convert the XML vlan value found from str to int
To update that created a vlan ID parameter for SR-IOV (sriov_vlan_id)
[1], introduces the parameter as an int. When checking the vlan tag in
the guest it will return as a str causing the check to fail e.g.:

"testtools.matchers._impl.MismatchError: 2000 != '2000': Interface should have have vlan tag 2000 but instead it is tagged with 2000"

Casting the vlan tag found in the XML as an int to ensure the check
matches.

[1] f7104a681d

Change-Id: I62f519db8709c23824a0fee1a6ce63ab3bf1f9e2
2023-06-08 16:02:35 -04:00
James Parker 8a82488578 Add socket affinity testing
Add core test for socket affinity testing [1]

[1] https://blueprints.launchpad.net/nova/+spec/pci-socket-affinity

Change-Id: Ie7c6b43d4937221a919635f533431999abbef426
2023-06-06 09:42:04 -04:00
Zuul 6002e22beb Merge "Use barbican client from barbican-templest-plugin" 2023-05-30 20:33:57 +00:00
Zuul fa93fd11a3 Merge "Add multi-numa tests for masked policy" 2023-05-26 18:59:26 +00:00
jskunda f2e9cac7bb Update jobs for Bobcat development cycle
Updating the testing template to Bobcat testing runtime:
https://governance.openstack.org/tc/reference/runtimes/2023.2.html
Also python 2.7 testing is dropped.

Change-Id: Ief5e3a105e35ec65c6d5e3603c971d724949b2f1
2023-05-26 12:24:28 -04:00
James Parker f31b8d85b6 Add vdpa base movement tests
Add vdpa movement tests resize and cold migration to test_vdpa test
sutie.

Depends-on: https://review.opendev.org/c/openstack/whitebox-tempest-plugin/+/822354

Change-Id: Id24df279177b8575b68c830d9282bd8a00713aa8
2023-04-05 17:02:46 -04:00
Zuul 81a677f54f Merge "Add initial vdpa smoke test" 2023-04-03 19:32:42 +00:00
Artom Lifshitz d3a8b0ef14 Use barbican client from barbican-templest-plugin
Previously we had copy-pasted barbican client code into our own in
order to access secrets. If we install the barbican-tempest-plugin, we
can use their client directly, as explained in [1].

[1] https://docs.openstack.org/tempest/latest/plugins/plugin.html#service-clients

Change-Id: Iccbeef049af5e3a913d7ce56cd29f7dc66517532
2023-03-29 12:08:51 -04:00
Zuul 8df1d7fffd Merge "Add vTPM testcases" 2023-03-24 20:57:34 +00:00
Pavan Kesava Rao 8fc6fa5414 Add vTPM testcases
This commit will add tests to cover vTPM device support for instances.
The vTPM device allows storing secrets at instance level and its managed
by the Barbican backend.

The _vptm_server_creation_check helper method is used to create server
with specific vtpm version and model and assert that it is configured as
needed from the instance xml.

The test_create_server_with_vtpm_tis method will verify creation of
instance with tpm-tis model and supported version 2.0.

Similarly, test_create_server_with_vtpm_crb will verify creation of
instance with tpm-crb model and supported version 2.0.

In addition the Barbican client service was leveraged from the barbican
tempest plugin [1]. This is to allow the vTPM test to communicate with
the barbican client, confirm the secret key found in the guest domain is
present in the client, the key is active, and the keys description
accuratly describes its purpose is vTPM for the guest. Example reply
from barbican below:

{'algorithm': None,
 'bit_length': None,
 'content_types': {'default': 'application/octet-stream'},
 'created': '2021-10-13T18:17:52',
 'creator_id': '4b1cc6071236438c881f9da54657468f',
 'expiration': None,
 'mode': None,
 'name': 'vTPM secret for instance b537c0df-0e39-4af8-94b3-04bcc8262f20',
 'secret_ref': 'http://192.168.24.3:9311/v1/secrets/13a9ae5e-5187-4c0f-acde-b2cda06ae00c',
 'secret_type': 'passphrase',
 'status': 'ACTIVE',
 'updated': '2021-10-13T18:17:52'}

[1] https://github.com/openstack/barbican-tempest-plugin

Related to:
https://review.opendev.org/c/openstack/nova/+/631363/
https://review.opendev.org/c/openstack/glance/+/633256/
https://bugzilla.redhat.com/show_bug.cgi?id=1782128

Change-Id: I7b1a1306beb871a9294884116f6430ead91ce601
2023-03-24 12:16:22 -04:00
Artom Lifshitz 7ee13a5fdd Update to Jammy image
We want to run our vTPM tests upstream, to that end we need the swtpm
utility, which is only available in Jammy, not Focal. Update our
custom nodeset to use the new label.

Change-Id: Id24a69765d168c2d0c6fd696e697d6b25314854b
2023-03-21 12:32:19 -04:00
James Parker 1e6b749637 Remove skipsdist to allow project install
The functionality of skipdist changed with tox, now if skipdist is
enabled with usedevelop the project does not get installed. This would
result in whitebox not being properly installed in the environment and
subsequent tox tests failing. Removing skipdist to be inline with new
tox expectations.

Change-Id: I839bf50e0f36174575b78b5065b865995e191b78
2023-03-17 09:32:39 -04:00
James Parker f7104a681d Add initial vdpa smoke test
Add vdpa smoke test for [1]. The network, subnet, port creation, and
verification had a lot of similarities to the test_sriov.SRIOVBase
class. Moved these common methods to the base.BaseWhiteboxComputeTest
class and updated impacted tests accordingly. In addition the sriov
tests were reliant on provider_net_base_segmentation_id for configuring
the vlan id for the network. To allow the vdpa and sriov networks their
own vlan, moved the vlan id configuration to whitebox_hardware via
sriov_vlan_id and vdpa_vlan_id.

[1] https://specs.openstack.org/openstack/nova-specs/specs/wallaby/implemented/libvirt-vdpa-support.html

Change-Id: Ia823d0503dbfb97eda35c6d3cf09a38407802fed
2023-01-23 10:52:12 -05:00
James Parker db22bdcab5 Add multi-numa tests for masked policy
Add aditional tests based around [1] that introduces guest deployments
with multi-NUMA. The first new test is based on a symmetrical load with
the same number of vCPUs and memory per physical NUMA. The second test
limits a quarter of the resources to land on one NUMA and the remaining
75% on the other.

For example a 4 vCPU 1024 RAM guest would configured NUMA 0 to hold 1
vCPU and 256 with NUMA 1 would hold the remaining for the guest. This
type of deployment models high scale NFV architecture, where the control
plane vCPUs may all be shared on a specific NUMA while the dataplane
vCPUs would want to be dedicated and land on a NUMA that is connected to
the compute host's NICs.

[1] https://specs.openstack.org/openstack/nova-specs/specs/victoria/implemented/use-pcpu-vcpu-in-one-instance.html

Change-Id: Iab013b22e60d9d86666fedd76b5a73fe45b3bb98
2023-01-11 09:50:17 -05:00
Zuul 37f8dd83e6 Merge "Update UEFI check when secure is not present" 2022-12-14 12:52:05 +00:00
Zuul 3a912c683e Merge "Test deploying multiple vgpu types" 2022-12-13 21:18:55 +00:00
James Parker d27b413988 Update UEFI check when secure is not present
For RHEL8 the secure boot attribute is not explicitly set to no when a
guest is deployed with just UEFI. Updated test to account for guests
that do not set secure boot to no explicitly.

Change-Id: I6c069a3385dccb3616585d938593146e0fa81387
2022-12-13 16:07:15 -05:00
James Parker c2500cceec Test deploying multiple vgpu types
Test deploying with multiple vGPU types. Assumes custom traits have
already been applied to the deployment. Based on the provided custom
trait/mdev_type mapping, the test will create a flavor using the trait,
create a guest from the flavor, and confirm the mdev_type of the
allocated vgpu device matches the expected mdev_type.

Change-Id: I120094dad4511b6876e4c19be9271e37920480cc
2022-10-13 11:09:47 -04:00
Zuul 30816ea8b8 Merge "Add check for max disk attach" 2022-09-30 15:14:25 +00:00
James Parker 9f98d0aaf9 Add check for max disk attach
The commit [1] added a THT parameter that can set the maximum number of
disks that can be attached to a single guest. Refactored VirtioSCSIDisk
into ultimately three new classes.

 * VirtioSCSIBase - parent class hold standard setup and supporting
   methods for test cases
 * VirtioSCSIDiskMultiAttachment - repuprose of the test methods from
   VirtioSCSIDisk which are meant to test guest support of six or more
   disks
 * VirtioSCSIDiskRestrictAttachments - New test method that validates
   [1] is being enforced correctly.

Since [1] could be set to a value less than six, added skip checks for
VirtioSCSIDiskMultiAttachment if the max allowed disks that can be
attached are six or less.

[1] https://review.opendev.org/c/openstack/puppet-nova/+/708666/

Change-Id: I78f7f47ffa2644c71945bba2b5c1af29e0603363
2022-09-21 11:23:37 -04:00
James Parker b1f8aa20f1 Add UEFI boot based tests
Add two UEFI boot tests one that boots a guest with just UEFI enabled
and a second test that boots a guest with UEFI and secure boot.

Change-Id: Iae8632cf2d8e765e9ae9f56ed98ad954c58484a3
2022-09-19 13:25:12 -04:00
Zuul 5e6f6f5fd5 Merge "Attach and detach an SR-IOV port" 2022-08-26 20:48:38 +00:00
James Parker 1a598590f0 Add vGPU inventory check of Resource Providers
Add an inventory check when testing vGPU to confirm inventory has
updated correctly after instance(s) with vGPU resources have been
deleted.

Change-Id: I9a016e7fc81e4b3324dcc25c5f59358b1b2b528a
2022-08-25 16:48:37 -04:00
James Parker 4ddccddf2f Attach and detach an SR-IOV port
Adds test support for attaching/detaching SR-IOV ports to guests. [1]
These tests pull from the original tempest format [2] from
AttachInterfacesTestJSON.test_reassign_port_between_servers. It adds
additional checks around the guest XML as well as checking within the
guest for the SR-IOV vendor/device id.

Commit also moves _get_pci_addr_from_device from vgpu to hardware.py to
allow it to be called from different tests beyond vgpu.

[1] https://bugs.launchpad.net/nova/+bug/1685152
[2] https://github.com/openstack/tempest/blob/master/tempest/api/compute/servers/test_attach_interfaces.py#L295

Change-Id: I340fd6486b0a179830e6e559281adc257fefb4bd
2022-08-25 16:16:17 -04:00
Zuul caacd55741 Merge "Update NUMA Affinity tests for per port policy" 2022-07-13 01:14:27 +00:00
James Parker d126494711 Update NUMA Affinity tests for per port policy
Update the NUMAAffinity SR-IOV tests to also include policy on a per
port level to test [1]. Tests validate results when ports have a common
policy, different policies, and evaluate precedence when the flavor has
a different value from the ports utilized.

In addition add tests around policy using image metadata as well. Also
include two config options that confirm if image level or port level
affinity configuration is supported.

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

Change-Id: Ic897ddb2f86c1de27342f56b3546735ed2829aec
2022-07-12 15:54:40 -04:00
Zuul 361a24de45 Merge "Update grep cmd when checking for vgpu device" 2022-06-20 20:52:51 +00:00
James Parker a4ca1e1ca5 Update grep cmd when checking for vgpu device
The original assumption that the XML pci bus address will be the same
within the guest when checking the guest for the vGPU device is
incorrect. Depending on the guest firmware the guest can renumber the
address with an address that is different from the XML.

Update no longer uses the pci address found in the XML and instead does
a wildcard grep search in /sys/bus/pci/devices/*/vendor for the vGPU
vendor ID. It also greps that output to confirm there is a valid PCI
address in the path.

Change-Id: Iacdc1947f4c0800aa49fd6d6ec9fae5b2da010d8
2022-06-09 14:03:02 -04:00
James Parker 017d555971 Pull tempest helper from 28.1.0 to WB base class
The reboot_server helper method that was added to tempest [1] was part
of tempset tag 28.1.0. Downstream 16.2 limits git installation to
28.0.0 and no longer supports clone from master. Taking logic from [1]
   for reboot_server and applying it to the base whitbox test class
since there are two tests that currently leverage the method.

[1] ea2b59ce61

Change-Id: If01f0bd4a12717067f59d3ec2421947b64b776e2
2022-06-08 18:43:46 -04:00
James Parker 793a4dde91 Update vgpu flavor ram size as a param
This is a continuation of [1], leaving RAM as 64MB for vGPU tests while
using cirros 0.5.0+ will result in a kernel panic. Updating flavor to
take the RAM size provided by tempest config.

[1] 159f57d395

Change-Id: I0432704a651bf8927354cabd0d8c3e42b8e8525f
2022-05-27 14:02:37 -04:00