CSIT-562 HC Test: Persistence suite rework, part1
[csit.git] / resources / libraries / robot / honeycomb / dhcp.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 | Library | resources.libraries.python.honeycomb.DHCP.DHCPRelayKeywords
16 | Library | resources.libraries.python.Dhcp.DhcpProxy
17 | Documentation | Keywords used to test Honeycomb DHCP features.
18
19 *** Keywords ***
20 | DHCP relay Operational Data From Honeycomb Should Be empty
21 | | [Documentation] | Uses Honeycomb API to retrieve DHCP relay configuration\
22 | | ... | and expects to fail.
23 | | ...
24 | | ... | *Arguments:*
25 | | ... | - node - information about a DUT node. Type: dictionary
26 | | ...
27 | | ... | *Example:*
28 | | ...
29 | | ... | \| DHCP relay Operational Data From Honeycomb Should Be empty \
30 | | ... | \| ${nodes['DUT1']} \|
31 | | [Arguments] | ${node}
32 | | Run keyword and expect error | *Status code: 404*
33 | | ... | Get DHCP relay oper data | ${node}
34
35 | Log DHCP relay configuration from VAT
36 | | [Documentation] | Uses VAT to retrieve DHCP relay configuration from VPP.
37 | | ...
38 | | ... | *Arguments:*
39 | | ... | - node - information about a DUT node. Type: dictionary
40 | | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type: string
41 | | ...
42 | | ... | *Example:*
43 | | ...
44 | | ... | \| Log DHCP relay configuration from VAT \
45 | | ... | \| ${nodes['DUT1']} \| ipv4 \|
46 | | [Arguments] | ${node} | ${ip_version}
47 | | VPP get DHCP proxy | ${node} | ${ip_version}
48
49 | Honeycomb configures DHCP relay
50 | | [Documentation] | Uses Honeycomb API to configure DHCP relay.
51 | | ...
52 | | ... | *Arguments:*
53 | | ... | - node - information about a DUT node. Type: dictionary
54 | | ... | - data - settings for the DHCP relay. Type: dictionary
55 | | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type: string
56 | | ... | - vrf - vrf ID to configure DHCP on. Type: integer
57 | | ...
58 | | ... | *Example:*
59 | | ...
60 | | ... | \| Honeycomb configures DHCP relay \| ${nodes['DUT1']} \| ${data} \
61 | | ... | \| ipv4 \| ${0} \|
62 | | [Arguments] | ${node} | ${data} | ${ip_version} | ${vrf}
63 | | Add DHCP relay | ${node} | ${data} | ${ip_version} | ${vrf}
64
65 | Honeycomb clears DHCP relay configuration
66 | | [Documentation] | Uses Honeycomb API to delete all configured DHCP relays.
67 | | ...
68 | | ... | *Arguments:*
69 | | ... | - node - information about a DUT node. Type: dictionary
70 | | ...
71 | | ... | *Example:*
72 | | ...
73 | | ... | \| Honeycomb clears DHCP relay configuration \| ${nodes['DUT1']} \|
74 | | [Arguments] | ${node}
75 | | Clear DHCP relay configuration | ${node}
76
77 | DHCP relay configuration from Honeycomb should contain
78 | | [Documentation] | Retrieves oper data for DHCP relay and compares\
79 | | ... | with provided values.
80 | | ...
81 | | ... | *Arguments:*
82 | | ... | - node - information about a DUT node. Type: dictionary
83 | | ... | - data - expected DHCP relay settings. Type dictionary
84 | | ...
85 | | ... | *Example:*
86 | | ...
87 | | ... | \| DHCP relay configuration from Honeycomb should contain \
88 | | ... | \| ${nodes['DUT1']} \| ${data} \|
89 | | [Arguments] | ${node} | ${data}
90 | | ${oper_data}= | Get DHCP relay oper data | ${node}
91 | | ${oper_data}= | Set Variable | ${oper_data['relays']['relay'][0]}
92 | | Sort List | ${oper_data['server']}
93 | | Sort List | ${data['server']}
94 | | Should be equal | ${oper_data} | ${data}