FIB table add/delete
[csit.git] / tests / vpp / func / ip4 / 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/shared/default.robot
16 | Resource | resources/libraries/robot/shared/testing_path.robot
17 | Resource | resources/libraries/robot/features/dhcp_proxy.robot
18 | Resource | resources/libraries/robot/ip/ip4.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 | Set up functional test
22 | Test Teardown | Tear down functional test
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 Configure path in 2-node circular topology
54 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
55 | | And Set interfaces in 2-node circular topology 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 and check answer | ${tg_node} | ${tg_to_dut_if1}
67 | | ... | ${tg_to_dut_if2} | ${dhcp_server_ip} | ${tg_to_dut_if2_mac}
68 | | ... | ${client_ip} | ${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 Configure path in 2-node circular topology
78 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
79 | | And Set interfaces in 2-node circular topology 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 and check answer | ${tg_node} | ${tg_to_dut_if1}
91 | | ... | ${tg_to_dut_if2} | ${discover_src_ip} | ${valid_discover_dst_ip}
92 | | And DHCP DISCOVER should fail | ${tg_node} | ${tg_to_dut_if1}
93 | | ... | ${tg_to_dut_if2} | ${discover_src_ip} | ${invalid_discover_dst_ip}

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.