unify instance name generation

Registered by xiaohanyu

Currently, tempest has a util function tempest.common.util.data_utils.rand_name function, which is used to generate a random server name for testing instance, this name usually begins with a prefix, and then followed by a random number.

The problem is, some test case use the class name as the prefix, while others use customized name as the prefix.

This raises inconsistency, for example, code in test_multiple_create.py:

----
class MultipleCreateTestJSON(base.BaseComputeTest):
    _interface = 'json'
    _name = 'multiple-create-test'

....

    def _generate_name(self):
        return rand_name(self._name)
----

while code in test_security_group_rules.py:
----
    @attr(type=['positive', 'gate'])
    def test_security_group_rules_create(self):
        # positive test: creation of security group rule
        # should be successfull
        #creating a security group to add rules to it
        s_name = rand_name('securitygroup-')
        s_description = rand_name('description-')
        resp, securitygroup = \
 ----

We need a unified server name generation method, and I suggest using the TestCase class name as the prefix.

sdague: this isn't a blueprint, please just handle this as a bug

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
xiaohanyu
Direction:
Needs approval
Assignee:
xiaohanyu
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Sean Dague

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.