Tempest plugin for whitebox testing. For testing things not exposed through the REST APIs.
Go to file
James Parker 3ff555d1c8 Update nodes yaml to use cpu architecture
Migrate cpu relevent configuration parameters from tempest.conf to
nova_yamls file. Before cpu information about the hosts such as the cpu
topology and dedicated/shared set was pulled from tempest.conf. This
change moves the information to the nodes yaml approach [1] for
accessing host specific service information.  The format of the
information can be seen below:

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'
  cpu_shared_set: 0,1
  cpu_dedicated_set: 4,5,6,7
  numa:
    node-0:
      cpus: "0-3"
    node-1:
      cpus: "4-7"

[1] 3fe1d72fa6

Change-Id: I1f22131dc04a2d7a5f010da2dfa3f4e9524656a2
2024-04-23 10:57:56 -04:00
devstack Test resize with mem_page_size in flavor 2024-04-18 08:18:56 +02:00
playbooks Update nodes yaml to use cpu architecture 2024-04-23 10:57:56 -04:00
whitebox_tempest_plugin Update nodes yaml to use cpu architecture 2024-04-23 10:57:56 -04:00
.gitignore Update gitignore 2019-04-02 15:51:24 +00:00
.gitreview Fix repo after rename 2020-06-13 07:08:00 +02:00
.stestr.conf Subclass API tests instead of scenario 2018-07-13 10:38:09 -04:00
.zuul.yaml Update nodes yaml to use cpu architecture 2024-04-23 10:57:56 -04:00
LICENSE enable release jobs 2024-04-19 18:58:15 +01:00
README.rst enable release jobs 2024-04-19 18:58:15 +01:00
requirements.txt "Fix" double declaration of barbican-templest-plugin 2023-12-22 12:54:42 -05:00
setup.cfg enable release jobs 2024-04-19 18:58:15 +01:00
setup.py Initial commit 2017-12-12 17:55:00 +01:00
test-requirements.txt Remove tempest and oslo.log from requirements.txt 2020-07-30 12:09:17 -04:00
tox.ini Add global nodes variable 2023-11-13 13:39:53 -05:00

README.rst

Whitebox Tempest plugin

This is a Tempest plugin for whitebox testing. While Tempest's scope is limited to only the REST APIs, whitebox allows tests to peak behind the curtain, similar to how a cloud admin might. Examining things on the compute host(s) and/or the controller(s) is not only allowed, it's required for a test to be in whitebox's scope. Whitebox tests must still be REST API-driven, however their assertions can involve things like the instance XML (if the Nova libvirt driver is in use) or the database.

Requirements

While Tempest is cloud-agnostic because all clouds expose the same OpenStack APIs (with some caveats around extensions), whitebox peaks behind the curtain, and thus is coupled to the way the cloud was deployed. Currently, devstack and TripleO (with undercloud and overcloud) are supported, with only devstack being tested in CI.

Some tests have specific hardware requirements. These should be documented as config options, and tests are expected to skip if their hardware requirements are not declared in the configuration.

Install, configure and run

  1. Tempest needs to be installed and configured.

  2. Install the plugin.

    This should be done from source. :

    .. code-block:: shell

    WORKSPACE=/some/directory cd $WORKSPACE git clone https://opendev.org/openstack/whitebox-tempest-plugin sudo pip install whitebox-tempest-plugin

  3. Configure Tempest.

    The exact configuration will depend on the deployment. There is no configuration reference yet, have a look at whitebox_tempest_plugin/config.py instead. As an example, here is a configuration for a multinode TripleO deployment:

    .. code-block:: ini

    [whitebox] ctlplane_addresses = compute-0.localdomain:192.168.24.6,compute-1.localdomain:192.168.24.12 ctlplane_ssh_username = heat-admin ctlplane_ssh_private_key_path = /home/stack/.ssh/id_rsa containers = true max_compute_nodes = 2 # Some tests depend on there being a single (available) compute node

  4. Execute the tests. :

    tempest run --serial --regex whitebox_tempest_plugin.

    Important

    Whitebox expects its tests to run one at a time. Make sure to pass --serial or --concurrency 1 to tempest run.

How to add a new test

Tests should fit whitebox's scope. If a test intereacts with REST APIs and nothing else, it is better suited for Tempest itself. New tests should be added in their respective subdirectories. For example, tests that use the compute API live in whitebox_tempest_plugin/api/compute. Test code does not need unit tests, but helpers or utilities do. Unit tests live in whitebox_tempest_plugin/tests. Whitebox does not adhere to the Tempest plugin interface <https://docs.openstack.org/tempest/latest/plugin.html>. As mentioned, whitebox tests run one at a time, so it's safe for a test to modify the environment and/or be destructive, as long as it cleans up after itself. For example, changing Nova configuration values and/or restarting services is acceptable, as long as the original values and service state are restored.