introduction to tempest

13

Click here to load reader

Upload: openstackindia

Post on 08-May-2015

9.043 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Introduction to tempest

Introduction to Tempest

OpenStack Users January 2013 Meetup – India

Presenters: Nithya, Sarad & Suresh

Page 2: Introduction to tempest

Agenda

• Introduction To Tempest

• Explore Tempest

• Getting Started with Tempest in Openstack

• Role of Tempest in Openstack CI

• Pro’s & Con’s

• Q & A

Page 3: Introduction to tempest

What is tempest?

• Tempest – It’s an Openstack Integration test suite

• Based on unittest2 framework & currently uses Nosetest runner

• Used by community as gating on commits to trunk

• In a nutshell, all it does is run tests against OpenStack service endpoints by exercising API calls & validate the response

Page 4: Introduction to tempest

Tempest explored

Tempest

Nova

Glance

Swift

keystone

Quantum

Cinder

• Test Types – Smoke Tests – Positive Tests – Negative Tests – Stress Tests – White box Tests

• Tempest base – httplib2 – Rest based framework – Nose test runner

(testr)

Page 5: Introduction to tempest

Tempest Directory Structure • Common - Rest client & ssh client

• Services - services modules (nova, identity, image and network)

• Nova implements the OS Nova API

• Identity implements the OS Keystone API

• Image implements the OS Glance API

• Network implements the OS Quantum API

• Tests - Contains actual tests.

– Rely on the above services (via the Manager) to connect to the system.

– Test classes and methods have also access to the tempest configuration.

– Test classes must subclass unittest, and they may use nose and unittest specific decorators

• etc

– tempest.conf

Page 6: Introduction to tempest

Sample Test workflow

Test case call base class setup

Create server call

Servers_client (json/xml)

REST request

Rest_client

Config.py Openstack_manager.py

Page 7: Introduction to tempest

Supported Clients

•REST – Httplib •BOTO – ec2 •Novaclient •glance client •swift client •keystone client •SSH – Paramiko •Cloudfile •Quantum client

Page 8: Introduction to tempest

How to Contribute

• Prerequisites – Signup CLA – Launchpad account

• Upload your SSH keys to Launchpad • Gerrit imports your SSH keys from Launchpad • Subscribe to main openstack mailing list

– devstack installed locally • Follow the steps given in http://devstack.org/guides/single-

machine.html

• Code submission – Clone tempest code – Create a new tempest branch for the bug id – Make required changes – Commit the changes – Submit for review – For resubmitting the changes use commit amend

Page 9: Introduction to tempest

Continuous Integration Monitor version control system for changes. Whenever a change is

detected, automatically compile and test the application. Notify

developers when things go wrong to get a fix immediately.

Monitor version control system for changes. Whenever a change is

detected, automatically compile and test the application. Notify

developers when things go wrong to get a fix immediately.

Watch code

Build Product

Run Tests

Publish results

• CI Tool - Jenkins

• Openstack CI - https://jenkins.openstack.org/

• Gate tests – Tempest

Page 10: Introduction to tempest

Openstack CI & Tempest

Report success / failure at review.openstack.org

Run tempest tests

Checks out latest code and setup devstack

Jenkins prepares a Virtual Machine

Code approved by core reviewers

Change proposed to OS component

• https://review.openstack.org/#/c/17770/

• Tempest gated with – Gate-tempest-merge

– Gate-tempest-pep8

– Gate-tempest-devstack-vm

• https://jenkins.openstack.org/view/Gate/job/gate-tempest-devstack-vm/

Page 11: Introduction to tempest

Tempest Pros and Cons

Pro’s

• Modular

• One unified suite to test all openstack components.

• Easily Maintainable

• Less complex to create tests

• Supports most of the client interfaces

Con’s

• Currently tests are not running in parallel

• Only smoke tests are being run as part of gating process.

• Stress tests development at nascent state

• Tests for service workflows at the minimal

Page 12: Introduction to tempest

Q&A