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