| 1 |
*** Settings *** |
| 2 |
Documentation HPE Primera Storage REST API |
| 3 |
|
| 4 |
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource |
| 5 |
|
| 6 |
Suite Setup Start Mockoon ${MOCKOON_JSON} |
| 7 |
Suite Teardown Stop Mockoon |
| 8 |
Test Timeout 120s |
| 9 |
|
| 10 |
*** Variables *** |
| 11 |
${MOCKOON_JSON} ${CURDIR}${/}hpe-primera.mockoon.json |
| 12 |
${HOSTNAME} 127.0.0.1 |
| 13 |
${APIPORT} 3000 |
| 14 |
${CMD} ${CENTREON_PLUGINS} |
| 15 |
... --plugin=storage::hp::primera::restapi::plugin |
| 16 |
... --mode=nodes |
| 17 |
... --hostname=${HOSTNAME} |
| 18 |
... --api-username=toto |
| 19 |
... --api-password=toto |
| 20 |
... --proto=http |
| 21 |
... --port=${APIPORT} |
| 22 |
... --custommode=api |
| 23 |
|
| 24 |
*** Test Cases *** |
| 25 |
Nodes ${tc} |
| 26 |
[Tags] storage api hpe hp |
| 27 |
${output} Run ${CMD} ${extraoptions} |
| 28 |
|
| 29 |
${output} Strip String ${output} |
| 30 |
|
| 31 |
Should Be Equal As Strings |
| 32 |
... ${output} |
| 33 |
... ${expected_result} |
| 34 |
... Wrong output result for command:\n${CMD} ${extraoptions}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n |
| 35 |
... values=False |
| 36 |
... collapse_spaces=True |
| 37 |
|
| 38 |
Examples: tc extraoptions expected_result -- |
| 39 |
... 1 ${EMPTY} WARNING: node 0 is offline | 'nodes.total.count'=2;;;0; 'nodes.online.count'=1;;;0;2 'nodes.offline.count'=1;;;0;2 |
| 40 |
... 2 --warning-node-status='${PERCENT}\\{status\\} ne "offline"' WARNING: node 1 is online | 'nodes.total.count'=2;;;0; 'nodes.online.count'=1;;;0;2 'nodes.offline.count'=1;;;0;2 |
| 41 |
... 3 --warning-online=2:2 WARNING: Number of online nodes: 1 - node 0 is offline | 'nodes.total.count'=2;;;0; 'nodes.online.count'=1;2:2;;0;2 'nodes.offline.count'=1;;;0;2 |
| 42 |
... 4 --critical-online=2:2 CRITICAL: Number of online nodes: 1 WARNING: node 0 is offline | 'nodes.total.count'=2;;;0; 'nodes.online.count'=1;;2:2;0;2 'nodes.offline.count'=1;;;0;2 |
| 43 |
... 5 --critical-offline=0:0 CRITICAL: Number of offline nodes: 1 WARNING: node 0 is offline | 'nodes.total.count'=2;;;0; 'nodes.online.count'=1;;;0;2 'nodes.offline.count'=1;;0:0;0;2 |