Running Keystone Unit Tests against older Versions of RDO Etc

Just because upstrem is no longer supporting Essix doesn’t mean that someone out there is not running it. So, if you need to back port a patch, you might find yourself in the position of having to run unit tests against an older version of Keystone (or other) that does not run cleanly against the files installed by tox. For example, I tried running against an Icehouse era checkout and got a slew of errors like this:

AssertionError: Environmental variable PATH_INFO is not a string: (value: u’/v2.0/tokens/e6aed0a188f1402d9ad3586bc0e35758/endpoints’)

The basic steps are:

  1. Install the packages for the version closest to the one you want to test
  2. checkout your source from git and apply your patch
  3. install any extra rpms required to run the tests
  4. run the test using python -m unittest $TESTNAME

For RDO, the main RPMS can be installed from :

https://repos.fedorapeople.org/repos/openstack/

You might need additional RPMS as packaged in EPEL. You don’t however, need to use an installer, you can use yum to install just the Keystone package.

The Dependencies are a little tricky to solve. Tox uses the test-requirements.txt file in the Keystone repo to install, but thes names do not match up with the package names. Often the RPM will be the name of the python package with the “python-” prefix.

Not all of the dependencies are in Fedora, RDO, or EPEL. Many were built just for CI, and are in https://copr.fedorainfracloud.org/coprs/abregman/.

For later releases, you can check out the jobs running in : https://ci.centos.org/view/rdo/view/promotion-pipeline/ and fetch the set of packages in “all_rpms.txt” but be aware that these are not the set of packages for unit tests. You might need more.

Not every package can be installed this way. For example, pyton-pysaml2 requires a bunch of additional RPMS that I had trouble pulling in. These can still be installed via pip.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.