summaryrefslogtreecommitdiff
path: root/designate/tests/test_central/test_service.py
diff options
context:
space:
mode:
Diffstat (limited to 'designate/tests/test_central/test_service.py')
-rw-r--r--designate/tests/test_central/test_service.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/designate/tests/test_central/test_service.py b/designate/tests/test_central/test_service.py
index 6961e3dd..4674242e 100644
--- a/designate/tests/test_central/test_service.py
+++ b/designate/tests/test_central/test_service.py
@@ -15,10 +15,12 @@
# License for the specific language governing permissions and limitations
# under the License.
-import datetime
+from collections import namedtuple
+from concurrent import futures
import copy
+import datetime
+import futurist
import random
-from collections import namedtuple
from unittest import mock
import testtools
@@ -2586,6 +2588,28 @@ class CentralServiceTest(CentralTestCase):
self.assertIsNone(fip_ptr['description'])
self.assertIsNotNone(fip_ptr['ttl'])
+ def test_set_floatingip_multiple_requests(self):
+ context = self.get_context()
+
+ def update_floatingip(fixture):
+ fip = self.network_api.fake.allocate_floatingip(context.project_id)
+ return self.central_service.update_floatingip(
+ context, fip['region'], fip['id'], fixture
+ )
+
+ with futurist.GreenThreadPoolExecutor() as executor:
+ results = []
+ for fixture in [0, 2, 3, 4, 5]:
+ results.append(executor.submit(
+ update_floatingip, fixture=self.get_ptr_fixture(fixture)
+ ))
+ for future in futures.as_completed(results):
+ self.assertTrue(future.result())
+
+ fips = self.central_service.list_floatingips(context)
+
+ self.assertEqual(5, len(fips))
+
def test_set_floatingip_no_managed_resource_tenant_id(self):
context = self.get_context(project_id='a')