diff --git a/doc/api_samples/os-fping/fping-get-details-resp.json b/doc/api_samples/os-fping/fping-get-details-resp.json deleted file mode 100644 index a5692832b5ee..000000000000 --- a/doc/api_samples/os-fping/fping-get-details-resp.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "server": { - "alive": false, - "id": "f5e6fd6d-c0a3-4f9e-aabf-d69196b6d11a", - "project_id": "openstack" - } -} \ No newline at end of file diff --git a/doc/api_samples/os-fping/fping-get-resp.json b/doc/api_samples/os-fping/fping-get-resp.json deleted file mode 100644 index 11bf37edd6a6..000000000000 --- a/doc/api_samples/os-fping/fping-get-resp.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "servers": [ - { - "alive": false, - "id": "1d1aea35-472b-40cf-9337-8eb68480aaa1", - "project_id": "openstack" - } - ] -} \ No newline at end of file diff --git a/nova/tests/functional/api_samples/os-fping/fping-get-details-resp.json.tpl b/nova/tests/functional/api_samples/os-fping/fping-get-details-resp.json.tpl deleted file mode 100644 index f3b222c39969..000000000000 --- a/nova/tests/functional/api_samples/os-fping/fping-get-details-resp.json.tpl +++ /dev/null @@ -1,7 +0,0 @@ -{ - "server": { - "alive": false, - "id": "%(uuid)s", - "project_id": "openstack" - } -} diff --git a/nova/tests/functional/api_samples/os-fping/fping-get-resp.json.tpl b/nova/tests/functional/api_samples/os-fping/fping-get-resp.json.tpl deleted file mode 100644 index b33e80668b24..000000000000 --- a/nova/tests/functional/api_samples/os-fping/fping-get-resp.json.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{ - "servers": [ - { - "alive": false, - "id": "%(uuid)s", - "project_id": "openstack" - } - ] -} diff --git a/nova/tests/functional/test_api_samples.py b/nova/tests/functional/test_api_samples.py index fca0859cad3c..6df314c9ee06 100644 --- a/nova/tests/functional/test_api_samples.py +++ b/nova/tests/functional/test_api_samples.py @@ -29,7 +29,6 @@ from oslo_utils import timeutils import testtools from nova.api.metadata import password -from nova.api.openstack.compute.contrib import fping from nova.api.openstack.compute import extensions from nova.cells import utils as cells_utils # Import extensions to pull in osapi_compute_extension CONF option used below. @@ -45,12 +44,10 @@ from nova.servicegroup import api as service_group_api from nova import test from nova.tests.functional import api_samples_test_base from nova.tests.functional import integrated_helpers -from nova.tests.unit.api.openstack.compute.contrib import test_fping from nova.tests.unit.api.openstack import fakes from nova.tests.unit import fake_network from nova.tests.unit import fake_utils from nova.tests.unit.image import fake -from nova import utils from nova.volume import cinder CONF = cfg.CONF @@ -1023,31 +1020,6 @@ class BlockDeviceMappingV2BootJsonTest(ServersSampleBase): return self._post_server() -class FpingSampleJsonTests(ServersSampleBase): - extension_name = ("nova.api.openstack.compute.contrib.fping.Fping") - - def setUp(self): - super(FpingSampleJsonTests, self).setUp() - - def fake_check_fping(self): - pass - self.stubs.Set(utils, "execute", test_fping.execute) - self.stubs.Set(fping.FpingController, "check_fping", - fake_check_fping) - - def test_get_fping(self): - self._post_server() - response = self._do_get('os-fping') - subs = self._get_regexes() - self._verify_response('fping-get-resp', subs, response, 200) - - def test_get_fping_details(self): - uuid = self._post_server() - response = self._do_get('os-fping/%s' % (uuid)) - subs = self._get_regexes() - self._verify_response('fping-get-details-resp', subs, response, 200) - - class ExtendedAvailabilityZoneJsonTests(ServersSampleBase): extension_name = ("nova.api.openstack.compute.contrib" ".extended_availability_zone" diff --git a/nova/tests/functional/v3/test_fping.py b/nova/tests/functional/v3/test_fping.py index d7a8c2053897..fffd8b6cefa0 100644 --- a/nova/tests/functional/v3/test_fping.py +++ b/nova/tests/functional/v3/test_fping.py @@ -13,15 +13,30 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_config import cfg +from nova.api.openstack.compute.contrib import fping as fping_v2 from nova.api.openstack.compute.plugins.v3 import fping from nova.tests.functional.v3 import test_servers from nova.tests.unit.api.openstack.compute.contrib import test_fping from nova import utils +CONF = cfg.CONF +CONF.import_opt('osapi_compute_extension', + 'nova.api.openstack.compute.extensions') + class FpingSampleJsonTests(test_servers.ServersSampleBase): extension_name = "os-fping" + extra_extensions_to_load = ["os-access-ips"] + _api_version = 'v2' + + def _get_flags(self): + f = super(FpingSampleJsonTests, self)._get_flags() + f['osapi_compute_extension'] = CONF.osapi_compute_extension[:] + f['osapi_compute_extension'].append( + 'nova.api.openstack.compute.contrib.fping.Fping') + return f def setUp(self): super(FpingSampleJsonTests, self).setUp() @@ -31,6 +46,8 @@ class FpingSampleJsonTests(test_servers.ServersSampleBase): self.stubs.Set(utils, "execute", test_fping.execute) self.stubs.Set(fping.FpingController, "check_fping", fake_check_fping) + self.stubs.Set(fping_v2.FpingController, "check_fping", + fake_check_fping) def test_get_fping(self): self._post_server()