| 1 |
*** Settings *** |
| 2 |
Documentation Check Iplabel scenarios |
| 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 |
|
| 11 |
*** Variables *** |
| 12 |
${MOCKOON_JSON} ${CURDIR}${/}monitoring-iplabel-ekara.json |
| 13 |
${cmd} ${CENTREON_PLUGINS} |
| 14 |
... --plugin=apps::monitoring::iplabel::ekara::restapi::plugin |
| 15 |
... --hostname=localhost |
| 16 |
... --api-username='username' |
| 17 |
... --api-password='password' |
| 18 |
... --port='3000' |
| 19 |
... --proto='http' |
| 20 |
|
| 21 |
*** Test Cases *** |
| 22 |
scenario ${tc} |
| 23 |
[Documentation] Check Iplabel scenarios |
| 24 |
[Tags] monitoring iplabel restapi |
| 25 |
|
| 26 |
${command} Catenate |
| 27 |
... ${cmd} |
| 28 |
... --mode=scenarios |
| 29 |
... ${extra_options} |
| 30 |
|
| 31 |
Ctn Run Command And Check Result As Strings ${command} ${expected_result} |
| 32 |
|
| 33 |
Examples: tc extra_options expected_result -- |
| 34 |
... 1 --filter-name='Centreon Demo Navigation|Centreon Demo ping NA' --output-ignore-perfdata CRITICAL: Scenario 'Centreon Demo Navigation': status: Failure (2) WARNING: Scenario 'Centreon Demo ping NA': status: Degraded (8) |
| 35 |
... 2 --filter-name='AKILA - Business App' OK: Scenario 'AKILA - Business App': status: Success (1), availability: 100%, time total all steps: 4280ms - All steps are ok | 'AKILA - Business App#scenario.availability.percentage'=100%;;;0;100 'AKILA - Business App#scenario.time.allsteps.total.milliseconds'=4280ms;;;0; 'AKILA - Business App~Dashboard 2#scenario.step.time.milliseconds'=898ms;;;0; 'AKILA - Business App~Dashboard 3#scenario.step.time.milliseconds'=848ms;;;0; 'AKILA - Business App~Run Chrome#scenario.step.time.milliseconds'=2534ms;;;0; |
| 36 |
... 3 --filter-name='wrong currentstatus.*' UNKNOWN: Scenario 'wrong currentstatus, no perfdata': status: Unknown (14) - No execution, please try again with a bigger timeframe |
| 37 |
... 4 --filter-name='not a scenario name' UNKNOWN: No scenario found |
| 38 |
... 5 --filter-id='127a149b.*' --warning-time-total='30' --output-ignore-perfdata WARNING: Scenario 'AKILA - (Browser Page Load)': Step: Default, last exec: 30-12-2024 10:30:00 UTC, time total: 1097 ms |
| 39 |
... 6 --filter-status='2' --output-ignore-perfdata CRITICAL: Scenario 'Centreon Demo Navigation': status: Failure (2) |
| 40 |
... 7 --filter-status='2' --filter-siteid='site' --filter-workspaceid='workspace' --output-ignore-perfdata CRITICAL: Scenario 'Centreon Demo Navigation': status: Failure (2) |
| 41 |
... 8 --filter-type='not a scenario type' UNKNOWN: No scenario found |
| 42 |
... 9 --api-password='Wrongpassword' --api-username='wrongUsername' UNKNOWN: Authentication endpoint returns error code 'Wrong email or password' (add --debug option for detailed message) |
| 43 |
# This scenario failed the second step. we show only the first step perfdata, and not the perfdata of the other step for another timestamp. |
| 44 |
... 10 --filter-name='AKILA - .Web.' CRITICAL: Scenario 'AKILA - (Web)': status: Failure (2) | 'AKILA - (Web)#scenario.availability.percentage'=45.76%;;;0;100 'AKILA - (Web)#scenario.time.allsteps.total.milliseconds'=4733ms;;;0; 'AKILA - (Web)~Home#scenario.step.time.milliseconds'=2851ms;;;0; |
| 45 |
# without any filter-name of filter-id, every scenario are taken into account of this type. |
| 46 |
... 11 --filter-type='WEB' --output-ignore-perfdata CRITICAL: Scenario 'AKILA - (Web)': status: Failure (2) - Scenario 'Centreon Demo Navigation': status: Failure (2) |
| 47 |
# Check the unknown default parameter. These scenario are not real and go to the same scenarioId, which is not possible in real life. |
| 48 |
... 12 --filter-name='unknown Status 0' --output-ignore-perfdata UNKNOWN: Scenario 'unknown Status 0': status: Unknown (0) |
| 49 |
... 13 --filter-name='unknown Status 3' --output-ignore-perfdata UNKNOWN: Scenario 'unknown Status 3': status: Aborted (3) |
| 50 |
... 14 --filter-name='unknown Status 4' --output-ignore-perfdata UNKNOWN: Scenario 'unknown Status 4': status: No execution (4) |
| 51 |
... 15 --filter-name='unknown Status 5' --output-ignore-perfdata UNKNOWN: Scenario 'unknown Status 5': status: No execution (5) |
| 52 |
... 16 --filter-name='unknown Status 6' --output-ignore-perfdata UNKNOWN: Scenario 'unknown Status 6': status: Stopped (6) |