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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
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.
21 | NSH Operational Data From Honeycomb Should Be empty
22 | | [Documentation] | Uses Honeycomb API to retrieve NSH configuration\
23 | | ... | and expects to fail.
25 | | ... | *Arguments:*
26 | | ... | - node - information about a DUT node. Type: dict
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}
36 | Honeycomb adds NSH entry
37 | | [Documentation] | Uses Honeycomb API to configure an NSH entry.
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
46 | | ... | \| Honeycomb configures NSH entry \| ${nodes['DUT1']} \| nsh_1 \
47 | | ... | \| ${data} \|
48 | | [Arguments] | ${node} | ${name} | ${data}
49 | | Add NSH entry | ${node} | ${name} | ${data}
51 | Honeycomb removes NSH entry
52 | | [Documentation] | Uses Honeycomb API to delete the specified NSH entry.
54 | | ... | *Arguments:*
55 | | ... | - node - information about a DUT node. Type: dict
56 | | ... | - name - name of the NSH entry to be deleted. Type: string
60 | | ... | \| Honeycomb removes NSH entry \| ${nodes['DUT1']} \| nsh_1 \|
61 | | [Arguments] | ${node} | ${name}
62 | | Remove NSH entry | ${node} | ${name}
64 | Honeycomb adds NSH map
65 | | [Documentation] | Uses Honeycomb API to configure an NSH map.
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
74 | | ... | \| Honeycomb configures NSH map \| ${nodes['DUT1']} \| nsh_1 \
75 | | ... | \| ${data} \|
76 | | [Arguments] | ${node} | ${name} | ${data}
77 | | Add NSH map | ${node} | ${name} | ${data}
79 | Honeycomb removes NSH map
80 | | [Documentation] | Uses Honeycomb API to delete an NSH map.
82 | | ... | *Arguments:*
83 | | ... | - node - information about a DUT node. Type: dict
84 | | ... | - name - name of the NSH map to be deleted. Type: string
88 | | ... | \| Honeycomb removes NSH map \| ${nodes['DUT1']} \| nsh_1 \|
89 | | [Arguments] | ${node} | ${name}
90 | | Remove NSH map | ${node} | ${name}
92 | NSH entry from Honeycomb should be
93 | | [Documentation] | Retrieves oper data for NSH entry and compares\
94 | | ... | with provided values.
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
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}
109 | NSH map from Honeycomb should be
110 | | [Documentation] | Retrieves oper data for NSH map and compares\
111 | | ... | with provided values.
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
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}
126 | NSH map from Honeycomb should not exist
127 | | [Documentation] | Retrieves oper data for NSH map and expects to fail.
129 | | ... | *Arguments:*
130 | | ... | - node - information about a DUT node. Type: dict
131 | | ... | - name - name of the NSH map. Type: string
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}
141 | Honeycomb clears NSH configuration
142 | | [Documentation] | Uses Honeycomb API to remove all NSH settings.
144 | | [Arguments] | ${node}
145 | | Clear NSH settings | ${node}