diff --git a/doc/api_samples/os-admin-actions/admin-actions-backup-server.json b/doc/api_samples/os-admin-actions/admin-actions-backup-server.json deleted file mode 100644 index 38c03b0eb0..0000000000 --- a/doc/api_samples/os-admin-actions/admin-actions-backup-server.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "createBackup": { - "name": "Backup 1", - "backup_type": "daily", - "rotation": 1 - } -} \ No newline at end of file diff --git a/nova/tests/functional/api_samples/os-admin-actions/admin-actions-backup-server.json.tpl b/nova/tests/functional/api_samples/os-admin-actions/admin-actions-backup-server.json.tpl deleted file mode 100644 index 60f5e1d9fe..0000000000 --- a/nova/tests/functional/api_samples/os-admin-actions/admin-actions-backup-server.json.tpl +++ /dev/null @@ -1,7 +0,0 @@ -{ - "createBackup": { - "name": "Backup 1", - "backup_type": "daily", - "rotation": 1 - } -} diff --git a/nova/tests/functional/test_api_samples.py b/nova/tests/functional/test_api_samples.py index 832eb631d3..ca302f6ec6 100644 --- a/nova/tests/functional/test_api_samples.py +++ b/nova/tests/functional/test_api_samples.py @@ -968,21 +968,6 @@ class AdminActionsSamplesJsonTest(ServersSampleBase): 'admin-actions-unlock-server', {}) self.assertEqual(response.status_code, 202) - def test_post_backup_server(self): - # Get api samples to backup server request. - def image_details(self, context, **kwargs): - """This stub is specifically used on the backup action.""" - # NOTE(maurosr): I've added this simple stub cause backup action - # was trapped in infinite loop during fetch image phase since the - # fake Image Service always returns the same set of images - return [] - - self.stubs.Set(fake._FakeImageService, 'detail', image_details) - - response = self._do_post('servers/%s/action' % self.uuid, - 'admin-actions-backup-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_create_backup.py b/nova/tests/functional/v3/test_create_backup.py index 357026f0b5..39e423122f 100644 --- a/nova/tests/functional/v3/test_create_backup.py +++ b/nova/tests/functional/v3/test_create_backup.py @@ -13,14 +13,32 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_config import cfg + import mock from nova.tests.functional.v3 import test_servers from nova.tests.unit.image import fake +CONF = cfg.CONF +CONF.import_opt('osapi_compute_extension', + 'nova.api.openstack.compute.extensions') + class CreateBackupSamplesJsonTest(test_servers.ServersSampleBase): extension_name = "os-create-backup" + extra_extensions_to_load = ["os-access-ips"] + # TODO(park): Overriding '_api_version' till all functional tests + # are merged between v2 and v2.1. After that base class variable + # itself can be changed to 'v2' + _api_version = 'v2' + + def _get_flags(self): + f = super(CreateBackupSamplesJsonTest, 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