Running functional test against an OpenStack Swift cluster deployed with TripleO

To run the upstream Swift functional tests against a Swift cluster deployed with TripleO, follow the steps below:

Setup necessary keystone users

Initially the admin user is already setup, the functional tests requires two mores users: one user on the same account (project) as the admin user, but with a user role and another user in different account, but with admin role. Did that confuse you yet? this should help:

From the undercloud, run:

  1. source overcloudrc
  2. openstack project create --description "Bob Project" bob
  3. openstack user create --password bobpwd bob
  4. openstack role add --project bob --user bob admin
  5. openstack role create user
  6. openstack user create --password jimpwd jim
  7. openstack role add --project admin --user jim user

Configure Swift to run functional tests

Now you will need to checkout the Swift source code (you will noticed that I also checkout a stable branch, so make sure to checkout the correct code for your use-case) and configure the functional test configuration file to target the overcloud deployment.

From the undercloud, run:

  1. git clone https://github.com/openstack/swift.git
  2. git checkout -b newton origin/stable/newton
  3. cd swift
  4. cp test/sample.conf test.conf
  5. export SWIFT_TEST_CONFIG_FILE=/home/stack/swift/test.conf

Now let’s modify test.conf to add the keystone user information, open test.conf with your favorite editor and edit the information like below:

## sample config for Swift with Keystone v2 API
# For keystone v2 change auth_version to 2 and auth_prefix to /v2.0/
# And "allow_account_management" should not be set "true"
auth_version = 2
auth_host =
auth_port = 5000
auth_ssl = no
auth_prefix = /v2.0/

# Primary functional test account (needs admin access to the account)
account = admin
username = admin
password =

# User on a second account (needs admin access to the account)
account2 = bob
username2 = bob
password2 = bobpwd

# User on same account as first, but without admin access
username3 = jim
password3 = jimpwd

All set! now you should be able to run the Swift functional tests:

  1. cd ~/swift
  2. ./.functest

Leave a comment