CSIT-1459: Migrate IP libraries from VAT to PAPI
[csit.git] / tests / vpp / func / ip4 / eth2p-ethip4-ip4base-rpf-func.robot
1 # Copyright (c) 2019 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 | Library | resources.libraries.python.IPUtil
16 | Library | resources.libraries.python.Trace
17 | ...
18 | Resource | resources/libraries/robot/ip/ip4.robot
19 | Resource | resources/libraries/robot/l2/l2_xconnect.robot
20 | Resource | resources/libraries/robot/shared/counters.robot
21 | Resource | resources/libraries/robot/shared/default.robot
22 | Resource | resources/libraries/robot/shared/interfaces.robot
23 | Resource | resources/libraries/robot/shared/testing_path.robot
24 | Resource | resources/libraries/robot/shared/traffic.robot
25 | ...
26 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO
27 | ...
28 | Test Setup | Set up functional test
29 | ...
30 | Test Teardown | Tear down functional test
31 | ...
32 | Documentation | *Source RPF check on IPv4 test cases*
33 | ...
34 | ... | *[Top] Network Topologies:* TG - DUT1 - DUT2 - TG
35 | ... |        with one link between the nodes.
36 | ... | *[Cfg] DUT configuration:* DUT2 is configured with L2 Cross connect.
37 | ... |        DUT1 is configured with IP source check on link to TG,
38 | ... | *[Ver] TG verification:* Test ICMP Echo Request packets are sent
39 | ... |        in one direction by TG on link to DUT1 and received on TG link
40 | ... |        to DUT2. On receive TG verifies if packets which source address
41 | ... |        is not in routes are dropped.
42
43 *** Variables ***
44 | ${dut1_to_tg_ip}= | 192.168.1.1
45 | ${dut1_to_tg_ip_GW}= | 192.168.1.2
46 | ${dut1_to_dut2_ip}= | 192.168.2.1
47 | ${dut1_to_dut2_ip_GW}= | 192.168.2.2
48 | ${test_dst_ip}= | 32.0.0.1
49 | ${pass_test_src_ip}= | 16.0.0.1
50 | ${drop_test_src_ip}= | 24.0.0.1
51 | ${prefix_length}= | 24
52
53 *** Test Cases ***
54 | TC01: VPP source RPF check on IPv4 src-addr
55 | | [Documentation]
56 | | ... | [Top] TG-DUT1-DUT2-TG
57 | | ... | [Cfg] On DUT1 setup IP source check.
58 | | ... | [Ver] Make TG verify matching packets which source address
59 | | ... | is not in routes are dropped.
60 | | Given Configure path in 3-node circular topology
61 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
62 | | And Set interfaces in 3-node circular topology up
63 | | And VPP Interface Set IP Address | ${dut1_node}
64 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
65 | | And VPP Interface Set IP Address | ${dut1_node}
66 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
67 | | And VPP Add IP Neighbor
68 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
69 | | ... | ${tg_to_dut2_mac}
70 | | And Vpp Route Add
71 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
72 | | ... | gateway=${dut1_to_dut2_ip_GW} | interface=${dut1_to_dut2}
73 | | ... | resolve_attempts=${NONE}
74 | | And VPP Add IP Neighbor
75 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip_GW}
76 | | ... | ${tg_to_dut1_mac}
77 | | And Vpp Route Add
78 | | ... | ${dut1_node} | ${pass_test_src_ip} | ${prefix_length}
79 | | ... | gateway=${dut1_to_tg_ip_GW} | interface=${dut1_to_tg}
80 | | ... | resolve_attempts=${NONE}
81 | | And Configure L2XC
82 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
83 | | Then Send packet and verify headers | ${tg_node}
84 | | ... | ${pass_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
85 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
86 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
87 | | And Send packet and verify headers | ${tg_node}
88 | | ... | ${drop_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
89 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
90 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
91 | | ${dut1_to_tg_name}= | Get Interface Name | ${dut1_node} | ${dut1_to_tg}
92 | | When VPP IP Source Check Setup | ${dut1_node} | ${dut1_to_tg_name}
93 | | Then Send packet and verify headers | ${tg_node}
94 | | ... | ${pass_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 | | And Send packet and verify headers | ${tg_node}
98 | | ... | ${dut1_to_tg_ip_GW} | ${test_dst_ip} | ${tg_to_dut1}
99 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
100 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
101 | | And Packet transmission from port to port should fail | ${tg_node}
102 | | ... | ${drop_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
103 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
104 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
105
106 | TC02: VPP pass traffic on non-enabled RPF interface
107 | | [Documentation]
108 | | ... | [Top] TG-DUT1-DUT2-TG
109 | | ... | [Cfg] On DUT1 setup IP source check.
110 | | ... | [Ver] Make TG verify matching packets on non-enabled RPF interface
111 | | ... | are passed.
112 | | Given Configure path in 3-node circular topology
113 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
114 | | And Set interfaces in 3-node circular topology up
115 | | And VPP Interface Set IP Address | ${dut1_node}
116 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
117 | | And VPP Interface Set IP Address | ${dut1_node}
118 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
119 | | And VPP Add IP Neighbor
120 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
121 | | ... | ${tg_to_dut2_mac}
122 | | And Vpp Route Add
123 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
124 | | ... | gateway=${dut1_to_dut2_ip_GW} | interface=${dut1_to_dut2}
125 | | ... | resolve_attempts=${NONE}
126 | | And VPP Add IP Neighbor
127 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip_GW}
128 | | ... | ${tg_to_dut1_mac}
129 | | And Vpp Route Add
130 | | ... | ${dut1_node} | ${pass_test_src_ip} | ${prefix_length}
131 | | ... | gateway=${dut1_to_tg_ip_GW} | interface=${dut1_to_tg}
132 | | ... | resolve_attempts=${NONE}
133 | | And Configure L2XC
134 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
135 | | ${dut1_to_tg_name}= | Get Interface Name | ${dut1_node} | ${dut1_to_tg}
136 | | When VPP IP Source Check Setup | ${dut1_node} | ${dut1_to_tg_name}
137 | | Then Send packet and verify headers | ${tg_node}
138 | | ... | ${test_dst_ip} | ${pass_test_src_ip} | ${tg_to_dut2}
139 | | ... | ${tg_to_dut2_mac} | ${dut1_to_dut2_mac} | ${tg_to_dut1}
140 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
141 | | And Send packet and verify headers | ${tg_node}
142 | | ... | ${test_dst_ip} | ${dut1_to_tg_ip_GW} | ${tg_to_dut2}
143 | | ... | ${tg_to_dut2_mac} | ${dut1_to_dut2_mac} | ${tg_to_dut1}
144 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}