From 5c5badf365f8fa83b5cbe859420c175e14a6da03 Mon Sep 17 00:00:00 2001 From: Brian Haley <brian.haley@hpe.com> Date: Tue, 24 Jan 2017 01:07:40 -0500 Subject: [PATCH] Use socket.AF_INET6 in ip_lib tests Although AF_INET is always 2, AF_INET6 can vary depending on the OS. Use the system-defined value so the routing table tests work on OSX. Change-Id: I11dca8e4022b23282838799798f352beb2416881 --- neutron/tests/unit/agent/linux/test_ip_lib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neutron/tests/unit/agent/linux/test_ip_lib.py b/neutron/tests/unit/agent/linux/test_ip_lib.py index b93bb097f11..1492de7f8af 100644 --- a/neutron/tests/unit/agent/linux/test_ip_lib.py +++ b/neutron/tests/unit/agent/linux/test_ip_lib.py @@ -21,6 +21,7 @@ from neutron_lib import exceptions import pyroute2 from pyroute2.netlink.rtnl import ndmsg from pyroute2 import NetlinkError +import socket import testtools from neutron.agent.common import utils # noqa @@ -1497,7 +1498,7 @@ class TestGetRoutingTable(base.BaseTestCase): 'metrics': {}, 'oif': 2, 'dst_len': 64, - 'family': 10, + 'family': socket.AF_INET6, 'proto': 2, 'tos': 0, 'dst': '1111:1111:1111:1111::/64', @@ -1516,7 +1517,7 @@ class TestGetRoutingTable(base.BaseTestCase): 'metrics': {}, 'oif': 2, 'dst_len': 64, - 'family': 10, + 'family': socket.AF_INET6, 'proto': 3, 'tos': 0, 'dst': '1111:1111:1111:1112::/64',