diff --git a/doc/api_samples/extension-info/extensions-get-resp-v2.json b/doc/api_samples/extension-info/extensions-get-resp-v2.json new file mode 100644 index 000000000000..538ca8c3cbb7 --- /dev/null +++ b/doc/api_samples/extension-info/extensions-get-resp-v2.json @@ -0,0 +1,10 @@ +{ + "extension": { + "alias": "os-agents", + "description": "Agents support.", + "links": [], + "name": "Agents", + "namespace": "http://docs.openstack.org/compute/ext/agents/api/v2", + "updated": "2012-10-28T00:00:00Z" + } +} \ No newline at end of file diff --git a/doc/api_samples/extension-info/extensions-get-resp.json b/doc/api_samples/extension-info/extensions-get-resp.json index 3181d17c6e2c..3753624b402e 100644 --- a/doc/api_samples/extension-info/extensions-get-resp.json +++ b/doc/api_samples/extension-info/extensions-get-resp.json @@ -1,9 +1,9 @@ { "extension": { - "alias": "os-create-backup", - "description": "Create a backup of a server.", + "alias": "os-agents", + "description": "Agents support.", "links": [], - "name": "CreateBackup", + "name": "Agents", "namespace": "http://docs.openstack.org/compute/ext/fake_xml", "updated": "2014-12-03T00:00:00Z" } diff --git a/nova/tests/functional/api_sample_tests/api_samples/extension-info/extensions-get-resp-v2.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/extension-info/extensions-get-resp-v2.json.tpl new file mode 100644 index 000000000000..9b6b764988b5 --- /dev/null +++ b/nova/tests/functional/api_sample_tests/api_samples/extension-info/extensions-get-resp-v2.json.tpl @@ -0,0 +1,10 @@ +{ + "extension": { + "alias": "os-agents", + "description": "%(text)s", + "links": [], + "name": "Agents", + "namespace": "http://docs.openstack.org/compute/ext/agents/api/v2", + "updated": "%(isotime)s" + } +} \ No newline at end of file diff --git a/nova/tests/functional/api_sample_tests/api_samples/extension-info/extensions-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/extension-info/extensions-get-resp.json.tpl index 3181d17c6e2c..3753624b402e 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/extension-info/extensions-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/extension-info/extensions-get-resp.json.tpl @@ -1,9 +1,9 @@ { "extension": { - "alias": "os-create-backup", - "description": "Create a backup of a server.", + "alias": "os-agents", + "description": "Agents support.", "links": [], - "name": "CreateBackup", + "name": "Agents", "namespace": "http://docs.openstack.org/compute/ext/fake_xml", "updated": "2014-12-03T00:00:00Z" } diff --git a/nova/tests/functional/api_sample_tests/test_extension_info.py b/nova/tests/functional/api_sample_tests/test_extension_info.py index 2c24fa6c3553..c8a85d974328 100644 --- a/nova/tests/functional/api_sample_tests/test_extension_info.py +++ b/nova/tests/functional/api_sample_tests/test_extension_info.py @@ -52,15 +52,17 @@ class ExtensionInfoAllSamplesJsonTest(api_sample_base.ApiSampleTestBaseV21): class ExtensionInfoSamplesJsonTest(api_sample_base.ApiSampleTestBaseV21): sample_dir = "extension-info" - extra_extensions_to_load = ["os-create-backup"] - # NOTE (gmann): run this tests for v21. and v2.1 compatible mode only - # as there is no 'extensions/*' API in v2. - scenarios = [('v2_1', {'_test': 'v2.1'}), - ('v2_1_compatible', {'_test': 'v2.1_compatible'})] + all_extensions = True @mock.patch.object(api_extensions, 'os_compute_soft_authorizer') def test_get_extensions(self, soft_auth): soft_auth.side_effect = fake_soft_extension_authorizer - response = self._do_get('extensions/os-create-backup') + response = self._do_get('extensions/os-agents') subs = self._get_regexes() - self._verify_response('extensions-get-resp', subs, response, 200) + # The extension details info are different between legacy v2 and v2.1 + # stack. namespace link and updated date are different. So keep both + # version for testing and default to v2.1 + template = 'extensions-get-resp' + if self._legacy_v2_code: + template = 'extensions-get-resp-v2' + self._verify_response(template, subs, response, 200)