Append random int to new flavor name in QoSBandwidthAndPacketRateTests
In a couple of the tests a new flavor is created by appending the
string 'extra' to the existing flavor name. The existing flavor name is
however CONF.compute.flavor_ref, which isn't unique. If two tests that
create the flavor run at the same time, there will be a 409 collision
and one test will fail.
This appends a random int to the new flavor name to prevent conflicts.
Closes-Bug: #1959467
Change-Id: I9928e2be9c749f69eea9a9d4f9e8fe03ef4ef612
diff --git a/tempest/scenario/test_network_qos_placement.py b/tempest/scenario/test_network_qos_placement.py
index adb0ee3..cdc25dd 100644
--- a/tempest/scenario/test_network_qos_placement.py
+++ b/tempest/scenario/test_network_qos_placement.py
@@ -79,7 +79,7 @@
new_flavor = self.flavors_client.create_flavor(**{
'ram': old_flavor['ram'],
'vcpus': old_flavor['vcpus'],
- 'name': old_flavor['name'] + 'extra',
+ 'name': old_flavor['name'] + 'extra-' + data_utils.rand_int_id(),
'disk': old_flavor['disk'] + 1
})['flavor']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,