| 1 |
*** Settings *** |
| 2 |
|
| 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 |
Test Setup Ctn Cleanup Cache |
| 10 |
|
| 11 |
*** Variables *** |
| 12 |
${MOCKOON_JSON} ${CURDIR}${/}vmware8-restapi.mockoon.json |
| 13 |
|
| 14 |
${CMD} ${CENTREON_PLUGINS} --plugin=apps::vmware::vsphere8::esx::plugin |
| 15 |
... --mode=host-status |
| 16 |
... --password=C3POR2P2 |
| 17 |
... --username=obi-wan |
| 18 |
... --hostname=127.0.0.1 |
| 19 |
... --proto=http |
| 20 |
... --port=3000 |
| 21 |
|
| 22 |
*** Test Cases *** |
| 23 |
Host-Status ${tc} |
| 24 |
[Tags] apps api vmware vsphere8 esx |
| 25 |
${command} Catenate ${CMD} ${filter_host} ${extraoptions} |
| 26 |
${command_curl} Catenate ${command} --http-backend=curl |
| 27 |
${command_lwp} Catenate ${command} --http-backend=lwp |
| 28 |
Ctn Run Command And Check Result As Strings ${command_curl} ${expected_result} |
| 29 |
Ctn Run Command And Check Result As Strings ${command_lwp} ${expected_result} |
| 30 |
|
| 31 |
|
| 32 |
Examples: tc filter_host extraoptions expected_result -- |
| 33 |
... 1 --esx-name=esx1.acme.com ${EMPTY} OK: Host 'esx1.acme.com', id: 'host-22': power state is POWERED_ON, connection state is CONNECTED |
| 34 |
... 2 --esx-name=esx2.acme.com ${EMPTY} CRITICAL: Host 'esx2.acme.com', id: 'host-28': power state is POWERED_OFF |
| 35 |
... 3 --esx-name=esx3.acme.com ${EMPTY} CRITICAL: Host 'esx3.acme.com', id: 'host-35': connection state is DISCONNECTED |
| 36 |
... 4 --esx-id=host-35 --esx-name=esx3.acme.com CRITICAL: Host 'esx3.acme.com', id: 'host-35': connection state is DISCONNECTED |
| 37 |
... 5 --esx-name=nothing ${EMPTY} UNKNOWN: No ESX Host found. |
| 38 |
... 6 --esx-id=host-35 --esx-name=esx2.acme.com UNKNOWN: No ESX Host found. |
| 39 |
... 7 --esx-id=host-22 ${EMPTY} OK: Host 'esx1.acme.com', id: 'host-22': power state is POWERED_ON, connection state is CONNECTED |
| 40 |
... 8 --esx-id=host-28 ${EMPTY} CRITICAL: Host 'esx2.acme.com', id: 'host-28': power state is POWERED_OFF |
| 41 |
... 9 --esx-id=host-35 ${EMPTY} CRITICAL: Host 'esx3.acme.com', id: 'host-35': connection state is DISCONNECTED |
| 42 |
... 10 --esx-id=nothing ${EMPTY} UNKNOWN: No ESX Host found. |
| 43 |
... 11 --esx-id=host-28 --critical-power-status=0 OK: Host 'esx2.acme.com', id: 'host-28': power state is POWERED_OFF, connection state is CONNECTED |
| 44 |
... 12 --esx-id=host-35 --critical-connection-status=0 OK: Host 'esx3.acme.com', id: 'host-35': power state is POWERED_ON, connection state is DISCONNECTED |