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