diff --git a/doc/api_samples/os-admin-actions/admin-actions-lock-server.json b/doc/api_samples/os-admin-actions/admin-actions-lock-server.json deleted file mode 100644 index d7e96964ef23..000000000000 --- a/doc/api_samples/os-admin-actions/admin-actions-lock-server.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "lock": null -} \ No newline at end of file diff --git a/doc/api_samples/os-admin-actions/admin-actions-pause.json b/doc/api_samples/os-admin-actions/admin-actions-pause.json deleted file mode 100644 index c44ca70599da..000000000000 --- a/doc/api_samples/os-admin-actions/admin-actions-pause.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "pause": null -} \ No newline at end of file diff --git a/doc/api_samples/os-admin-actions/admin-actions-unlock-server.json b/doc/api_samples/os-admin-actions/admin-actions-unlock-server.json deleted file mode 100644 index 0eba7e725291..000000000000 --- a/doc/api_samples/os-admin-actions/admin-actions-unlock-server.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "unlock": null -} \ No newline at end of file diff --git a/doc/api_samples/os-admin-actions/admin-actions-unlock.json b/doc/api_samples/os-admin-actions/admin-actions-unlock.json deleted file mode 100644 index 9e905ca2b99e..000000000000 --- a/doc/api_samples/os-admin-actions/admin-actions-unlock.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "unlock": null -} diff --git a/doc/api_samples/os-admin-actions/admin-actions-unpause.json b/doc/api_samples/os-admin-actions/admin-actions-unpause.json deleted file mode 100644 index fdc0c410c3d5..000000000000 --- a/doc/api_samples/os-admin-actions/admin-actions-unpause.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "unpause": null -} \ No newline at end of file diff --git a/nova/tests/functional/api_samples/os-admin-actions/admin-actions-lock-server.json.tpl b/nova/tests/functional/api_samples/os-admin-actions/admin-actions-lock-server.json.tpl deleted file mode 100644 index a1863f2f3914..000000000000 --- a/nova/tests/functional/api_samples/os-admin-actions/admin-actions-lock-server.json.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{ - "lock": null -} diff --git a/nova/tests/functional/api_samples/os-admin-actions/admin-actions-pause.json.tpl b/nova/tests/functional/api_samples/os-admin-actions/admin-actions-pause.json.tpl deleted file mode 100644 index 2e7c1fad307f..000000000000 --- a/nova/tests/functional/api_samples/os-admin-actions/admin-actions-pause.json.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{ - "pause": null -} diff --git a/nova/tests/functional/api_samples/os-admin-actions/admin-actions-unlock-server.json.tpl b/nova/tests/functional/api_samples/os-admin-actions/admin-actions-unlock-server.json.tpl deleted file mode 100644 index 9e905ca2b99e..000000000000 --- a/nova/tests/functional/api_samples/os-admin-actions/admin-actions-unlock-server.json.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{ - "unlock": null -} diff --git a/nova/tests/functional/api_samples/os-admin-actions/admin-actions-unpause.json.tpl b/nova/tests/functional/api_samples/os-admin-actions/admin-actions-unpause.json.tpl deleted file mode 100644 index ce5024f0c92a..000000000000 --- a/nova/tests/functional/api_samples/os-admin-actions/admin-actions-unpause.json.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{ - "unpause": null -} diff --git a/nova/tests/functional/test_api_samples.py b/nova/tests/functional/test_api_samples.py index 16e6f6a4c4ab..ab4d4422cdfc 100644 --- a/nova/tests/functional/test_api_samples.py +++ b/nova/tests/functional/test_api_samples.py @@ -875,19 +875,6 @@ class AdminActionsSamplesJsonTest(ServersSampleBase): super(AdminActionsSamplesJsonTest, self).setUp() self.uuid = self._post_server() - def test_post_pause(self): - # Get api samples to pause server request. - response = self._do_post('servers/%s/action' % self.uuid, - 'admin-actions-pause', {}) - self.assertEqual(response.status_code, 202) - - def test_post_unpause(self): - # Get api samples to unpause server request. - self.test_post_pause() - response = self._do_post('servers/%s/action' % self.uuid, - 'admin-actions-unpause', {}) - self.assertEqual(response.status_code, 202) - @mock.patch('nova.conductor.manager.ComputeTaskManager._cold_migrate') def test_post_migrate(self, mock_cold_migrate): # Get api samples to migrate server request. @@ -907,19 +894,6 @@ class AdminActionsSamplesJsonTest(ServersSampleBase): 'admin-actions-inject-network-info', {}) self.assertEqual(response.status_code, 202) - def test_post_lock_server(self): - # Get api samples to lock server request. - response = self._do_post('servers/%s/action' % self.uuid, - 'admin-actions-lock-server', {}) - self.assertEqual(response.status_code, 202) - - def test_post_unlock_server(self): - # Get api samples to unlock server request. - self.test_post_lock_server() - response = self._do_post('servers/%s/action' % self.uuid, - 'admin-actions-unlock-server', {}) - self.assertEqual(response.status_code, 202) - def test_post_live_migrate_server(self): # Get api samples to server live migrate request. def fake_live_migrate(_self, context, instance, scheduler_hint, diff --git a/nova/tests/functional/v3/test_lock_server.py b/nova/tests/functional/v3/test_lock_server.py index 7baa68250110..bbd72f8a83ac 100644 --- a/nova/tests/functional/v3/test_lock_server.py +++ b/nova/tests/functional/v3/test_lock_server.py @@ -13,11 +13,26 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_config import cfg + from nova.tests.functional.v3 import test_servers +CONF = cfg.CONF +CONF.import_opt('osapi_compute_extension', + 'nova.api.openstack.compute.extensions') + class LockServerSamplesJsonTest(test_servers.ServersSampleBase): extension_name = "os-lock-server" + extra_extensions_to_load = ["os-access-ips"] + _api_version = 'v2' + + def _get_flags(self): + f = super(LockServerSamplesJsonTest, self)._get_flags() + f['osapi_compute_extension'] = CONF.osapi_compute_extension[:] + f['osapi_compute_extension'].append( + 'nova.api.openstack.compute.contrib.admin_actions.Admin_actions') + return f def setUp(self): """setUp Method for LockServer api samples extension diff --git a/nova/tests/functional/v3/test_pause_server.py b/nova/tests/functional/v3/test_pause_server.py index 94228573c426..f0aad8fa0443 100644 --- a/nova/tests/functional/v3/test_pause_server.py +++ b/nova/tests/functional/v3/test_pause_server.py @@ -13,11 +13,26 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_config import cfg + from nova.tests.functional.v3 import test_servers +CONF = cfg.CONF +CONF.import_opt('osapi_compute_extension', + 'nova.api.openstack.compute.extensions') + class PauseServerSamplesJsonTest(test_servers.ServersSampleBase): extension_name = "os-pause-server" + extra_extensions_to_load = ["os-access-ips"] + _api_version = 'v2' + + def _get_flags(self): + f = super(PauseServerSamplesJsonTest, self)._get_flags() + f['osapi_compute_extension'] = CONF.osapi_compute_extension[:] + f['osapi_compute_extension'].append( + 'nova.api.openstack.compute.contrib.admin_actions.Admin_actions') + return f def setUp(self): """setUp Method for PauseServer api samples extension