CSIT-564: Remove EXPECTED_FAILING tag from IPv4 + VLAN tests
[csit.git] / tests / vpp / func / ip4 / eth2p-ethip4-ip4base-ip4dhcpclient-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_client.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
21 | Test Setup | Set up functional test
22 | Test Teardown | Tear down functional test
23 | Documentation | *DHCPv4 Client related test cases*
24
25 *** Variables ***
26 | ${client_hostname}= | dhcp-client
27 | ${client_ip}= | 192.168.23.10
28 | ${client_mask}= | 255.255.255.0
29 | ${server_ip}= | 192.168.23.1
30 | ${own_xid}= | 11112222
31 | ${lease_time}= | ${15}
32
33 *** Test Cases ***
34 | TC01: VPP sends a DHCP DISCOVER
35 | | [Documentation] | Configure DHCPv4 client on interface to TG without
36 | | ... | hostname and check if DHCPv4 DISCOVER message contains all
37 | | ... | required fields with expected values.
38 | | ...
39 | | Given Configure path in 2-node circular topology
40 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
41 | | And Set interfaces in 2-node circular topology up
42 | | When Set DHCP client on Interface | ${dut_node} | ${dut_to_tg_if1}
43 | | Then Verify DHCP DISCOVER header | ${tg_node}
44 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac}
45
46 | TC02: VPP sends a DHCPv4 DISCOVER with hostname
47 | | [Documentation] | Configure DHCPv4 client on interface to TG with hostname
48 | | ... | and check if DHCPv4 DISCOVER message contains all required
49 | | ... | fields with expected values.
50 | | ...
51 | | Given Configure path in 2-node circular topology
52 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
53 | | And Set interfaces in 2-node circular topology up
54 | | When Set DHCP client on Interface | ${dut_node} | ${dut_to_tg_if1}
55 | | ... | ${client_hostname}
56 | | Then Verify DHCP DISCOVER header | ${tg_node}
57 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac} | ${client_hostname}
58
59 | TC03: VPP sends DHCPv4 REQUEST after OFFER
60 | | [Documentation] | Configure DHCPv4 client on interface to TG and check if
61 | | ... | DHCPv4 REQUEST message contains all required fields.
62 | | ...
63 | | Given Configure path in 2-node circular topology
64 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
65 | | And Set interfaces in 2-node circular topology up
66 | | And VPP Route Add | ${dut_node} | 255.255.255.255 | 32 | ${NONE} | local
67 | | ... | ${FALSE} | ${NONE}
68 | | When Set DHCP client on Interface | ${dut_node} | ${dut_to_tg_if1}
69 | | Then Verify DHCP REQUEST after OFFER | ${tg_node} | ${tg_to_dut_if1}
70 | | ... | ${tg_to_dut_if1_mac} | ${server_ip}
71 | | ... | ${dut_to_tg_if1_mac} | ${client_ip} | ${client_mask}
72
73 | TC04: VPP doesn't send DHCPv4 REQUEST after OFFER with wrong XID
74 | | [ Tags ] | EXPECTED_FAILING
75 | | [Documentation] | Configure DHCPv4 client on interface to TG. If server
76 | | ... | sends DHCPv4 OFFER with different XID as in DHCPv4
77 | | ... | DISCOVER, DHCPv4 REQUEST message shouldn't be sent.
78 | | ...
79 | | Given Configure path in 2-node circular topology
80 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
81 | | And Set interfaces in 2-node circular topology up
82 | | And VPP Route Add | ${dut_node} | 255.255.255.255 | 32 | ${NONE} | local
83 | | ... | ${FALSE} | ${NONE}
84 | | When Set DHCP client on Interface | ${dut_node} | ${dut_to_tg_if1}
85 | | Then Run Keyword And Expect Error | DHCP REQUEST Rx timeout
86 | | ... | Verify DHCP REQUEST after OFFER | ${tg_node} | ${tg_to_dut_if1}
87 | | ... | ${tg_to_dut_if1_mac} | ${server_ip}
88 | | ... | ${dut_to_tg_if1_mac} | ${client_ip} | ${client_mask}
89 | | ... | offer_xid=${own_xid}
90
91 | TC05: VPP honors DHCPv4 lease time
92 | | [Documentation] | Send IP configuration to the VPP client via DHCPv4.
93 | | ... | Address is checked with ICMP echo request and there should
94 | | ... | be no reply for echo request when lease has expired.
95 | | ...
96 | | Given Configure path in 2-node circular topology
97 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
98 | | And Set interfaces in 2-node circular topology up
99 | | And VPP Route Add | ${dut_node} | 255.255.255.255 | 32 | ${NONE} | local
100 | | ... | ${FALSE} | ${NONE}
101 | | When Set DHCP client on Interface | ${dut_node} | ${dut_to_tg_if1}
102 | | And Configure IP on client via DHCP
103 | | ... | ${tg_node} | ${tg_to_dut_if1}
104 | | ... | ${tg_to_dut_if1_mac} | ${server_ip}
105 | | ... | ${client_ip} | ${client_mask}
106 | | ... | ${lease_time}
107 | | And Add Arp On Dut | ${dut_node} | ${dut_to_tg_if1} | ${server_ip}
108 | | ... | ${tg_to_dut_if1_mac}
109 | | Then Send ICMP echo request and verify answer
110 | | ... | ${tg_node} | ${tg_to_dut_if1}
111 | | ... | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac} | ${client_ip}
112 | | ... | ${server_ip}
113 | | And Sleep | ${lease_time}
114 | | And Run Keyword And Expect Error | ICMP echo Rx timeout
115 | | ... | Send ICMP echo request and verify answer | ${tg_node}
116 | | ... | ${tg_to_dut_if1} | ${dut_to_tg_if1_mac} | ${tg_to_dut_if1_mac}
117 | | ... | ${client_ip} | ${server_ip}