From f667c0f2e37fde705e98214c1f0c790e63e47f2c Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Wed, 13 Apr 2016 11:27:16 +0100 Subject: [PATCH] Add a test for deleting pending zones Change-Id: I50eb1f87db90af00b3b3179c9e27a87cdf230a84 --- .../tests/scenario/v2/test_zones.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/designate_tempest_plugin/tests/scenario/v2/test_zones.py b/designate_tempest_plugin/tests/scenario/v2/test_zones.py index 5ba43f32..5c1e1dbd 100644 --- a/designate_tempest_plugin/tests/scenario/v2/test_zones.py +++ b/designate_tempest_plugin/tests/scenario/v2/test_zones.py @@ -56,3 +56,25 @@ class ZonesTest(base.BaseDnsTest): self.assertEqual('PENDING', zone['status']) waiters.wait_for_zone_404(self.client, zone['id']) + + @test.attr(type='slow') + @test.idempotent_id('c9838adf-14dc-4097-9130-e5cea3727abb') + def test_delete_zone_pending_create(self): + LOG.info('Create a zone') + _, zone = self.client.create_zone() + self.addCleanup(self.client.delete_zone, zone['id'], + ignore_errors=lib_exc.NotFound) + + # NOTE(kiall): This is certainly a little racey, it's entirely + # possible the zone will become active before we delete + # it. Worst case, that means we get an unexpected pass. + # Theres not a huge amount we can do, given this is + # back-box testing. + LOG.info('Delete the zone while it is still pending') + _, zone = self.client.delete_zone(zone['id']) + + LOG.info('Ensure we respond with DELETE+PENDING') + self.assertEqual('DELETE', zone['action']) + self.assertEqual('PENDING', zone['status']) + + waiters.wait_for_zone_404(self.client, zone['id'])