Commit 93b7874b authored by Peter V. Saveliev's avatar Peter V. Saveliev

ipdb: fix IPv6 routes

Bug-Url: https://github.com/svinota/pyroute2/issues/307
parent 5d4d5b92
......@@ -125,7 +125,7 @@ class WatchdogKey(dict):
RouteKey = namedtuple('RouteKey',
('dst',
'priority'))
RouteKey._required = 2 # number of required fields (should go first)
RouteKey._required = 1 # number of required fields (should go first)
# IP multipath NH key
IPNHKey = namedtuple('IPNHKey',
......
......@@ -892,6 +892,28 @@ class TestExplicit(BasicSetup):
with route:
route.remove()
def test_routes_ipv6(self):
require_user('root')
i = self.ip.create(ifname=uifname(), kind='dummy')
with i:
i.add_ip('2001:4c8:1023:108::39/64')
i.up()
r = self.ip.routes.add({'dst': 'fd00:6d:3d1a::/64',
'gateway': '2001:4c8:1023:108::40'})
r.commit()
assert grep('ip -6 ro', pattern='fd00:6d:3d1a::')
assert 'fd00:6d:3d1a::/64' in self.ip.routes.keys()
if self.ip.mode == 'explicit':
r.begin()
r.remove().commit()
assert not grep('ip -6 ro', pattern='fd00:6d:3d1a::')
assert 'fd00:6d:3d1a::/64' not in self.ip.routes.keys()
if self.ip.mode == 'explicit':
i.begin()
i.remove().commit()
def test_routes_type(self):
require_user('root')
self.ip.routes.add(dst='default',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment