Kolla project provides a docker container image for Tempest.
The provided container image is available in two formats for centos: centos-binary-tempest and centos-binary-source.
The RDO community rebuilds the container image in centos-binary format and pushes it to https://registry.rdoproject.org and to docker.io/tripleomaster.
The Tempest container image contains openstack-tempest and all available Tempest plugins in it.
The benefit of running Tempest tests from Tempest container is that, we do not need to install any Tempest package or Tempest plugin on the deployed cloud and keep the environment safe from dependency mismatch and updates.
In TripleO CI, we run Tempest tests using Tempest container images in tripleo-ci-centos-7-undercloud-containers job using featureset027 set.
We can consume the same image for running Tempest tests locally in TripleO deployment:
-
Follow this link for installing containerized undercloud.
Note: At step 5 in the above link, open undercloud.conf in an editor and set
enable_tempest = true
.It will pull the tempest container image on the undercloud.
-
If tempest container is not available on the undercloud, we pull the image from Dockerhub.
$ sudo docker pull docker.io/tripleomaster/centos-binary-tempest
-
Create two directories: container_tempest and tempest_workspace and copy stackrc, overcloudrc, tempest-deployer-input.conf, whitelist and blacklist related files to container_tempest. These files should be copied from undercloud to the container. Below commands do the same:
$ mkdir container_tempest tempest_workspace
$ cp stackrc overcloudrc tempest-deployer-input.conf whitelist.txt blacklist.txt container_tempest
-
Creating alias for running tempest within a container and with mounted container_tempest:/home/stack and tempest:/home/stack
$ alias docker-tempest="sudo docker run -i \
-v container_tempest:/home/stack \
-v tempest:/home/stack \
docker.io/tripleomaster/centos-binary-tempest \
/usr/bin/bash" -
Create tempest workspace using docker-tempest alias
$ docker-tempest tempest init /home/stack/tempest
-
List tempest plugins installed within tempest container
$ docker-tempest tempest list-plugins
-
Generate tempest.conf using discover-tempest-config
Note: If tempest tests are running against undercloud then:
$ source stackrc
$ export OS_AUTH_URL="$OS_AUTH_URL/v$OS_IDENTITY_API_VERSION"
$ docker-tempest discover-tempest-config --create \
--out /home/stack/tempest/etc/tempest.confNote: If tempest tests are running against overcloud then:
$ source overcloudrc
$ docker-tempest discover-tempest-config --create \
--out /home/stack/tempest/etc/tempest.conf \
--deployer-input /home/stack/tempest-deployer-input.conf -
Running tempest tests
$ docker-tempest tempest run --workspace tempest \
-c /home/stack/tempest/etc/tempest.conf \
-r <tempest test regex> --subunitIn the above command:
--workspace
: To use tempest workspace-c
: Use the tempest.conf file-r
: To run tempest tests--subunit
: to generate tempest tests results subunit stream in v2 format
Once tests are finished, we can find the test output in /home/stack/tempest folder.
Thanks to Kolla team, Emilien, Wes, Arx, Martin, Luigi, Andrea, Ghanshyam, Alex, Sagi, Gabriel and RDO team for helping me in getting things in place.
Happy Hacking!