From 7c2143d53e16f57ba5cb9f73fc5a0f47aa49edf9 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Thu, 7 Mar 2019 18:07:37 +0100 Subject: [PATCH] Allocation API: use generate_uuid for random resource classes We see clashes with using random numbers, switch to UUIDs instead. Change-Id: I8a529bcfd319a7f0edbdd45727cef7efe6f2f8cb --- ironic_tempest_plugin/tests/api/admin/test_allocations.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ironic_tempest_plugin/tests/api/admin/test_allocations.py b/ironic_tempest_plugin/tests/api/admin/test_allocations.py index 4e48374..a6e8e9c 100644 --- a/ironic_tempest_plugin/tests/api/admin/test_allocations.py +++ b/ironic_tempest_plugin/tests/api/admin/test_allocations.py @@ -10,8 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -import random - +from oslo_utils import uuidutils from tempest import config from tempest.lib import decorators from tempest.lib import exceptions as lib_exc @@ -37,7 +36,7 @@ class TestAllocations(base.BaseBaremetalTest): # Generate a resource class to prevent parallel tests from clashing # with each other. - self.resource_class = 'x-small-%d' % random.randrange(1024) + self.resource_class = uuidutils.generate_uuid() _, self.chassis = self.create_chassis() _, self.node = self.create_node(self.chassis['uuid'],