tempest custom test

asked 2014-11-05 05:39:42 -0600

zohaib gravatar image

i want to write customs test or test for new services added how can i write these tests

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-11-26 07:42:52 -0600

Its relatively easy to add custom tests.

What kind of tests do you want to add? I will give u a small tutorial for cli based tests.

  1. Head over to ur tempest folder -->

tempest/cli/simple_read_only/identity and open up test_keystone.py and copy a few lines that import functions

  import re
    from tempest import cli
    from tempest import config
    from tempest import exceptions
    from tempest.openstack.common import log as logging
    CONF = config.CONF
    LOG = logging.getLogger(__name__)
    class SimpleReadOnlyKeystoneClientTest(cli.ClientTestBase):

Now you can begin writing under this with your test steps

>     @test.attr(type='smoke')
>         def test01_get_token(self):
>         self.keystone('token-get')

     @test.attr(type='smoke')
         def test02_user_create(self):
         self.keystone('user-create --name sandeep --pass sandeep')

Now this will create a user called sandeep with password sandeep.

Name this test as

test_id.py

head over to your openstack dashboard and source admin.rc file so that env variables are set

go to the folder

tempest/cli/simple_read_only/identity

And run

Nosetests -v test_id.py

Tempest should start giving you results in this case you will get 2 results either OK or FAIL

Let me know if you need anything else.

Thanks mav3r1cksandy

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-11-05 05:39:42 -0600

Seen: 215 times

Last updated: Nov 26 '14