Ask Your Question

tempest custom test

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

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

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

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

         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

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

go to the folder


And run

Nosetests -v

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


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

Seen: 231 times

Last updated: Nov 26 '14