10b59ca0024a44d3102fb86d127659f51808fac2
[csit.git] / tests / honeycomb / func / mgmt-cfg-dhcp-apihc-apivat-func.robot
1 # Copyright (c) 2019 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/honeycomb/honeycomb.robot
19 | Resource | resources/libraries/robot/honeycomb/interfaces.robot
20 | Resource | resources/libraries/robot/honeycomb/dhcp.robot
21 | Library | resources.libraries.python.Trace
22 | Library | resources.libraries.python.IPv4Setup
23 | Library | resources.libraries.python.IPv6Setup
24 | Library | resources.libraries.python.IPv6Util
25 | Library | resources.libraries.python.Routing
26 | Variables | resources/test_data/honeycomb/dhcp_relay.py
27 | ...
28 | ...
29 | Documentation | *Honeycomb DHCP relay test suite.*
30 | ...
31 | Suite Setup | Set Up Honeycomb Functional Test Suite | ${node}
32 | ...
33 | Suite Teardown | Tear Down Honeycomb Functional Test Suite | ${node}
34 | ...
35 | Force Tags | HC_FUNC
36
37 *** Test Cases ***
38 | TC01: Honeycomb can configure DHCP relay entry
39 | | [Documentation]
40 | | ... | [Top] TG=DUT1=TG.
41 | | ... | [Enc] Eth-IPv4-DHCP.
42 | | ... | [Cfg] (Using Honeycomb API) On DUT1 configure IP addresses\
43 | | ... | neighbors and configure DHCP relay.
44 | | ... | [Ver] Send DHCP packets from TG interface to DUT. Receive all packets\
45 | | ... | on the second TG interface and verify required fields.
46 | | ...
47 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
48 | | ... | AND | Log DHCP relay configuration from VAT | ${node} | ipv4
49 | | ...
50 | | Given DHCP relay Operational Data From Honeycomb Should Be empty | ${node}
51 | | When Honeycomb configures DHCP relay | ${node} | ${relay1} | ipv4 | ${0}
52 | | Then DHCP relay configuration from Honeycomb should contain
53 | | ... | ${node} | ${relay1_oper}
54 | | When DHCP relay test setup
55 | | Then Send DHCP messages and check answer | ${tg_node} | ${tg_to_dut_if1}
56 | | ... | ${tg_to_dut_if2} | ${dhcp_server1_ip} | ${tg_to_dut_if2_mac}
57 | | ... | ${client_ip} | ${tg_to_dut_if1_mac} | ${dut_to_tg_if1_ip}
58
59 | TC02: Honeycomb can remove DHCP relay entry
60 | | [Documentation] | Remove DHCP relay configuration, and verify that\
61 | | ... | it was removed.
62 | | ...
63 | | Given DHCP relay configuration from Honeycomb should contain
64 | | ... | ${node} | ${relay1_oper}
65 | | When Honeycomb clears DHCP relay configuration | ${node}
66 | | Then DHCP relay Operational Data From Honeycomb Should Be empty | ${node}
67
68 | TC03: Honeycomb can configure multiple DHCP relay servers.
69 | | [Documentation] | Configure multiple DHCP relay servers and verify\
70 | | ... | their configuration using operational data.
71 | | ...
72 | | [Teardown] | Honeycomb clears DHCP relay configuration | ${node}
73 | | ...
74 | | Given DHCP relay Operational Data From Honeycomb Should Be empty | ${node}
75 | | And Honeycomb configures DHCP relay | ${node} | ${relay2} | ipv4 | ${0}
76 | | Then DHCP relay configuration from Honeycomb should contain
77 | | ... | ${node} | ${relay2_oper}
78
79 | TC04: Honeycomb can configure DHCP relay entry with ipv6
80 | | [Documentation]
81 | | ... | [Top] TG=DUT1=TG.
82 | | ... | [Enc] Eth-IPv6-DHCPv6.
83 | | ... | [Cfg] (Using Honeycomb API) On DUT1 configure IP addresses\
84 | | ... | neighbors and configure DHCP relay.
85 | | ... | [Ver] Send DHCPv6 packets from TG interface to DUT. Receive all\
86 | | ... | packets on the second TG interface and verify required fields.
87 | | ...
88 | | [Teardown] | Run Keywords | Show Packet Trace on All DUTs | ${nodes}
89 | | ... | AND | Log DHCP relay configuration from VAT | ${node} | ipv6
90 | | ... | AND | Honeycomb clears DHCP relay configuration | ${node}
91 | | ...
92 | | Given DHCP relay Operational Data From Honeycomb Should Be empty | ${node}
93 | | When Honeycomb configures DHCP relay | ${node} | ${relay_v6} | ipv6 | ${0}
94 | | Then DHCP relay configuration from Honeycomb should contain
95 | | ... | ${node} | ${relay_v6_oper}
96 | | When DHCP relay test setup IPv6
97 | | Then Send DHCPv6 Messages | ${tg_node} | ${tg_to_dut_if1} | ${tg_to_dut_if2}
98 | | ... | ${dut_to_tg_if1_ip6} | ${dut_to_tg_if1_mac} | ${dhcp_server_ip6}
99 | | ... | ${tg_to_dut_if2_mac} | ${tg_to_dut_if1_mac} |  ${dut_to_tg_if2_mac}
100
101 *** Keywords ***
102 | DHCP relay test setup
103 | | Configure path in 2-node circular topology
104 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
105 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1} | up
106 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2} | up
107 | | Honeycomb sets interface IPv4 address with prefix | ${dut_node}
108 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip} | ${prefix_length}
109 | | Honeycomb sets interface IPv4 address with prefix | ${dut_node}
110 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip} | ${prefix_length}
111 | | Add ARP on DUT | ${dut_node} | ${dut_to_tg_if2} | ${dhcp_server1_ip}
112 | | ... | ${tg_to_dut_if2_mac}
113 | | Add ARP on DUT | ${dut_node} | ${dut_to_tg_if2} | ${dhcp_server2_ip}
114 | | ... | ${tg_to_dut_if2_mac}
115 | | And VPP Route Add | ${dut_node} | 255.255.255.255 | 32 | gateway=${NONE}
116 | | ... | interface=local | use_sw_index=${FALSE} | resolve_attempts=${NONE}
117
118 | DHCP relay test setup IPv6
119 | | Configure path in 2-node circular topology
120 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['TG']}
121 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if1} | up
122 | | Honeycomb configures interface state | ${dut_node} | ${dut_to_tg_if2} | up
123 | | And Vpp All Ra Suppress Link Layer | ${nodes}
124 | | Honeycomb sets interface IPv6 address | ${dut_node}
125 | | ... | ${dut_to_tg_if1} | ${dut_to_tg_if1_ip6} | ${prefix_length_v6}
126 | | Honeycomb sets interface IPv6 address | ${dut_node}
127 | | ... | ${dut_to_tg_if2} | ${dut_to_tg_if2_ip6} | ${prefix_length_v6}
128 | | And Add IP Neighbor | ${dut_node} | ${dut_to_tg_if2} | ${dhcp_server_ip6}
129 | | ... | ${tg_to_dut_if2_mac}
130 | | And VPP Route Add | ${dut_node} | ff02::1:2 | 128 | gateway=${NONE}
131 | | ... | interface=local | use_sw_index=${FALSE} | resolve_attempts=${NONE}