summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorTang Chen <chen.tang@easystack.cn>2016-02-16 14:33:31 +0800
committerTang Chen <chen.tang@easystack.cn>2016-02-19 11:10:53 +0800
commitca34aa1587212ce5ac456a988fd6b442e646ed16 (patch)
treeb6983dc5c5ef55a57a998b0478437d307f56d593 /openstackclient/tests
parent444fc6149db58361e5329e3f05eb8f056fb7479a (diff)
downloadpython-openstackclient-ca34aa1587212ce5ac456a988fd6b442e646ed16.tar.gz
Floating IP: Fix "ip floating list" in neutron network
The implementation of "ip floating list" in the commit below is incorrect: Change-Id: I253f66f6bc64470e1a18ffea506048eb53f67d5c This is because the FloatingIP objects returned from Nova and Neutron network are different. They need different handling. This patch fixes this problem. The output for Neutron network would be: +--------------------------------------+---------------------+------------------+------+ | ID | Floating IP Address | Fixed IP Address | Port | +--------------------------------------+---------------------+------------------+------+ | 1976df86-e66a-4f96-81bd-c6ffee6407f1 | 172.24.4.3 | None | None | +--------------------------------------+---------------------+------------------+------+ The output for Neutron network would be: +----+---------------------+------------------+-----------+--------+ | ID | Floating IP Address | Fixed IP Address | Server ID | Pool | +----+---------------------+------------------+-----------+--------+ | 1 | 172.24.4.1 | None | None | public | +----+---------------------+------------------+-----------+--------+ Change-Id: I1295e922df695414511d9a07ca4a8e2428040064 Partial-Bug: 1519502 Related-to: blueprint neutron-client
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/network/v2/fakes.py7
-rw-r--r--openstackclient/tests/network/v2/test_floating_ip.py22
2 files changed, 19 insertions, 10 deletions
diff --git a/openstackclient/tests/network/v2/fakes.py b/openstackclient/tests/network/v2/fakes.py
index b48cde3e..ae205a2d 100644
--- a/openstackclient/tests/network/v2/fakes.py
+++ b/openstackclient/tests/network/v2/fakes.py
@@ -619,10 +619,9 @@ class FakeFloatingIP(object):
# Set default attributes.
floating_ip_attrs = {
'id': 'floating-ip-id-' + uuid.uuid4().hex,
- 'ip': '1.0.9.0',
- 'fixed_ip': '2.0.9.0',
- 'instance_id': 'server-id-' + uuid.uuid4().hex,
- 'pool': 'public',
+ 'floating_ip_address': '1.0.9.0',
+ 'fixed_ip_address': '2.0.9.0',
+ 'port_id': 'port-id-' + uuid.uuid4().hex,
}
# Overwrite default attributes.
diff --git a/openstackclient/tests/network/v2/test_floating_ip.py b/openstackclient/tests/network/v2/test_floating_ip.py
index 031dcdac..a29d6913 100644
--- a/openstackclient/tests/network/v2/test_floating_ip.py
+++ b/openstackclient/tests/network/v2/test_floating_ip.py
@@ -64,16 +64,20 @@ class TestListFloatingIPNetwork(TestFloatingIPNetwork):
# The floating ips to list up
floating_ips = network_fakes.FakeFloatingIP.create_floating_ips(count=3)
- columns = ('ID', 'Floating IP', 'Fixed IP', 'Server ID', 'Pool')
+ columns = (
+ 'ID',
+ 'Floating IP Address',
+ 'Fixed IP Address',
+ 'Port',
+ )
data = []
for ip in floating_ips:
data.append((
ip.id,
- ip.ip,
- ip.fixed_ip,
- ip.instance_id,
- ip.pool,
+ ip.floating_ip_address,
+ ip.fixed_ip_address,
+ ip.port_id,
))
def setUp(self):
@@ -147,7 +151,13 @@ class TestListFloatingIPCompute(TestFloatingIPCompute):
# The floating ips to be list up
floating_ips = compute_fakes.FakeFloatingIP.create_floating_ips(count=3)
- columns = ('ID', 'Floating IP', 'Fixed IP', 'Server ID', 'Pool')
+ columns = (
+ 'ID',
+ 'Floating IP Address',
+ 'Fixed IP Address',
+ 'Server',
+ 'Pool',
+ )
data = []
for ip in floating_ips: