Custom Search

Monday, February 24, 2014

How to Test OpenStack Deployment With Tempest - API Tests - Identity - Image - Compute

How to Manually Install OpenStack Tempest
============================
http://fosshelp.blogspot.com/2014/02/how-to-manually-install-openstack.html


Identity API Tests
#############


1)

#nosetests -vx tempest.api.identity.admin.v3.test_users.py

2)
Minimum Config
Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
password=openstack
admin_password=openstack


3)
(Working)
a)V3

#nosetests -vx tempest.api.identity.admin.v3.test_users.py
#nosetests -vx tempest.api.identity.admin.v3.test_users:UsersV3TestJSON
#nosetests -vx tempest.api.identity.admin.v3.test_users:UsersV3TestJSON.test_list_user_projects

OR
testr run --parallel tempest.api.identity.admin.v3.test_users
testr run tempest.api.identity.admin.v3.test_users




b)V2
#nosetests -vx tempest.api.identity.admin.test_users.py
#nosetests -vx tempest.api.identity.admin.test_users:UsersTestJSON
#nosetests -vx tempest.api.identity.admin.test_users:UsersTestJSON.test_create_user


Image API Tests
###########


1)
#nosetests -vx tempest.api.identity.admin.v3.test_users.py

2)
Minimum Config
Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
password=openstack
admin_password=openstack


3)
(Working)
#nosetests -vx tempest.api.image.v2.test_images
#nosetests -vx tempest.api.image.v1.test_images

OR
#testr run --parallel tempest.api.image.v2.test_images
#testr run tempest.api.image.v2.test_images

Compute API Tests
#############


1)
Minimum Config
Comment all other config under the "[identity]" section and use default value for that.
#sudo vim /etc/tempest/tempest.conf
[identity]
uri=http://127.0.0.1:5000/v2.0/
password=openstack
admin_password=openstack


2)
#nosetests -vx tempest.api.compute.keypairs.test_keypairs

3)
  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1648, in __getattr__
    raise NoSuchOptError(name)
NoSuchOptError: no such option: IMAGE_ID

  File "/home/saju/tempest_test/tempest/.venv/local/lib/python2.7/site-packages/oslo/config/cfg.py", line 1648, in __getattr__
    raise NoSuchOptError(name)
NoSuchOptError: no such option: IMAGE_ID_ALT

=============Solution/Fix================



a)
Find Image_id
Goto devstack folder
#cd devstack
#source eucarc
or
#source openrc

Run following command and copy the ID.

#nova image-list
 

b)
Edit  /etc/tempest/tempest.conf
#sudo vim /etc/tempest/tempest.conf
[compute]
image_ref=09e3a9eb-c786-4687-a0e8-0c44b22f5539
image_ref_alt=09e3a9eb-c786-4687-a0e8-0c44b22f5539


4)
Working
#nosetests -vx tempest.api.compute.keypairs.test_keypairs

5)
admin
#nosetests -vx tempest.api.compute.admin.test_flavors

6)
  File "/home/saju/tempest_test/tempest/tempest/common/rest_client.py", line 199, in keystone_auth
    tenant=tenant_name)
AuthenticationFailure: Authentication with user admin and password pass failed auth using tenant admin.

=============Solution/Fix================

#sudo vim /etc/tempest/tempest.conf
[compute-admin]
password=openstack


7)
Working
admin

#nosetests -vx tempest.api.compute.admin.test_flavors
#nosetests -vx tempest.api.compute.admin.test_flavors:FlavorsAdminTestJSON
#nosetests -vx tempest.api.compute.admin.test_flavors:FlavorsAdminTestJSON.test_create_flavor


8)
Examples
#nosetests -vx tempest.api.compute.images.test_images
#testr run --parallel tempest.api.compute.images.test_images
#testr run tempest.api.compute.images.test_images


=====
Note:
-vxl 
x ---> Stop running tests after the first error or failure
l ---> Run test in Debug mode: So we can see better error message

No comments:

Post a Comment