......Unfinished page, work in progress....... ......The howto only cover swift/keystone/s3 tests for now......

Testing a Openstack Installation with tempest on Debian GNU/Linux

Scope of this howto

This page explains how to test a Openstack Cluster installation on Debian

The Tempest tools will be used to test the installation and the stability of the cluster.

The s3-tests tools to test the s3 compatibility.

DOCUMENT CONVENTIONS

In formatted blocks :

Prerequise

Setup the dependencies:

# apt-get install -y git python-nose python-anyjson python-unittest2 python-lxml python-boto openstack-clients python-paramiko python-netifaces python-webob python-virtualenv python-dev libevent-dev python-sqlalchemy 

Prepare materials for Glance/Nova API

NB: we assume that Openstack environment variables (OS_USERNAME, OS_TENANT_NAME, OS_PASSWORD and OS_AUTH_URL) are set with a admin account.

# wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
# glance add name="cirrOS-0.3.0-x86_64" is_public=true container_format=bare disk_format=qcow2      distro="cirrOS-0.3.0-x86_64" < cirros-0.3.0-x86_64-disk.img

Prepare materials for EC2 API

mkdir /root/s3-materials
cd /root/s3-materials
wget "http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz"
tar -xzf cirros-0.3.0-x86_64-uec.tar.gz
#TODO: create all manifest.xml files

Create two users for tempest test:

# keystone role-list | grep Member
| 543e2282e9044246887c4726af65794b | Member |

# keystone tenant-create --name demo | awk '/id/{print $4}'
2c5beb41f0184cd8a7bf39fb6dfe56be

# keystone user-create --name demo --pass pass --email demo@demo.com --tenant-id 2c5beb41f0184cd8a7bf39fb6dfe56be | awk '/id/{print $4}'
ea80cb1a216c44f1845e6fe9d1025ac2

keystone user-role-add --user-id ea80cb1a216c44f1845e6fe9d1025ac2 --role-id 543e2282e9044246887c4726af65794b --tenant-id 2c5beb41f0184cd8a7bf39fb6dfe56be

# keystone --os-username demo --os-password pass --os-tenant-name demo --os-auth-url http://identity.mystack.net:5000/v2.0/ ec2-credentials-create | grep -e access -e secret -e user_id
|   access  | fd158f8c4841411f8ec0b1500b8c3c16 |
|   secret  | e6563c4efcc14c418f20262e92e8bfa9 |
|  user_id  | ea80cb1a216c44f1845e6fe9d1025ac2 |

# keystone tenant-create --name alt-demo | awk '/id/{print $4}'
541fef9a6a364b05b0bd37c0a2219504

# keystone user-create --name alt-demo --pass pass --email alt-demo@demo.com --tenant-id 541fef9a6a364b05b0bd37c0a2219504
bfe2b7da10034329b04caef5d12345a8

# keystone --os-username alt-demo --os-password pass --os-tenant-name alt-demo --os-auth-url http://identity.mystack.net:5000/v2.0/ ec2-credentials-create | grep -e access -e secret -e user_id
|   access  | ed1adcfcc7994445a290ac1c8ab13621 |
|   secret  | 066b237eabe946d2a1c83f1ff61aaccb |
|  user_id  | bfe2b7da10034329b04caef5d12345a8 |

# keystone user-role-add --user-id bfe2b7da10034329b04caef5d12345a8 --role-id 543e2282e9044246887c4726af65794b --tenant-id 541fef9a6a364b05b0bd37c0a2219504

All ids generated here will be used in tempest and s3tests configuration.

Tempest Installation/Configuration

Clone the git repository

# git clone https://github.com/openstack/tempest.git

Prepare the configuration file

cp /root/tempest/etc/tempest.conf.sample /root/tempest/etc/tempest.conf

Edit the following fields in /root/tempest/etc/tempest.conf, and replace <VALUE> by the value that match your configuration.

nb: identity/host define field "host" in section "[identity"]

identity/host = <KEYSTONE_HOST>
identity/port = <KEYSTONE_PORT>
identity-admin/username = admin
identify-admin/password = <THE_ADMIN_PASSWORD>
identity-admin/tenant_name = <THE_ADMIN_TENANT>

compute-admin/username = admin
compute-admin/password = <THE_ADMIN_PASSWORD>
compute-admin/tenant_name = <THE_ADMIN_TENANT>
compute/image_ref = <ID_OF_THE_PREVIOUSLY_CREATED_GLANCE_IMAGE>
compute/image_ref_alt = <ID_OF_THE_PREVIOUSLY_CREATED_GLANCE_IMAGE>
compute/whitebox_enabled = false       # this disable tests inside VM
compute/resize_available = false       # disable it only if your cluster don't support resize

image/host = <GLANCE_HOST>
image/host = <GLANCE_PORT>

boto/ec2_url = <URL_OF_THE_EC2_API>    # ie: http://identity.mystack.net:8773/services/Cloud
boto/s3_url = <URL_OF_THE_S3_API>      # ie: http://storage.mystack.net:8080
boto/aws_access = fd158f8c4841411f8ec0b1500b8c3c16  # access_key for the demo account
boto/aws_secret = e6563c4efcc14c418f20262e92e8bfa9  # secret_key for the demo account
boto/s3_materials_path = /root/s3-materials

Tempest run

Go in the tempest directory

cd /root/tempest

Run all tests with:

nosetests tempest/tests/

Or only some of them with:

For keystone:

# nosetests tempest/tests/identity
...
----------------------------------------------------------------------
Ran 147 tests in 18.202s

OK (SKIP=13)

For swift:

nosetests tempest/tests/object_storage
...

----------------------------------------------------------------------
Ran 17 tests in 2.389s

OK

s3tests Installation/Configuration

Clone the git repository

git clone  https://github.com/ceph/s3-tests.git

Create the configuration file /root/s3-tests/s3.conf and replace all ids by the one generated previously:

[DEFAULT]
## this section is just used as default for all the "s3 *"
## sections, you can place these variables also directly there

## replace with e.g. "localhost" to run against local software
host = storage.mystack.net
port = 8080

## say "no" to disable TLS
is_secure = no

[fixtures]
## all the buckets created will start with this prefix;
## {random} will be filled with random characters to pad
## the prefix to 30 characters long, and avoid collisions
bucket prefix = s3test-{random}-

[s3 main]
## the tests assume two accounts are defined, "main" and "alt".

## user_id is a 64-character hexstring
user_id = ea80cb1a216c44f1845e6fe9d1025ac2

## display name typically looks more like a unix login, "jdoe" etc
display_name = demo

## replace these with your access keys
access_key = fd158f8c4841411f8ec0b1500b8c3c16
secret_key = e6563c4efcc14c418f20262e92e8bfa9

[s3 alt]
## another user account, used for ACL-related tests
user_id = bfe2b7da10034329b04caef5d12345a8
display_name = alt-demo
email = alt-demo@demo.com
access_key = ed1adcfcc7994445a290ac1c8ab13621
secret_key = 066b237eabe946d2a1c83f1ff61aaccb

s3tests run

# cd s3-tests
# S3TEST_CONF=s3.conf ./virtualenv/bin/nosetests
...

----------------------------------------------------------------------
Ran 256 tests in 477.413s

FAILED (errors=40, failures=50)

This result come from a Folsom Openstack Cluster, all S3 tests did not work correctly yet.

Some link to follow the API compatibility progress:

https://github.com/fujita/swift3/issues/3

https://docs.google.com/spreadsheet/ccc?key=0ArysOOuLgF_PdFlnSnA2bEtXMVFQSVNwUVZxNFNTaXc#gid=0

http://wiki.openstack.org/Swift/APIFeatureComparison, http://wiki.openstack.org/Nova/APIFeatureComparison