centreon-plugins/tests/apps/protocols/http/collection-centreon-web.robot
omercier fe90a52295
new(tests): initiated unit tests (#5138)
Co-authored-by: May <110405507+mushroomempires@users.noreply.github.com>
Co-authored-by: Paul Oureib <poureib@centreon.com>

REFS: CTOR-805
2024-08-16 09:34:33 +02:00

34 lines
1.7 KiB
Plaintext

*** Settings ***
Documentation Collections of HTTP Protocol plugin testing a mock of Centreon-web API
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon
Test Timeout 120s
*** Variables ***
${MOCKOON_JSON} ${CURDIR}${/}collection-centreon-web.mockoon.json
${CMD} ${CENTREON_PLUGINS} --plugin=apps::protocols::http::plugin
... --mode collection
... --constant='hostname=${HOSTNAME}'
... --constant='protocol=http'
... --constant='port=${APIPORT}'
... --constant='username=admin'
... --constant='password=myPassword'
*** Test Cases ***
Check if ${test_desc} on Centreon
[Tags] centreon collections http
${command} Catenate
... ${CMD} --config=${CURDIR}/${collection}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: test_desc collection expected_result --
... authentication succeeds collection-centreon-web-check-auth.collection.json OK: Authentication resulted in 200 HTTP code
... hosts are down collection-centreon-web-check-down-hosts.collection.json OK: All hosts are UP | 'hostsRequest.down.count'=0;0;;0;1
... commands are broken collection-centreon-web-check-broken-commands.collection.json WARNING:${SPACE} - Service FakeHostThatIsDown/Svc-BadCommand output is '(Execute command failed)' | 'commands.broken.count'=1;0;;0;