Add servers/ips api_samples tests
Change-Id: I65f8b53b4126458e1522f0bc47559dc1318a473a
This commit is contained in:
parent
e1295a2072
commit
e788d7694d
8
doc/api_samples/server-ips-network-resp.json
Normal file
8
doc/api_samples/server-ips-network-resp.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"private": [
|
||||
{
|
||||
"addr": "192.168.0.3",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
}
|
4
doc/api_samples/server-ips-network-resp.xml
Normal file
4
doc/api_samples/server-ips-network-resp.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<network xmlns="http://docs.openstack.org/compute/api/v1.1" id="private">
|
||||
<ip version="4" addr="192.168.0.3"/>
|
||||
</network>
|
10
doc/api_samples/server-ips-resp.json
Normal file
10
doc/api_samples/server-ips-resp.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "192.168.0.3",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
6
doc/api_samples/server-ips-resp.xml
Normal file
6
doc/api_samples/server-ips-resp.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<addresses xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<network id="private">
|
||||
<ip version="4" addr="192.168.0.3"/>
|
||||
</network>
|
||||
</addresses>
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"private": [
|
||||
{
|
||||
"addr": "%(ip)s",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<network xmlns="http://docs.openstack.org/compute/api/v1.1" id="private">
|
||||
<ip version="4" addr="%(ip)s"/>
|
||||
</network>
|
10
nova/tests/integrated/api_samples/server-ips-resp.json.tpl
Normal file
10
nova/tests/integrated/api_samples/server-ips-resp.json.tpl
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"addresses": {
|
||||
"private": [
|
||||
{
|
||||
"addr": "%(ip)s",
|
||||
"version": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<addresses xmlns="http://docs.openstack.org/compute/api/v1.1">
|
||||
<network id="private">
|
||||
<ip version="4" addr="%(ip)s"/>
|
||||
</network>
|
||||
</addresses>
|
@ -377,6 +377,26 @@ class ServersMetadataXmlTest(ServersMetadataJsonTest):
|
||||
ctype = 'xml'
|
||||
|
||||
|
||||
class ServersIpsJsonTest(ServersSampleBase):
|
||||
def test_get(self):
|
||||
"""Test getting a server's IP information"""
|
||||
uuid = self._post_server()
|
||||
response = self._do_get('servers/%s/ips' % uuid)
|
||||
subs = self._get_regexes()
|
||||
return self._verify_response('server-ips-resp', subs, response)
|
||||
|
||||
def test_get_by_network(self):
|
||||
"""Test getting a server's IP information by network id"""
|
||||
uuid = self._post_server()
|
||||
response = self._do_get('servers/%s/ips/private' % uuid)
|
||||
subs = self._get_regexes()
|
||||
return self._verify_response('server-ips-network-resp', subs, response)
|
||||
|
||||
|
||||
class ServersIpsXmlTest(ServersIpsJsonTest):
|
||||
ctype = 'xml'
|
||||
|
||||
|
||||
class ExtensionsSampleJsonTest(ApiSampleTestBase):
|
||||
all_extensions = True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user