kingbird/tempest
Ashish Singh d528d6d429 Add remaining tempest testcase for Kingbird
Added test case for quota sync which creates a VM in one
region, calls quota sync, wait for quota sync to finish,
calculated new limits manually and assert these limits with
updated nova limits.

Added test case to test quota exceeded scenario. Sets quota limit
to some small value, call quota sync, try to create more
than quota limit VMs. Then assert for Quota exceeded
exception for the second VM.

Delete all the created resources such as Project, User, VMs,
Flavor, Subnet and Network in resouce clean.

This should wind up our quota sync for nova resources.

Change-Id: Ib5e1a5873219c702d27ac07de81477aafb45d923
2016-04-15 17:16:27 +05:30
..
tests Add remaining tempest testcase for Kingbird 2016-04-15 17:16:27 +05:30
__init__.py Change "kingbird_tempest_tests" folder to "tempest" 2016-04-12 15:43:01 +08:00
plugin.py Change "kingbird_tempest_tests" folder to "tempest" 2016-04-12 15:43:01 +08:00
README.rst Add remaining tempest testcase for Kingbird 2016-04-15 17:16:27 +05:30

Tempest Integration of Kingbird

This directory contains Tempest tests to cover the kingbird project.

Before running Tempest test cases, Do the following

  1. Clone tempest code from git::

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

  2. Make below changes in tempest/config.py
  1. Add kingbird configurations to config file:

    kingbird_group = cfg.OptGroup(name='kingbird',
                            title="Options for kingbird configurations")
    
    KingbirdGroup = [
        cfg.StrOpt('endpoint_type',
                   default='publicURL',
                   help="Endpoint type of Kingbird service."),
        cfg.IntOpt('TIME_TO_SYNC',
                   default=30),
                   help="Maximum time to wait for a sync call to complete."),
        cfg.StrOpt('endpoint_url',
                   help="Endpoint URL of Kingbird service."),
        cfg.StrOpt('api_version',
                   default='v1.0',
                   help="Api version of Kingbird service.")
    ]
  2. Add kingbird service to ServiceAvailableGroup as below:: cfg.BoolOpt('kingbird', default=False, help="Whether or not kingbird is expected to be available"),

  3. Add kingbird_group and KingbirdGroup to list of opts(_opts)

  1. Generate config file::

    $ tox -e genconfig

    It generates etc/tempest.conf.sample. Copy it to /etc/tempest/ and rename as tempest.conf

  2. Make sure the default values represented by DEFAULT_QUOTAS in tempest/api/kingbird/base.py has to be same as kingbird_global_limit section in kingbird.conf.

  3. Copy tempest testcases for Kingbird:

    $ cp -r tempest/tests/api/kingbird <tempest root directory>/tempest/api/
    $ cp tempest/tests/common/kingbird.py <tempest root directory>/tempest/common/
  4. Set kingbird = True under [service_available] section in tempest.conf:

To list all Kingbird tempest cases, go to tempest directory, then run:

$ testr list-tests kingbird
To run kingbird tempest with nosetests, go to tempest directory, then run::

$ nosetests -sv tempest/api/kingbird/test_kingbird_api.py

To run kingbird tempest plugin tests using tox, go to tempest directory, then run:

$ tox -eall-plugin kingbird

To run a specific test:

$ tox -eall-plugin tempest.api.kingbird.test_kingbird_api.KingbirdTestJSON.test_kingbird_delete_all_method

To run tempest with run_test, go to tempest directory, then run:

$ ./run_tempest.sh -N -- kingbird

To run a single test case, go to tempest directory, then run with test case name, e.g.:

$ ./run_tempest.sh -N -- tempest.api.kingbird.test_kingbird_api.KingbirdTestJSON.test_kingbird_delete_all_method