summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Rosmaita <rosmaita.fossdev@gmail.com>2018-08-22 14:25:25 -0400
committerBrian Rosmaita <rosmaita.fossdev@gmail.com>2018-08-22 14:25:25 -0400
commit6ee51d2000ba8aee1c1f19e0cd000ff57858e78a (patch)
tree73bcfb7caec7ff56366a6eb283233d96915bc6fe
parent9657073262fd5ff264328312660ccbcfafba17cd (diff)
Add missing tests for 2.6 statuses
Two new statuses, 'importing' and 'uploading', were introduced in version 2.6 of the API. Update the controller tests that check the validity of location modifications for various image statuses to include tests for 'importing' and 'uploading'. Change-Id: I114ec6d7cfba6b918321ac7086b03955c266c770
Notes
Notes (review): Code-Review+1: Piotr Bielak <piotr.bielak@corp.ovh.com> Code-Review+2: Abhishek Kekane <akekane@redhat.com> Code-Review+2: Sean McGinnis <sean.mcginnis@gmail.com> Workflow+1: Sean McGinnis <sean.mcginnis@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 03 Oct 2018 12:51:33 +0000 Reviewed-on: https://review.openstack.org/595299 Project: openstack/glance Branch: refs/heads/master
-rw-r--r--glance/tests/unit/v2/test_images_resource.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/glance/tests/unit/v2/test_images_resource.py b/glance/tests/unit/v2/test_images_resource.py
index 83e2caf..5eb3841 100644
--- a/glance/tests/unit/v2/test_images_resource.py
+++ b/glance/tests/unit/v2/test_images_resource.py
@@ -1799,6 +1799,12 @@ class TestImagesController(base.IsolatedUnitTest):
1799 def test_location_add_not_permitted_status_killed(self): 1799 def test_location_add_not_permitted_status_killed(self):
1800 self._test_update_locations_status('killed', 'add') 1800 self._test_update_locations_status('killed', 'add')
1801 1801
1802 def test_location_add_not_permitted_status_importing(self):
1803 self._test_update_locations_status('importing', 'add')
1804
1805 def test_location_add_not_permitted_status_uploading(self):
1806 self._test_update_locations_status('uploading', 'add')
1807
1802 def test_location_remove_not_permitted_status_saving(self): 1808 def test_location_remove_not_permitted_status_saving(self):
1803 self._test_update_locations_status('saving', 'remove') 1809 self._test_update_locations_status('saving', 'remove')
1804 1810
@@ -1817,6 +1823,12 @@ class TestImagesController(base.IsolatedUnitTest):
1817 def test_location_remove_not_permitted_status_queued(self): 1823 def test_location_remove_not_permitted_status_queued(self):
1818 self._test_update_locations_status('queued', 'remove') 1824 self._test_update_locations_status('queued', 'remove')
1819 1825
1826 def test_location_remove_not_permitted_status_importing(self):
1827 self._test_update_locations_status('importing', 'remove')
1828
1829 def test_location_remove_not_permitted_status_uploading(self):
1830 self._test_update_locations_status('uploading', 'remove')
1831
1820 def test_location_replace_not_permitted_status_saving(self): 1832 def test_location_replace_not_permitted_status_saving(self):
1821 self._test_update_locations_status('saving', 'replace') 1833 self._test_update_locations_status('saving', 'replace')
1822 1834
@@ -1832,6 +1844,12 @@ class TestImagesController(base.IsolatedUnitTest):
1832 def test_location_replace_not_permitted_status_killed(self): 1844 def test_location_replace_not_permitted_status_killed(self):
1833 self._test_update_locations_status('killed', 'replace') 1845 self._test_update_locations_status('killed', 'replace')
1834 1846
1847 def test_location_replace_not_permitted_status_importing(self):
1848 self._test_update_locations_status('importing', 'replace')
1849
1850 def test_location_replace_not_permitted_status_uploading(self):
1851 self._test_update_locations_status('uploading', 'replace')
1852
1835 def test_update_add_locations_insertion(self): 1853 def test_update_add_locations_insertion(self):
1836 self.config(show_multiple_locations=True) 1854 self.config(show_multiple_locations=True)
1837 new_location = {'url': '%s/fake_location' % BASE_URI, 'metadata': {}} 1855 new_location = {'url': '%s/fake_location' % BASE_URI, 'metadata': {}}