CSIT-158: Tap interface tests
[csit.git] / tests / func / ipv4 / ipv4_proxy_arp_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/interfaces.robot
17 | Resource | resources/libraries/robot/testing_path.robot
18 | Resource | resources/libraries/robot/ipv4.robot
19 | Resource | resources/libraries/robot/traffic.robot
20 | Library | resources.libraries.python.Trace
21 | Library | resources.libraries.python.ProxyArp
22 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO
23 | Suite Setup | Run Keywords | Setup all TGs before traffic script
24 | ...         | AND          | Update All Interface Data On All Nodes | ${nodes}
25 | Test Setup | Setup all DUTs before test
26 | Test Teardown | Show packet trace on all DUTs | ${nodes}
27 | Documentation | *RFC1027 Proxy ARP test cases*
28 | ...
29 | ... | *[Top] Network topologies:* TG-DUT1 2-node topology with
30 | ... | single link between nodes.
31 | ... | *[Cfg] DUT configuration:* DUT1 is configured with Proxy ARP
32 | ... | *[Ver] TG verification:* Test ARP Request packet is sent
33 | ... | from TG on link to DUT1; on receive TG verifies ARP reply packet
34 | ... | for correctness and their IPv4 src-addr, dst-addr and MAC addresses.
35 | ... | *[Ref] Applicable standard specifications:* RFC1027.
36
37 *** Variables ***
38 | ${tg_to_dut1_ip}= | 10.0.0.100
39 | ${dut1_to_tg_ip}= | 10.0.0.1
40 | ${prefix_length}= | 24
41 | ${lo_ip4_addr}= | 192.168.1.2
42 | ${hi_ip4_addr}= | 192.168.1.10
43 | ${pass_test_ip}= | 192.168.1.5
44 | ${pass_test_lo_ip}= | 192.168.1.2
45 | ${pass_test_hi_ip}= | 192.168.1.10
46 | ${fail_test_lo_ip}= | 192.168.1.1
47 | ${fail_test_hi_ip}= | 192.168.1.11
48
49 *** Test Cases ***
50 | TC01: DUT sends ARP reply on behalf of another machine from the IP range
51 | | [Documentation]
52 | | ... | [Top] TG-DUT1.
53 | | ... | [Ref] RFC1027.
54 | | ... | [Cfg] On DUT1 configure interface IPv4 address and proxy ARP
55 | | ... | for IP range.
56 | | ... | [Ver] Make TG send ARP request to DUT1 interface,
57 | | ... | verify if DUT1 sends correct ARP reply on behalf of machine which
58 | | ... | IP is in range.
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 | | ${dut1_to_tg_name}= | Get interface name | ${dut1_node} | ${dut1_to_tg}
63 | | ${tg_to_dut1_name}= | Get interface name | ${tg_node} | ${tg_to_dut1}
64 | | When Set Interface Address | ${dut1_node}
65 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
66 | | And Vpp Add Proxy ARP | ${dut1_node} | ${lo_ip4_addr} | ${hi_ip4_addr}
67 | | And Vpp Proxy ARP Interface Enable | ${dut1_node} | ${dut1_to_tg_name}
68 | | Then Send ARP Request | ${tg_node} | ${tg_to_dut1_name}
69 | | ...                   | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
70 | | ...                   | ${tg_to_dut1_ip} | ${pass_test_ip}
71
72 | TC02: DUT sends ARP reply on behalf of another machine from beginning of the IP range
73 | | [Documentation]
74 | | ... | [Top] TG-DUT1.
75 | | ... | [Ref] RFC1027.
76 | | ... | [Cfg] On DUT1 configure interface IPv4 address and proxy ARP
77 | | ... | for IP range.
78 | | ... | [Ver] Make TG send ARP request to DUT1 interface,
79 | | ... | verify if DUT1 sends correct ARP reply on behalf of machine which
80 | | ... | IP is from beginning of the IP range.
81 | | Given Path for 3-node testing is set
82 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
83 | | And Interfaces in 3-node path are up
84 | | ${dut1_to_tg_name}= | Get interface name | ${dut1_node} | ${dut1_to_tg}
85 | | ${tg_to_dut1_name}= | Get interface name | ${tg_node} | ${tg_to_dut1}
86 | | When Set Interface Address | ${dut1_node}
87 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
88 | | And Vpp Add Proxy ARP | ${dut1_node} | ${lo_ip4_addr} | ${hi_ip4_addr}
89 | | And Vpp Proxy ARP Interface Enable | ${dut1_node} | ${dut1_to_tg_name}
90 | | Then Send ARP Request | ${tg_node} | ${tg_to_dut1_name}
91 | | ...                   | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
92 | | ...                   | ${tg_to_dut1_ip} | ${pass_test_lo_ip}
93
94 | TC03: DUT sends ARP reply on behalf of another machine from end of the IP range
95 | | [Documentation]
96 | | ... | [Top] TG-DUT1.
97 | | ... | [Ref] RFC1027.
98 | | ... | [Cfg] On DUT1 configure interface IPv4 address and proxy ARP
99 | | ... | for IP range.
100 | | ... | [Ver] Make TG send ARP request to DUT1 interface,
101 | | ... | verify if DUT1 sends correct ARP reply on behalf of machine which
102 | | ... | IP is from end of the IP range.
103 | | Given Path for 3-node testing is set
104 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
105 | | And Interfaces in 3-node path are up
106 | | ${dut1_to_tg_name}= | Get interface name | ${dut1_node} | ${dut1_to_tg}
107 | | ${tg_to_dut1_name}= | Get interface name | ${tg_node} | ${tg_to_dut1}
108 | | When Set Interface Address | ${dut1_node}
109 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
110 | | And Vpp Add Proxy ARP | ${dut1_node} | ${lo_ip4_addr} | ${hi_ip4_addr}
111 | | And Vpp Proxy ARP Interface Enable | ${dut1_node} | ${dut1_to_tg_name}
112 | | Then Send ARP Request | ${tg_node} | ${tg_to_dut1_name}
113 | | ...                   | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
114 | | ...                   | ${tg_to_dut1_ip} | ${pass_test_hi_ip}
115
116 | TC04: DUT does not send ARP reply on behalf of another machine from below of the IP range
117 | | [Documentation]
118 | | ... | [Top] TG-DUT1.
119 | | ... | [Ref] RFC1027.
120 | | ... | [Cfg] On DUT1 configure interface IPv4 address and proxy ARP
121 | | ... | for IP range.
122 | | ... | [Ver] Make TG send ARP request to DUT1 interface,
123 | | ... | verify if DUT1 does not send ARP reply on behalf of machine which
124 | | ... | IP is from below of the IP range.
125 | | Given Path for 3-node testing is set
126 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
127 | | And Interfaces in 3-node path are up
128 | | ${dut1_to_tg_name}= | Get interface name | ${dut1_node} | ${dut1_to_tg}
129 | | ${tg_to_dut1_name}= | Get interface name | ${tg_node} | ${tg_to_dut1}
130 | | When Set Interface Address | ${dut1_node}
131 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
132 | | And Vpp Add Proxy ARP | ${dut1_node} | ${lo_ip4_addr} | ${hi_ip4_addr}
133 | | And Vpp Proxy ARP Interface Enable | ${dut1_node} | ${dut1_to_tg_name}
134 | | Then Send ARP Request should failed | ${tg_node} | ${tg_to_dut1_name}
135 | | ...                                 | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
136 | | ...                                 | ${tg_to_dut1_ip} | ${fail_test_lo_ip}
137
138 | TC05: DUT does not send ARP reply on behalf of another machine from above of the IP range
139 | | [Documentation]
140 | | ... | [Top] TG-DUT1.
141 | | ... | [Ref] RFC1027.
142 | | ... | [Cfg] On DUT1 configure interface IPv4 address and proxy ARP
143 | | ... | for IP range.
144 | | ... | [Ver] Make TG send ARP request to DUT1 interface,
145 | | ... | verify if DUT1 does not send ARP reply on behalf of machine which
146 | | ... | IP is from above of the IP range.
147 | | Given Path for 3-node testing is set
148 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
149 | | And Interfaces in 3-node path are up
150 | | ${dut1_to_tg_name}= | Get interface name | ${dut1_node} | ${dut1_to_tg}
151 | | ${tg_to_dut1_name}= | Get interface name | ${tg_node} | ${tg_to_dut1}
152 | | When Set Interface Address | ${dut1_node}
153 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
154 | | And Vpp Add Proxy ARP | ${dut1_node} | ${lo_ip4_addr} | ${hi_ip4_addr}
155 | | And Vpp Proxy ARP Interface Enable | ${dut1_node} | ${dut1_to_tg_name}
156 | | Then Send ARP Request should failed | ${tg_node} | ${tg_to_dut1_name}
157 | | ...                                 | ${tg_to_dut1_mac} | ${dut1_to_tg_mac}
158 | | ...                                 | ${tg_to_dut1_ip} | ${fail_test_hi_ip}