From Fedora Project Wiki

No edit summary
No edit summary
Line 20: Line 20:


Upload some test images:
Upload some test images:
<pre>
  $> wget http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz
  $> 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  
  $> gunzip cirros-0.3.0-x86_64-uec.tar.gz  
  $> tar xvf cirros-0.3.0-x86_64-uec.tar  
  $> 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:)  
  $> KERNEL_ID=$(glance add name=cirros-0.3.0-x86_64-kernel is_public=true container_format=aki disk_format=aki --silent-upload \
  $> 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:)
      < cirros-0.3.0-x86_64-vmlinuz | 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))
  $> 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))
</pre>


Clone the Tempest repo:
Clone the Tempest repo:

Revision as of 15:21, 7 March 2012

Description

Run Tempest test cases.

Setup

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

How to test

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

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

Ensure SELinux enforcement is disabled:

$> sudo setenforce 0
$> sudo sed -i 's/^SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config

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))

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 ..

Run Tempest tests:

$> 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).