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

©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.