CSIT-424: HC Test: JSON comparison function rework
[csit.git] / resources / libraries / robot / honeycomb / honeycomb.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/honeycomb/HoneycombSetup.py
16 | Library | resources/libraries/python/honeycomb/HoneycombUtil.py
17 | Library | resources/libraries/python/honeycomb/HcPersistence.py
18
19 *** Keywords ***
20 | Setup Honeycomb service on DUTs
21 | | [Documentation] | *Setup environment for honeycomb testing.*
22 | | ...
23 | | ... | _Setup steps:_
24 | | ... | - 1. Login to each honeycomb node using ssh
25 | | ... | - 2. Startup honeycomb service
26 | | ... | - 3. Monitor service startup using HTTP GET request loop
27 | | ... | Expected sequence of HTTP replies:
28 | | ... | connection refused -> 404 -> 401 -> 503 or 500 -> 200 (pass)
29 | | ... | - 4. Configure honeycomb nodes using HTTP PUT request
30 | | ...
31 | | ... | _Arguments:_
32 | | ... | - duts - list of nodes to setup Honeycomb on
33 | | ...
34 | | ... | _Used global constants and variables:_
35 | | ... | - RESOURCES_TPL_HC - path to honeycomb templates directory
36 | | ... | - HTTPCodes - HTTP protocol status codes
37 | | ...
38 | | [Arguments] | @{duts}
39 | | Start honeycomb on DUTs | @{duts}
40 | | Wait until keyword succeeds | 4min | 15sec
41 | | ... | Check honeycomb startup state | @{duts}
42
43 | Stop honeycomb service on DUTs
44 | | [Documentation] | *Cleanup environment after honeycomb testing.*
45 | | ...
46 | | ... | _Teardown steps:_
47 | | ... | - 1. Login to each honeycomb node using ssh
48 | | ... | - 2. Stop honeycomb service
49 | | ... | - 3. Monitor service shutdown using HTTP GET request loop
50 | | ... | Expected sequence of HTTP replies:
51 | | ... | 200 -> 404 -> connection refused (pass)
52 | | ...
53 | | ... | _Arguments:_
54 | | ... | - duts - list of nodes to stop Honeycomb on
55 | | ...
56 | | ... | _Used global constants and variables:_
57 | | ... | - RESOURCES_TPL_HC - path to honeycomb templates directory
58 | | ... | - HTTPCodes - HTTP protocol status codes
59 | | ...
60 | | [Arguments] | @{duts}
61 | | Stop honeycomb on DUTs | @{duts}
62 | | Wait until keyword succeeds | 30sec | 5sec
63 | | ... | Check honeycomb shutdown state | @{duts}
64
65 | Clear persisted Honeycomb configuration
66 | | [Documentation] | *Delete saved configuration.*
67 | | ...
68 | | ... | *Arguments:*
69 | | ... | - duts - one or more nodes to clear persistence on. Type: dictionary
70 | | ...
71 | | ... | *Example:*
72 | | ...
73 | | ... | \| Clear persisted Honeycomb configuration \| ${nodes['DUT1']} \|
74 | | [Arguments] | @{duts}
75 | | Clear persisted Honeycomb config | @{duts}
76
77 | Restart Honeycomb and VPP and clear persisted configuration
78 | | [Documentation] | Restarts Honeycomb and VPP with default configuration.
79 | | ...
80 | | ... | *Arguments:*
81 | | ... | - node - information about a DUT node. Type: dictionary
82 | | ...
83 | | ... | *Example:*
84 | | ...
85 | | ... | \| Restart Honeycomb and VPP and clear persisted configuration \
86 | | ... | \| ${nodes['DUT1']} \|
87 | | [Arguments] | ${node}
88 | | Log | Performing clean restart of Honeycomb and VPP. | console=True
89 | | Stop Honeycomb service on DUTs | ${node}
90 | | Clear persisted Honeycomb configuration | ${node}
91 | | Setup DUT | ${node}
92 | | Setup Honeycomb service on DUTs | ${node}
93
94 | Archive Honeycomb log file
95 | | [Documentation] | Copy honeycomb.log file from Honeycomb node\
96 | | ... | to test executor.
97 | | ... | *Arguments:*
98 | | ... | - node - information about a DUT node. Type: dictionary
99 | | ...
100 | | ... | *Example:*
101 | | ...
102 | | ... | \| Archive Honeycomb log file \| ${nudes['DUT1']} \|
103 | | [Arguments] | ${node}
104 | | Archive Honeycomb log | ${node}