diff options
author | mu.duojiao <mu.duojiao@zte.com.cn> | 2018-10-11 14:27:30 +0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-10-17 15:13:06 +0000 |
commit | c548f5df3ff41f76bac585923ffb1fc72c80766b (patch) | |
tree | b195230aab9395f3cef31394392c05be8a92a0db /test | |
parent | 41b2ae7c1df585158627c5d9ffd8e4fd3a6d89eb (diff) |
VPP-1448: Fix error when recurse on down the trie.
Change-Id: Idfed8243643780d3f52dfe6e6ec621c440daa6ae
Signed-off-by: mu.duojiao <mu.duojiao@zte.com.cn>
(cherry picked from commit 59a829533c1345945dc1b6decc3afe29494e85cd)
Diffstat (limited to 'test')
-rw-r--r-- | test/test_ip4.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/test/test_ip4.py b/test/test_ip4.py index be443198595..3f961d591e1 100644 --- a/test/test_ip4.py +++ b/test/test_ip4.py @@ -1410,5 +1410,55 @@ class TestIPInput(VppTestCase): # Reset MTU for subsequent tests self.vapi.sw_interface_set_mtu(self.pg1.sw_if_index, [9000, 0, 0, 0]) + +class TestIPLPM(VppTestCase): + """ IPv4 longest Prefix Match """ + + def setUp(self): + super(TestIPLPM, self).setUp() + + self.create_pg_interfaces(range(4)) + + for i in self.pg_interfaces: + i.admin_up() + i.config_ip4() + i.resolve_arp() + + def tearDown(self): + super(TestIPLPM, self).tearDown() + for i in self.pg_interfaces: + i.admin_down() + i.unconfig_ip4() + + def test_ip_lpm(self): + """ IP longest Prefix Match """ + + s_24 = VppIpRoute(self, "10.1.2.0", 24, + [VppRoutePath(self.pg1.remote_ip4, + self.pg1.sw_if_index)]) + s_24.add_vpp_config() + s_8 = VppIpRoute(self, "10.0.0.0", 8, + [VppRoutePath(self.pg2.remote_ip4, + self.pg2.sw_if_index)]) + s_8.add_vpp_config() + + p_8 = (Ether(src=self.pg0.remote_mac, + dst=self.pg0.local_mac) / + IP(src="1.1.1.1", + dst="10.1.1.1") / + UDP(sport=1234, dport=1234) / + Raw('\xa5' * 2000)) + p_24 = (Ether(src=self.pg0.remote_mac, + dst=self.pg0.local_mac) / + IP(src="1.1.1.1", + dst="10.1.2.1") / + UDP(sport=1234, dport=1234) / + Raw('\xa5' * 2000)) + + self.logger.info(self.vapi.cli("sh ip fib mtrie")) + rx = self.send_and_expect(self.pg0, p_8 * 65, self.pg2) + rx = self.send_and_expect(self.pg0, p_24 * 65, self.pg1) + + if __name__ == '__main__': unittest.main(testRunner=VppTestRunner) |