From Fedora Project Wiki

Revision as of 14:20, 8 March 2012 by Derekh (talk | contribs)

Description

Run Tempest test cases.

Setup

Assumes keystone, nova and glance are already configured and running.

Ensure nova is configured to allow resizing of instances on a single host:

$> echo 'allow_resize_to_same_host = True' | sudo tee -a /etc/nova/nova.conf 
$> for svc in api compute scheduler; do sudo systemctl restart openstack-nova-$svc.service; done

Install test dependencies:

$> sudo yum install -y python-nose python-unittest2

Create a temporary directory to work from:

$> mkdir /tmp/tempest
$> cd /tmp/tempest

Upload some test images:

 $> wget http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz
 $> gunzip cirros-0.3.0-x86_64-uec.tar.gz 
 $> tar xvf cirros-0.3.0-x86_64-uec.tar 
 $> KERNEL_ID=$(glance add name=cirros-0.3.0-x86_64-kernel is_public=true container_format=aki disk_format=aki --silent-upload \
      < cirros-0.3.0-x86_64-vmlinuz | cut -f2 -d:) 
 $> RAMDISK_ID=$(glance add name=cirros-0.3.0-x86_64-ramdisk is_public=true container_format=ari disk_format=ari --silent-upload \
      < cirros-0.3.0-x86_64-initrd | cut -f2 -d:)
 $> IMAGE_ID=$(glance add name=cirros-0.3.0-x86_64 is_public=true container_format=ami disk_format=ami "kernel_id=$KERNEL_ID" \
      "ramdisk_id=$RAMDISK_ID" --silent-upload < <(zcat --force cirros-0.3.0-x86_64-blank.img) | cut -f2 -d:)

Clone the Tempest repo:

$> git clone https://github.com/openstack/tempest.git
$> cd tempest

Create tempest config:

$> cd etc
$> wget https://s3.amazonaws.com/openstack-tempest/config.ini
$> wget https://s3.amazonaws.com/openstack-tempest/tempest.conf
$> sed -i "s/%IMAGE_ID%/$IMAGE_ID/" tempest.conf
$> cd .. 

How to test

Run Tempest tests with nose:

$> nosetests tempest

Expected Results

The time taken to run the testsuite is quite variable, and ranges from ~20 minutes on an EC2 large instance to circa twice that on a VM with 2Gb RAM and 2 CPUs running on a moderately powered laptop.

The majority of the tests should pass, though you may hit some failures due to timeout or resource starvation (for example breaching the floating IPs quota).