CSIT-220: Rename directories in tests directory
[csit.git] / tests / func / rpf / ipv4_rpf_untagged.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/default.robot
16 | Resource | resources/libraries/robot/counters.robot
17 | Resource | resources/libraries/robot/interfaces.robot
18 | Resource | resources/libraries/robot/testing_path.robot
19 | Resource | resources/libraries/robot/ipv4.robot
20 | Resource | resources/libraries/robot/l2_xconnect.robot
21 | Resource | resources/libraries/robot/traffic.robot
22 | Library | resources.libraries.python.Trace
23
24 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO
25 | Suite Setup | Run Keywords | Setup all TGs before traffic script
26 | ...         | AND          | Update All Interface Data On All Nodes | ${nodes}
27 | Test Setup | Setup all DUTs before test
28 | Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes}
29 | ...           | AND          | Vpp Show Errors | ${nodes['DUT1']}
30 | ...           | AND          | Show vpp trace dump on all DUTs
31 | Documentation | *Source RPF check on IPv4 test cases*
32 | ...
33 | ... | *[Top] Network Topologies:* TG - DUT1 - DUT2 - TG
34 | ... |        with one link between the nodes.
35 | ... | *[Cfg] DUT configuration:* DUT2 is configured with L2 Cross connect.
36 | ... |        DUT1 is configured with IP source check on link to TG,
37 | ... | *[Ver] TG verification:*Test ICMP Echo Request packets are sent
38 | ... |        in one direction by TG on link to DUT1 and received on TG link
39 | ... |        to DUT2. On receive TG verifies if packets which source address
40 | ... |        is not in routes are dropped.
41
42 *** Variables ***
43 | ${dut1_to_tg_ip}= | 192.168.1.1
44 | ${dut1_to_tg_ip_GW}= | 192.168.1.2
45 | ${dut1_to_dut2_ip}= | 192.168.2.1
46 | ${dut1_to_dut2_ip_GW}= | 192.168.2.2
47 | ${test_dst_ip}= | 32.0.0.1
48 | ${pass_test_src_ip}= | 16.0.0.1
49 | ${drop_test_src_ip}= | 24.0.0.1
50 | ${prefix_length}= | 24
51
52 *** Test Cases ***
53 | TC01: VPP source RPF check on IPv4 src-addr
54 | | [Documentation]
55 | | ... | [Top] TG-DUT1-DUT2-TG
56 | | ... | [Cfg] On DUT1 setup IP source check.
57 | | ... | [Ver] Make TG verify matching packets which source address
58 | | ... | is not in routes are dropped.
59 | | Given Path for 3-node testing is set
60 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
61 | | And Interfaces in 3-node path are up
62 | | And Set Interface Address | ${dut1_node}
63 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
64 | | And Set Interface Address | ${dut1_node}
65 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
66 | | And Add Arp On Dut
67 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
68 | | ... | ${tg_to_dut2_mac}
69 | | And Vpp Route Add
70 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
71 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} | resolve_attempts=${NONE}
72 | | And Add Arp On Dut
73 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip_GW}
74 | | ... | ${tg_to_dut1_mac}
75 | | And Vpp Route Add
76 | | ... | ${dut1_node} | ${pass_test_src_ip} | ${prefix_length}
77 | | ... | ${dut1_to_tg_ip_GW} | ${dut1_to_tg} | resolve_attempts=${NONE}
78 | | And L2 setup xconnect on DUT
79 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
80 | | Then Send Packet And Check Headers | ${tg_node}
81 | | ... | ${pass_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
82 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
83 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
84 | | And Send Packet And Check Headers | ${tg_node}
85 | | ... | ${drop_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
86 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
87 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
88 | | ${dut1_to_tg_name}= | Get Interface Name | ${dut1_node} | ${dut1_to_tg}
89 | | When VPP IP Source Check Setup | ${dut1_node} | ${dut1_to_tg_name}
90 | | Then Send Packet And Check Headers | ${tg_node}
91 | | ... | ${pass_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
92 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
93 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
94 | | And Send Packet And Check Headers | ${tg_node}
95 | | ... | ${dut1_to_tg_ip_GW} | ${test_dst_ip} | ${tg_to_dut1}
96 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
97 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
98 | | And Send packet from Port to Port should failed | ${tg_node}
99 | | ... | ${drop_test_src_ip} | ${test_dst_ip} | ${tg_to_dut1}
100 | | ... | ${tg_to_dut1_mac} | ${dut1_to_tg_mac} | ${tg_to_dut2}
101 | | ... | ${dut1_to_dut2_mac} | ${tg_to_dut2_mac}
102
103 | TC02: VPP pass traffic on non-enabled RPF interface
104 | | [Documentation]
105 | | ... | [Top] TG-DUT1-DUT2-TG
106 | | ... | [Cfg] On DUT1 setup IP source check.
107 | | ... | [Ver] Make TG verify matching packets on non-enabled RPF interface
108 | | ... | are passed.
109 | | Given Path for 3-node testing is set
110 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
111 | | And Interfaces in 3-node path are up
112 | | And Set Interface Address | ${dut1_node}
113 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
114 | | And Set Interface Address | ${dut1_node}
115 | | ... | ${dut1_to_dut2} | ${dut1_to_dut2_ip} | ${prefix_length}
116 | | And Add Arp On Dut
117 | | ... | ${dut1_node} | ${dut1_to_dut2} | ${dut1_to_dut2_ip_GW}
118 | | ... | ${tg_to_dut2_mac}
119 | | And Vpp Route Add
120 | | ... | ${dut1_node} | ${test_dst_ip} | ${prefix_length}
121 | | ... | ${dut1_to_dut2_ip_GW} | ${dut1_to_dut2} | resolve_attempts=${NONE}
122 | | And Add Arp On Dut
123 | | ... | ${dut1_node} | ${dut1_to_tg} | ${dut1_to_tg_ip_GW}
124 | | ... | ${tg_to_dut1_mac}
125 | | And Vpp Route Add
126 | | ... | ${dut1_node} | ${pass_test_src_ip} | ${prefix_length}
127 | | ... | ${dut1_to_tg_ip_GW} | ${dut1_to_tg} | resolve_attempts=${NONE}
128 | | And L2 setup xconnect on DUT
129 | | ... | ${dut2_node} | ${dut2_to_dut1} | ${dut2_to_tg}
130 | | ${dut1_to_tg_name}= | Get Interface Name | ${dut1_node} | ${dut1_to_tg}
131 | | When VPP IP Source Check Setup | ${dut1_node} | ${dut1_to_tg_name}
132 | | Then Send Packet And Check Headers | ${tg_node}
133 | | ... | ${test_dst_ip} | ${pass_test_src_ip} | ${tg_to_dut2}
134 | | ... | ${tg_to_dut2_mac} | ${dut1_to_dut2_mac} | ${tg_to_dut1}
135 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}
136 | | And Send Packet And Check Headers | ${tg_node}
137 | | ... | ${test_dst_ip} | ${dut1_to_tg_ip_GW} | ${tg_to_dut2}
138 | | ... | ${tg_to_dut2_mac} | ${dut1_to_dut2_mac} | ${tg_to_dut1}
139 | | ... | ${dut1_to_tg_mac} | ${tg_to_dut1_mac}