Add a functional test for 'removeFloatingIp' action
Add a functional test for 'removeFloatingIp' action. Rename the example file for 'addFloatingIp' action to clarify that it is a request body example. Change-Id: Ic865318fa640eb17d1317fb3d5f064788ebf44e7
This commit is contained in:
@@ -73,7 +73,7 @@ Request
|
|||||||
|
|
||||||
**Example Add (Associate) Floating Ip (addFloatingIp Action)**
|
**Example Add (Associate) Floating Ip (addFloatingIp Action)**
|
||||||
|
|
||||||
.. literalinclude:: ../../doc/api_samples/servers/server-action-addfloatingip.json
|
.. literalinclude:: ../../doc/api_samples/servers/server-action-addfloatingip-req.json
|
||||||
:language: javascript
|
:language: javascript
|
||||||
|
|
||||||
Response
|
Response
|
||||||
@@ -531,7 +531,7 @@ Request
|
|||||||
|
|
||||||
**Example Remove (Disassociate) Floating Ip (removeFloatingIp Action)**
|
**Example Remove (Disassociate) Floating Ip (removeFloatingIp Action)**
|
||||||
|
|
||||||
.. literalinclude:: ../../doc/api_samples/servers/server-action-removefloatingip.json
|
.. literalinclude:: ../../doc/api_samples/servers/server-action-removefloatingip-req.json
|
||||||
:language: javascript
|
:language: javascript
|
||||||
|
|
||||||
Response
|
Response
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"removeFloatingIp" : {
|
||||||
|
"address": "%(address)s"
|
||||||
|
}
|
||||||
|
}
|
@@ -340,7 +340,27 @@ class ServersActionsJsonTest(ServersSampleBase, _ServersActionsJsonTestMixin):
|
|||||||
self.stub_out('nova.network.api.API.associate_floating_ip',
|
self.stub_out('nova.network.api.API.associate_floating_ip',
|
||||||
lambda *a, **k: None)
|
lambda *a, **k: None)
|
||||||
self._test_server_action(uuid, 'addFloatingIp',
|
self._test_server_action(uuid, 'addFloatingIp',
|
||||||
'server-action-addfloatingip', subs)
|
'server-action-addfloatingip-req', subs)
|
||||||
|
|
||||||
|
def test_server_remove_floating_ip(self):
|
||||||
|
server_uuid = self._post_server()
|
||||||
|
self._wait_for_active_server(server_uuid)
|
||||||
|
|
||||||
|
subs = {
|
||||||
|
"address": "172.16.10.7"
|
||||||
|
}
|
||||||
|
|
||||||
|
self.stub_out('nova.network.api.API.get_floating_ip_by_address',
|
||||||
|
lambda *a, **k: {'fixed_ip_id':
|
||||||
|
'a0c566f0-faab-406f-b77f-2b286dc6dd7e'})
|
||||||
|
self.stub_out(
|
||||||
|
'nova.network.api.API.get_instance_id_by_floating_address',
|
||||||
|
lambda *a, **k: server_uuid)
|
||||||
|
self.stub_out('nova.network.api.API.disassociate_floating_ip',
|
||||||
|
lambda *a, **k: None)
|
||||||
|
|
||||||
|
self._test_server_action(server_uuid, 'removeFloatingIp',
|
||||||
|
'server-action-removefloatingip-req', subs)
|
||||||
|
|
||||||
|
|
||||||
class ServersActionsJson219Test(ServersSampleBase):
|
class ServersActionsJson219Test(ServersSampleBase):
|
||||||
|
Reference in New Issue
Block a user