FIB table add/delete
[csit.git] / tests / vpp / func / ip4 / eth2p-ethip4-ip4base-rpf-func.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Resource | resources/libraries/robot/shared/default.robot
16 | Resource | resources/libraries/robot/shared/counters.robot
17 | Resource | resources/libraries/robot/shared/interfaces.robot
18 | Resource | resources/libraries/robot/shared/testing_path.robot
19 | Resource | resources/libraries/robot/ip/ip4.robot
20 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
21 | Resource | resources/libraries/robot/shared/traffic.robot
22 | Library | resources.libraries.python.Trace
23 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO
24 | Test Setup | Set up functional test
25 | Test Teardown | Tear down functional test
26 | Documentation | *Source RPF check on IPv4 test cases*
27 | ...
28 | ... | *[Top] Network Topologies:* TG - DUT1 - DUT2 - TG
29 | ... |        with one link between the nodes.
30 | ... | *[Cfg] DUT configuration:* DUT2 is configured with L2 Cross connect.
31 | ... |        DUT1 is configured with IP source check on link to TG,
32 | ... | *[Ver] TG verification:* Test ICMP Echo Request packets are sent
33 | ... |        in one direction by TG on link to DUT1 and received on TG link
34 | ... |        to DUT2. On receive TG verifies if packets which source address
35 | ... |        is not in routes are dropped.
36
37 *** Variables ***
38 | ${dut1_to_tg_ip}= | 192.168.1.1
39 | ${dut1_to_tg_ip_GW}= | 192.168.1.2
40 | ${dut1_to_dut2_ip}= | 192.168.2.1
41 | ${dut1_to_dut2_ip_GW}= | 192.168.2.2
42 | ${test_dst_ip}= | 32.0.0.1
43 | ${pass_test_src_ip}= | 16.0.0.1
44 | ${drop_test_src_ip}= | 24.0.0.1
45 | ${prefix_length}= | 24
46
47 *** Test Cases ***
48 | TC01: VPP source RPF check on IPv4 src-addr
49 | | [Documentation]
50 | | ... | [Top] TG-DUT1-DUT2-TG
51 | | ... | [Cfg] On DUT1 setup IP source check.
52 | | ... | [Ver] Make TG verify matching packets which source address
53 | | ... | is not in routes are dropped.
54 | | Given Configure path in 3-node circular topology
55 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
56 | | And Set interfaces in 3-node circular topology up
57 | | And Set Interface Address | ${dut1_node}
58 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
59 | | And Set Interface Address | ${dut1_node}
60 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
61 | | And Add Arp On Dut
62 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
63 | | ... | ${tg_to_dut2_mac}
64 | | And Vpp Route Add
65 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
66 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} | resolve_attempts=${NONE}
67 | | And Add Arp On Dut
68 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip_GW}
69 | | ... | ${tg_to_dut1_mac}
70 | | And Vpp Route Add
71 | | ... | ${dut1_node} | ${pass_test_src_ip} | ${prefix_length}
72 | | ... | ${dut1_to_tg_ip_GW} | ${dut1_to_tg} | resolve_attempts=${NONE}
73 | | And Configure L2XC
74 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
75 | | Then Send packet and verify headers | ${tg_node}
76 | | ... | ${pass_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
77 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
78 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
79 | | And Send packet and verify headers | ${tg_node}
80 | | ... | ${drop_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
81 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
82 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
83 | | ${dut1_to_tg_name}= | Get Interface Name | ${dut1_node} | ${dut1_to_tg}
84 | | When VPP IP Source Check Setup | ${dut1_node} | ${dut1_to_tg_name}
85 | | Then Send packet and verify headers | ${tg_node}
86 | | ... | ${pass_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
87 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
88 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
89 | | And Send packet and verify headers | ${tg_node}
90 | | ... | ${dut1_to_tg_ip_GW} | ${test_dst_ip} | ${tg_to_dut1}
91 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
92 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
93 | | And Packet transmission from port to port should fail | ${tg_node}
94 | | ... | ${drop_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
95 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
96 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
97
98 | TC02: VPP pass traffic on non-enabled RPF interface
99 | | [Documentation]
100 | | ... | [Top] TG-DUT1-DUT2-TG
101 | | ... | [Cfg] On DUT1 setup IP source check.
102 | | ... | [Ver] Make TG verify matching packets on non-enabled RPF interface
103 | | ... | are passed.
104 | | Given Configure path in 3-node circular topology
105 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
106 | | And Set interfaces in 3-node circular topology up
107 | | And Set Interface Address | ${dut1_node}
108 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
109 | | And Set Interface Address | ${dut1_node}
110 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
111 | | And Add Arp On Dut
112 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
113 | | ... | ${tg_to_dut2_mac}
114 | | And Vpp Route Add
115 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
116 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} | resolve_attempts=${NONE}
117 | | And Add Arp On Dut
118 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip_GW}
119 | | ... | ${tg_to_dut1_mac}
120 | | And Vpp Route Add
121 | | ... | ${dut1_node} | ${pass_test_src_ip} | ${prefix_length}
122 | | ... | ${dut1_to_tg_ip_GW} | ${dut1_to_tg} | resolve_attempts=${NONE}
123 | | And Configure L2XC
124 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
125 | | ${dut1_to_tg_name}= | Get Interface Name | ${dut1_node} | ${dut1_to_tg}
126 | | When VPP IP Source Check Setup | ${dut1_node} | ${dut1_to_tg_name}
127 | | Then Send packet and verify headers | ${tg_node}
128 | | ... | ${test_dst_ip} | ${pass_test_src_ip} | ${tg_to_dut2}
129 | | ... | ${tg_to_dut2_mac} | ${dut1_to_dut2_mac} | ${tg_to_dut1}
130 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
131 | | And Send packet and verify headers | ${tg_node}
132 | | ... | ${test_dst_ip} | ${dut1_to_tg_ip_GW} | ${tg_to_dut2}
133 | | ... | ${tg_to_dut2_mac} | ${dut1_to_dut2_mac} | ${tg_to_dut1}
134 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.