From 7ca05d5f6e6ec7556223f1fdeb1349ea45c5f535 Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Wed, 4 May 2016 23:27:13 +0200 Subject: [PATCH] Fix IPv6 standalone network plugin test StandaloneNetworkPluginTest.test_init_only_with_required_data_v6 fails on some platforms because of the formatting of IPv6 addresses. Currently, the test expects ('2001:cdba::', '2001:cdba::3257:9652', '2001:cdba:0:ffff:ffff:ffff:ffff:ffff') as reserved_addresses. This fails on platforms which format IPv6 addresses differently (e.g. the last address as '2001:cdba::ffff:ffff:ffff:ffff:ffff', where the zero in the middle is missing). By packing that address into a netaddr.IPAddress object and formatting it, this issue can be resolved. Change-Id: I36376d373b325c2d34b301f866536bc5d54e202b Closes-Bug: #1578738 --- manila/tests/network/test_standalone_network_plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manila/tests/network/test_standalone_network_plugin.py b/manila/tests/network/test_standalone_network_plugin.py index 5eb11a8a60..2d76807a81 100644 --- a/manila/tests/network/test_standalone_network_plugin.py +++ b/manila/tests/network/test_standalone_network_plugin.py @@ -124,7 +124,8 @@ class StandaloneNetworkPluginTest(test.TestCase): ['2001:cdba::3257:9652/48'], instance.allowed_cidrs) self.assertEqual( ('2001:cdba::', '2001:cdba::3257:9652', - '2001:cdba:0:ffff:ffff:ffff:ffff:ffff'), + netaddr.IPAddress('2001:cdba:0:ffff:ffff:ffff:ffff:ffff').format() + ), instance.reserved_addresses) @ddt.data('custom_config_group_name', 'DEFAULT')