HC Test: improve functional suite setup and teardown
[csit.git] / resources / libraries / robot / honeycomb / nsh.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 | Library | resources.libraries.python.InterfaceUtil
16 | Library | resources.libraries.python.honeycomb.HcAPIKwNSH.NSHKeywords
17 | Library | resources.libraries.python.honeycomb.HcAPIKwInterfaces.InterfaceKeywords
18 | Documentation | Keywords used to test Honeycomb NSH node.
19
20 *** Keywords ***
21 | NSH Operational Data From Honeycomb Should Be empty
22 | | [Documentation] | Uses Honeycomb API to retrieve NSH configuration\
23 | | ... | and expects to fail.
24 | | ...
25 | | ... | *Arguments:*
26 | | ... | - node - information about a DUT node. Type: dict
27 | | ...
28 | | ... | *Example:*
29 | | ...
30 | | ... | \| NSH Operational Data From Honeycomb Should Be empty \
31 | | ... | \| ${nodes['DUT1']} \|
32 | | [Arguments] | ${node}
33 | | Run keyword and expect error | *Status code: 404*
34 | | ... | Get NSH oper data | ${node}
35
36 | Honeycomb adds NSH entry
37 | | [Documentation] | Uses Honeycomb API to configure an NSH entry.
38 | | ...
39 | | ... | *Arguments:*
40 | | ... | - node - information about a DUT node. Type: dict
41 | | ... | - name - name for the NSH entry. Type: string
42 | | ... | - data - settings for the NSH entry. Type: dictionary
43 | | ...
44 | | ... | *Example:*
45 | | ...
46 | | ... | \| Honeycomb configures NSH entry \| ${nodes['DUT1']} \| nsh_1 \
47 | | ... | \| ${data} \|
48 | | [Arguments] | ${node} | ${name} | ${data}
49 | | Add NSH entry | ${node} | ${name} | ${data}
50
51 | Honeycomb removes NSH entry
52 | | [Documentation] | Uses Honeycomb API to delete the specified NSH entry.
53 | | ...
54 | | ... | *Arguments:*
55 | | ... | - node - information about a DUT node. Type: dict
56 | | ... | - name - name of the NSH entry to be deleted. Type: string
57 | | ...
58 | | ... | *Example:*
59 | | ...
60 | | ... | \| Honeycomb removes NSH entry \| ${nodes['DUT1']} \| nsh_1 \|
61 | | [Arguments] | ${node} | ${name}
62 | | Remove NSH entry | ${node} | ${name}
63
64 | Honeycomb adds NSH map
65 | | [Documentation] | Uses Honeycomb API to configure an NSH map.
66 | | ...
67 | | ... | *Arguments:*
68 | | ... | - node - information about a DUT node. Type: dict
69 | | ... | - name - name for the NSH map. Type: string
70 | | ... | - data - settings for the NSH map. Type: dictionary
71 | | ...
72 | | ... | *Example:*
73 | | ...
74 | | ... | \| Honeycomb configures NSH map \| ${nodes['DUT1']} \| nsh_1 \
75 | | ... | \| ${data} \|
76 | | [Arguments] | ${node} | ${name} | ${data}
77 | | Add NSH map | ${node} | ${name} | ${data}
78
79 | Honeycomb removes NSH map
80 | | [Documentation] | Uses Honeycomb API to delete an NSH map.
81 | | ...
82 | | ... | *Arguments:*
83 | | ... | - node - information about a DUT node. Type: dict
84 | | ... | - name - name of the NSH map to be deleted. Type: string
85 | | ...
86 | | ... | *Example:*
87 | | ...
88 | | ... | \| Honeycomb removes NSH map \| ${nodes['DUT1']} \| nsh_1 \|
89 | | [Arguments] | ${node} | ${name}
90 | | Remove NSH map | ${node} | ${name}
91
92 | NSH entry from Honeycomb should be
93 | | [Documentation] | Retrieves oper data for NSH entry and compares\
94 | | ... | with provided values.
95 | | ...
96 | | ... | *Arguments:*
97 | | ... | - node - information about a DUT node. Type: dict
98 | | ... | - name - name of the NSH entry. Type: string
99 | | ... | - data - expected NSH entry settings. Type dictionary
100 | | ...
101 | | ... | *Example:*
102 | | ...
103 | | ... | \| NSH entry from Honeycomb should be \| ${nodes['DUT1']} \| nsh_1 \
104 | | ... | \| ${data} \|
105 | | [Arguments] | ${node} | ${name} | ${data}
106 | | ${oper_data}= | Get NSH oper data | ${node} | entry_name=${name}
107 | | Compare data structures | ${oper_data} | ${data}
108
109 | NSH map from Honeycomb should be
110 | | [Documentation] | Retrieves oper data for NSH map and compares\
111 | | ... | with provided values.
112 | | ...
113 | | ... | *Arguments:*
114 | | ... | - node - information about a DUT node. Type: dict
115 | | ... | - name - name of the NSH map. Type: string
116 | | ... | - data - expected NSH map settings. Type dictionary
117 | | ...
118 | | ... | *Example:*
119 | | ...
120 | | ... | \| NSH map from Honeycomb should be \| ${nodes['DUT1']} \| nsh_1 \
121 | | ... | \| ${data} \|
122 | | [Arguments] | ${node} | ${name} | ${data}
123 | | ${oper_data}= | Get NSH oper data | ${node} | map_name=${name}
124 | | Compare data structures | ${oper_data} | ${data}
125
126 | NSH map from Honeycomb should not exist
127 | | [Documentation] | Retrieves oper data for NSH map and expects to fail.
128 | | ...
129 | | ... | *Arguments:*
130 | | ... | - node - information about a DUT node. Type: dict
131 | | ... | - name - name of the NSH map. Type: string
132 | | ...
133 | | ... | *Example:*
134 | | ...
135 | | ... | \| NSH map from Honeycomb should not exist \| ${nodes['DUT1']} \
136 | | ... | \| nsh_1 \|
137 | | [Arguments] | ${node} | ${name}
138 | | Run keyword and expect error | *Status code: 404*
139 | | ... | Get NSH oper data | ${node} | map_name=${name}
140
141 | Honeycomb clears NSH configuration
142 | | [Documentation] | Uses Honeycomb API to remove all NSH settings.
143 | | ...
144 | | [Arguments] | ${node}
145 | | Clear NSH settings | ${node}