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