Func test reorg - decrease exec time per vpp patch
[csit.git] / tests / func / dhcp / eth2p-ethip4-ip4base-ip4dhcpproxy-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/default.robot
16 | Resource | resources/libraries/robot/testing_path.robot
17 | Resource | resources/libraries/robot/dhcp_proxy.robot
18 | Resource | resources/libraries/robot/ipv4.robot
19 | Library | resources.libraries.python.Trace
20 | Force Tags | HW_ENV | VM_ENV | 3_NODE_DOUBLE_LINK_TOPO | SKIP_VPP_PATCH
21 | Test Setup | Func Test Setup
22 | Test Teardown | Func Test Teardown
23 | Documentation | *DHCPv4 proxy test cases*
24 | ...
25 | ... | *[Top] Network Topologies:* TG = DUT
26 | ... |        with two links between the nodes.
27 | ... | *[Enc] Packet Encapsulations:* Eth-IPv4-UDP-BOOTP-DHCP
28 | ... | *[Cfg] DUT configuration:* DUT is configured with DHCPv4 proxy.
29 | ... | *[Ver] TG verification:* Test DHCPv4 packets are sent
30 | ... |        on TG on first link to DUT and received on TG on second link.
31 | ... |        On receive TG verifies if DHCPv4 packets are valid.
32
33 *** Variables ***
34 | ${dut_to_tg_if1_ip}= | 172.16.0.1
35 | ${dut_to_tg_if2_ip}= | 192.168.0.1
36 | ${dhcp_server_ip}= | 192.168.0.100
37 | ${client_ip}= | 172.16.0.2
38 | ${prefix_length}= | 24
39
40 | ${discover_src_ip}= | 0.0.0.0
41 | ${valid_discover_dst_ip}= | 255.255.255.255
42 | ${invalid_discover_dst_ip}= | 255.255.255.1
43
44 *** Test Cases ***
45 | TC01: VPP proxies valid DHCPv4 request to DHCPv4 server
46 | | [Documentation] |
47 | | ... | [Top] TG=DUT \
48 | | ... | [Enc] Eth-IPv4-UDP-BOOTP-DHCP
49 | | ... | [Cfg] On DUT setup DHCPv4 proxy.
50 | | ... | [Ver] Make TG verify matching DHCPv4 packets between client and DHCPv4
51 | | ... | server through DHCP proxy.
52 | | ...
53 | | Given Path for 2-node testing is set
54 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
55 | | And Interfaces in 2-node path are up
56 | | And VPP Route Add | ${dut_node} | 255.255.255.255 | 32 | ${NONE} | local
57 | | ... | ${FALSE} | ${NONE}
58 | | And Set Interface Address | ${dut_node}
59 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_length}
60 | | And Set Interface Address | ${dut_node}
61 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_length}
62 | | And Add Arp On Dut | ${dut_node} | ${dut_to_tg_if2} | ${dhcp_server_ip}
63 | | ... | ${tg_to_dut_if2_mac}
64 | | When DHCP Proxy Config | ${dut_node} | ${dhcp_server_ip}
65 | | ... | ${dut_to_tg_if1_ip}
66 | | Then Send DHCP Messages | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2}
67 | | ... | ${dhcp_server_ip} | ${tg_to_dut_if2_mac} | ${client_ip}
68 | | ... | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_ip}
69
70 | TC02: VPP proxy ignores invalid DHCPv4 request
71 | | [Documentation] |
72 | | ... | [Top] TG=DUT \
73 | | ... | [Enc] Eth-IPv4-UDP-BOOTP-DHCP
74 | | ... | [Cfg] On DUT setup DHCPv4 proxy.
75 | | ... | [Ver] Make TG verify matching invalid DHCPv4 packets are dropped.
76 | | ...
77 | | Given Path for 2-node testing is set
78 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
79 | | And Interfaces in 2-node path are up
80 | | And VPP Route Add | ${dut_node} | 255.255.255.255 | 32 | ${NONE} | local
81 | | ... | ${FALSE} | ${NONE}
82 | | And Set Interface Address | ${dut_node}
83 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_length}
84 | | And Set Interface Address | ${dut_node}
85 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_length}
86 | | And Add Arp On Dut | ${dut_node} | ${dut_to_tg_if2} | ${dhcp_server_ip}
87 | | ... | ${tg_to_dut_if2_mac}
88 | | When DHCP Proxy Config | ${dut_node} | ${dhcp_server_ip}
89 | | ... | ${dut_to_tg_if1_ip}
90 | | Then Send DHCP DISCOVER | ${tg_node} | ${tg_to_dut_if1}
91 | | ... | ${tg_to_dut_if2} | ${discover_src_ip} | ${valid_discover_dst_ip}
92 | | And Send DHCP DISCOVER should fail | ${tg_node} | ${tg_to_dut_if1}
93 | | ... | ${tg_to_dut_if2} | ${discover_src_ip} | ${invalid_discover_dst_ip}