Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ACL plugin enable macip for ip4/ip6 traffic
[vpp.git]
/
test
/
test_map.py
diff --git
a/test/test_map.py
b/test/test_map.py
index
bc6cd81
..
bbf4aec
100644
(file)
--- a/
test/test_map.py
+++ b/
test/test_map.py
@@
-4,7
+4,7
@@
import unittest
import socket
from framework import VppTestCase, VppTestRunner
import socket
from framework import VppTestCase, VppTestRunner
-from vpp_ip_route import VppIpRoute, VppRoutePath
+from vpp_ip_route import VppIpRoute, VppRoutePath
, DpoProto
from scapy.layers.l2 import Ether, Raw
from scapy.layers.inet import IP, UDP, ICMP
from scapy.layers.l2 import Ether, Raw
from scapy.layers.inet import IP, UDP, ICMP
@@
-75,7
+75,7
@@
class TestMAP(VppTestCase):
map_br_pfx_len,
[VppRoutePath(self.pg1.remote_ip6,
self.pg1.sw_if_index,
map_br_pfx_len,
[VppRoutePath(self.pg1.remote_ip6,
self.pg1.sw_if_index,
-
is_ip6=1
)],
+
proto=DpoProto.DPO_PROTO_IP6
)],
is_ip6=1)
map_route.add_vpp_config()
is_ip6=1)
map_route.add_vpp_config()
@@
-138,13
+138,12
@@
class TestMAP(VppTestCase):
# Add a route to 4001::1. Expect the encapped traffic to be
# sent via that routes next-hop
#
# Add a route to 4001::1. Expect the encapped traffic to be
# sent via that routes next-hop
#
- pre_res_route = VppIpRoute(self,
- "4001::1",
- 128,
- [VppRoutePath(self.pg1.remote_hosts[2].ip6,
- self.pg1.sw_if_index,
- is_ip6=1)],
- is_ip6=1)
+ pre_res_route = VppIpRoute(
+ self, "4001::1", 128,
+ [VppRoutePath(self.pg1.remote_hosts[2].ip6,
+ self.pg1.sw_if_index,
+ proto=DpoProto.DPO_PROTO_IP6)],
+ is_ip6=1)
pre_res_route.add_vpp_config()
self.send_and_assert_encapped(v4, map_src,
pre_res_route.add_vpp_config()
self.send_and_assert_encapped(v4, map_src,
@@
-154,18
+153,21
@@
class TestMAP(VppTestCase):
#
# change the route to the pre-solved next-hop
#
#
# change the route to the pre-solved next-hop
#
- pre_res_route1 = VppIpRoute(self,
- "4001::1",
- 128,
- [VppRoutePath(self.pg1.remote_hosts[3].ip6,
- self.pg1.sw_if_index,
- is_ip6=1)],
- is_ip6=1)
- pre_res_route1.add_vpp_config()
+ pre_res_route.modify([VppRoutePath(self.pg1.remote_hosts[3].ip6,
+ self.pg1.sw_if_index,
+ proto=DpoProto.DPO_PROTO_IP6)])
+ pre_res_route.add_vpp_config()
self.send_and_assert_encapped(v4, map_src,
"2001::c0a8:0:0",
dmac=self.pg1.remote_hosts[3].mac)
self.send_and_assert_encapped(v4, map_src,
"2001::c0a8:0:0",
dmac=self.pg1.remote_hosts[3].mac)
+ #
+ # cleanup. The test infra's object registry will ensure
+ # the route is really gone and thus that the unresolve worked.
+ #
+ pre_res_route.remove_vpp_config()
+ self.vapi.ppcli("map params pre-resolve del ip6-nh 4001::1")
+
if __name__ == '__main__':
unittest.main(testRunner=VppTestRunner)
if __name__ == '__main__':
unittest.main(testRunner=VppTestRunner)