mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-04-07 20:35:27 +02:00
CTOR-757-plugin-apps-automation-ansible-tower-tests (#5112)
This commit is contained in:
commit
f7deeba3c5
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
||||
log.html
|
||||
output.xml
|
||||
report.html
|
||||
report.html
|
||||
|
@ -39,7 +39,7 @@ sub new {
|
||||
'schedules' => 'apps::automation::ansible::tower::mode::schedules'
|
||||
};
|
||||
|
||||
$self->{custom_modes}->{api} = 'apps::automation::ansible::tower::custom::api';
|
||||
$self->{custom_modes}->{api} = 'apps::automation::ansible::tower::custom::api';
|
||||
$self->{custom_modes}->{towercli} = 'apps::automation::ansible::tower::custom::towercli';
|
||||
|
||||
return $self;
|
||||
|
@ -1,5 +1,6 @@
|
||||
*** Settings ***
|
||||
Documentation This is the documentation for the import resource file.
|
||||
Documentation This is the documentation for the import resource file.
|
||||
|
||||
Library Examples
|
||||
Library OperatingSystem
|
||||
Library String
|
||||
|
@ -1,12 +1,19 @@
|
||||
*** Settings ***
|
||||
Documentation Centreon Plugins for Robot Framework
|
||||
|
||||
Library Process
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CENTREON_PLUGINS} perl ${CURDIR}${/}..${/}..${/}src${/}centreon_plugins.pl
|
||||
${CENTREON_PLUGINS} perl ${CURDIR}${/}..${/}..${/}src${/}centreon_plugins.pl
|
||||
# one we use package, we need to remove the "perl" part to be sure the plugin is executable and is correctly formated
|
||||
# with a shebang at the top.
|
||||
${PERCENT} %
|
||||
${HOSTNAME} 127.0.0.1
|
||||
${APIPORT} 3000
|
||||
${SNMPPORT} 2024
|
||||
${SNMPVERSION} 2c
|
||||
${PERCENT} %
|
||||
|
||||
|
||||
*** Keywords ***
|
||||
Start Mockoon
|
||||
@ -19,5 +26,17 @@ Start Mockoon
|
||||
... --port
|
||||
... 3000
|
||||
Sleep 10s
|
||||
|
||||
Stop Mockoon
|
||||
Terminate All Processes
|
||||
Terminate All Processes
|
||||
|
||||
Ctn Run Command And Check Result As Strings
|
||||
[Arguments] ${command} ${expected_result}
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${expected_result}
|
||||
... ${output}
|
||||
... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n
|
||||
... values=False
|
||||
... collapse_spaces=True
|
@ -48,6 +48,7 @@
|
||||
ADSL
|
||||
ASAM
|
||||
Alcatel
|
||||
Ansible
|
||||
Avigilon
|
||||
Centreon
|
||||
cpu-utilization-1m
|
||||
@ -80,6 +81,7 @@ Netscaler
|
||||
OID
|
||||
PKCS1
|
||||
QoS
|
||||
RestAPI
|
||||
RRDCached
|
||||
SNMP
|
||||
SSH
|
||||
@ -134,6 +136,7 @@ total-offline-prct
|
||||
total-online-prct
|
||||
total-oper-down
|
||||
total-oper-up
|
||||
tower-cli
|
||||
uptime
|
||||
usage-prct
|
||||
userpass
|
||||
|
125
tests/robot/apps/automation/ansible/tower/ansible_tower.json
Normal file
125
tests/robot/apps/automation/ansible/tower/ansible_tower.json
Normal file
File diff suppressed because one or more lines are too long
33
tests/robot/apps/automation/ansible/tower/hosts.robot
Normal file
33
tests/robot/apps/automation/ansible/tower/hosts.robot
Normal file
@ -0,0 +1,33 @@
|
||||
*** Settings ***
|
||||
Documentation Check the hosts mode with api custom mode
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Start Mockoon ${MOCKOON_JSON}
|
||||
Suite Teardown Stop Mockoon
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${MOCKOON_JSON} ${CURDIR}${/}ansible_tower.json
|
||||
|
||||
${CMD} ${CENTREON_PLUGINS}
|
||||
... --plugin=apps::automation::ansible::tower::plugin
|
||||
... --custommode=api
|
||||
... --hostname=${HOSTNAME}
|
||||
... --username=username
|
||||
... --password=password
|
||||
... --port=${APIPORT}
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
Hosts ${tc}
|
||||
[Documentation] Check the number of returned hosts
|
||||
[Tags] apps automation ansible service-disco
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=hosts
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc snmpcommunity expected_result --
|
||||
... 1 os/linux/snmp/list-diskio OK: Hosts total: 10, failed: 0 - All hosts are ok | 'hosts.total.count'=10;;;0; 'hosts.failed.count'=0;;;0;10
|
47
tests/robot/apps/automation/ansible/tower/jobs.robot
Normal file
47
tests/robot/apps/automation/ansible/tower/jobs.robot
Normal file
@ -0,0 +1,47 @@
|
||||
*** Settings ***
|
||||
Documentation Check the jobs mode with api custom mode
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Start Mockoon ${MOCKOON_JSON}
|
||||
Suite Teardown Stop Mockoon
|
||||
Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${MOCKOON_JSON} ${CURDIR}${/}ansible_tower.json
|
||||
|
||||
${cmd} ${CENTREON_PLUGINS}
|
||||
... --plugin=apps::automation::ansible::tower::plugin
|
||||
... --custommode=api
|
||||
... --hostname=${HOSTNAME}
|
||||
... --username=username
|
||||
... --password=password
|
||||
... --port=${APIPORT}
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
jobs ${tc}
|
||||
[Documentation] Check the number of returned jobs
|
||||
[Tags] apps automation ansible jobs
|
||||
${command} Catenate
|
||||
... ${cmd}
|
||||
... --mode=jobs
|
||||
... ${extraoptions}
|
||||
Log ${cmd}
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc extraoptions expected_result --
|
||||
... 1 --filter-name='' OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2
|
||||
... 2 --filter-name=toto OK: Jobs total: 0, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=0;;;0; 'jobs.successful.count'=0;;;0;0 'jobs.failed.count'=0;;;0;0 'jobs.running.count'=0;;;0;0 'jobs.canceled.count'=0;;;0;0 'jobs.pending.count'=0;;;0;0 'jobs.default.count'=0;;;0;0
|
||||
... 3 --filter-name=toto --critical-total=1:1 CRITICAL: Jobs total: 0 | 'jobs.total.count'=0;;1:1;0; 'jobs.successful.count'=0;;;0;0 'jobs.failed.count'=0;;;0;0 'jobs.running.count'=0;;;0;0 'jobs.canceled.count'=0;;;0;0 'jobs.pending.count'=0;;;0;0 'jobs.default.count'=0;;;0;0
|
||||
... 4 --filter-name='' --critical-total=1:1 CRITICAL: Jobs total: 2 | 'jobs.total.count'=2;;1:1;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2
|
||||
... 5 --filter-name='' --critical-total=2:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;2:2;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2
|
||||
... 6 --critical-total=2:1 CRITICAL: Jobs total: 2 | 'jobs.total.count'=2;;2:1;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2
|
||||
... 7 --filter-name='' --display-failed-jobs OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2
|
||||
... 8 --filter-name='' --warning-total=1:1 WARNING: Jobs total: 2 | 'jobs.total.count'=2;1:1;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2
|
||||
... 9 --filter-name='' --warning-total=2:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;2:2;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2
|
||||
... 10 --filter-name=toto --warning-total=1:1 WARNING: Jobs total: 0 | 'jobs.total.count'=0;1:1;;0; 'jobs.successful.count'=0;;;0;0 'jobs.failed.count'=0;;;0;0 'jobs.running.count'=0;;;0;0 'jobs.canceled.count'=0;;;0;0 'jobs.pending.count'=0;;;0;0 'jobs.default.count'=0;;;0;0
|
||||
... 11 --warning-total=1:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;1:2;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2
|
||||
... 12 --warning-total=2:1 WARNING: Jobs total: 2 | 'jobs.total.count'=2;2:1;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2
|
||||
... 13 --critical-total=1:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;1:2;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2
|
@ -13,7 +13,8 @@ ${CMD} ${CENTREON_PLUGINS}
|
||||
... --command=cat
|
||||
... --command-path=/usr/bin
|
||||
... --no-ps
|
||||
... --command-options=nodeintegrationservice-2022.json
|
||||
... --command-options=${CURDIR}/nodeintegrationservice-2022.json
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
HyperV 2022 ${tc}/3
|
||||
@ -22,16 +23,9 @@ HyperV 2022 ${tc}/3
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --filter-vm='${filter_vm}'
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc filter_vm expected_result --
|
||||
... 1 ${EMPTY} CRITICAL: 1 problem(s) detected
|
||||
... 2 VSERVER05 OK: VM 'VSERVER05' 0 problem(s) detected - VM 'VSERVER05' 0 problem(s) detected
|
||||
... 3 VSERVER07 CRITICAL: VM 'VSERVER07' 1 problem(s) detected
|
||||
|
||||
|
@ -11,23 +11,23 @@ Test Timeout 120s
|
||||
*** Variables ***
|
||||
${MOCKOON_JSON} ${CURDIR}${/}collection-centreon-web.mockoon.json
|
||||
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin apps::protocols::http::plugin --mode collection
|
||||
... --constant='hostname=127.0.0.1' --constant='protocol=http' --constant='port=3000'
|
||||
... --constant='username=admin' --constant='password=myPassword'
|
||||
${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
|
||||
${output} Run
|
||||
... ${CMD} --config=${CURDIR}/${collection}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected}
|
||||
... Wrong output result:\n\n ${output}\nInstead of:\n ${expected}\n\n
|
||||
${command} Catenate
|
||||
... ${CMD} --config=${CURDIR}/${collection}
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: test_desc collection expected --
|
||||
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;
|
||||
|
@ -16,18 +16,13 @@ SNMP Collection - Sputnik Environment ${tc}/3
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=collection
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-version=2c
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=apps/protocols/snmp/collection-sputnik
|
||||
... --config=${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}src/contrib/collection/snmp/sputnik-environment.json
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... ${command}\nWrong output result for compliance of ${expected_result}{\n}Command output:{\n}${output}{\n}{\n}{\n}
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc expected_result --
|
||||
... 1 OK: Sensor '1' temperature is '20.06'°C and humidity is '33'% | '1#environment.temperature.celsius'=20.06C;;;; '1#environment.humidity.percent'=33%;;;0;100
|
||||
|
@ -9,40 +9,35 @@ Test Timeout 120s
|
||||
*** Variables ***
|
||||
${MOCKOON_JSON} ${CURDIR}${/}vault-authentication-hashicorp.json
|
||||
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin apps::protocols::snmp::plugin --hostname=127.0.0.1
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin apps::protocols::snmp::plugin --hostname=${HOSTNAME}
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
check hashicorp vault manager${Name}
|
||||
[Documentation] Check hashicorp vaultmanager
|
||||
[Tags] snmp vault
|
||||
${cmd_hashicorp} Catenate
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --pass-manager=hashicorpvault
|
||||
... --vault-address=127.0.0.1
|
||||
... --vault-port=3000
|
||||
... --vault-address=${HOSTNAME}
|
||||
... --vault-port=${APIPORT}
|
||||
... --vault-protocol=http
|
||||
... --auth-method=userpass
|
||||
... --auth-settings="username=hcvaultuser"
|
||||
... --secret-path="path/of/the/secret"
|
||||
... --snmp-port=2024
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --map-option="snmp_community=\\%{value_path/of/the/secret}"
|
||||
... --mode=string-value
|
||||
... --snmp-version=2c
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-community=apps/protocols/snmp/snmp-single-oid
|
||||
... --oid='.1.3.6.1.2.1.1.1.0' ${path-param}
|
||||
... --format-ok='current value is: \\%{details_ok}'
|
||||
... --format-details-warning='current value is: \\%{details_warning}'
|
||||
... --format-details-critical='current value is: \\%{details_critical}'
|
||||
${output} Run
|
||||
... ${cmd_hashicorp}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${result}
|
||||
... ${cmd_hashicorp}\n\n Wrong output result for hashicorp auth manager on snmp generic plugin, output got :\n${output} \nExpected : \n ${result}\n
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: Name path-param result --
|
||||
Examples: Name path-param expected_result --
|
||||
... default path --auth-path='' --auth-settings="password=secrethashicorpPassword" OK: current value is: Linux centreon-devbox 5.10.0-28-amd64 #1 SMP Debian 5.10.209-2 (2024-01-31) x86_64
|
||||
... wrong path --auth-path='specific-url' --auth-settings="password=secrethashicorpPassword" OK: current value is: Linux centreon-devbox 5.10.0-28-amd64 #1 SMP Debian 5.10.209-2 (2024-01-31) x86_64
|
||||
... wrong password --auth-path='' --auth-settings="password=WrongPassword" UNKNOWN: 401 Unauthorized
|
||||
|
@ -11,29 +11,30 @@ Test Timeout 120s
|
||||
*** Variables ***
|
||||
${MOCKOON_JSON} ${CURDIR}${/}cloud-azure-policyinsights-policystates.json
|
||||
|
||||
${LOGIN_ENDPOINT} http://localhost:3000/login
|
||||
${BASE_URL} http://${HOSTNAME}:${APIPORT}
|
||||
${LOGIN_ENDPOINT} ${BASE_URL}/login
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=cloud::azure::policyinsights::policystates::plugin --subscription=subscription --tenant=tenant --client-id=client_id --client-secret=secret --statefile-dir=/tmp/cache/ --login-endpoint=${LOGIN_ENDPOINT}
|
||||
|
||||
&{compliance_value1}
|
||||
... endpoint=http://localhost:3000/ok
|
||||
... endpoint=${BASE_URL}/ok
|
||||
... policyname=
|
||||
... resourcelocation=
|
||||
... resourcetype=
|
||||
... result=OK: Number of non compliant policies: 0 - All compliances states are ok | 'policies.non_compliant.count'=0;;;0;
|
||||
&{compliance_value2}
|
||||
... endpoint=http://localhost:3000/oknextlink
|
||||
... endpoint=${BASE_URL}/oknextlink
|
||||
... policyname=9daedab3-fb2d-461e-b861-71790eead4f6
|
||||
... resourcelocation=
|
||||
... resourcetype=
|
||||
... result=OK: Number of non compliant policies: 0 - All compliances states are ok | 'policies.non_compliant.count'=0;;;0;
|
||||
&{compliance_value3}
|
||||
... endpoint=http://localhost:3000/nok1
|
||||
... endpoint=${BASE_URL}/nok1
|
||||
... policyname=9daedab3-fb2d-461e-b861-71790eead4f6
|
||||
... resourcelocation=fr
|
||||
... resourcetype=
|
||||
... result=CRITICAL: Compliance state for policy '9daedab3-fb2d-461e-b861-71790eead4f6' on resource 'mypubip1' is 'NonCompliant' | 'policies.non_compliant.count'=1;;;0;
|
||||
&{compliance_value4}
|
||||
... endpoint=http://localhost:3000/nok2
|
||||
... endpoint=${BASE_URL}/nok2
|
||||
... policyname=9daedab3-fb2d-461e-b861-71790eead4f6
|
||||
... resourcelocation=fr
|
||||
... resourcetype=ip
|
||||
@ -62,10 +63,6 @@ Azure PolicyInsights PolicyStates compliance
|
||||
IF ${length} > 0
|
||||
${command} Catenate ${command} --resource-type=${compliance_value.resourcetype}
|
||||
END
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${compliance_value.result}
|
||||
... Wrong output result for compliance of ${compliance_value}.{\n}Command output:{\n}${output}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${compliance_value.result}
|
||||
END
|
||||
|
@ -10,8 +10,8 @@ Test Timeout 120s
|
||||
${CMD} ${CENTREON_PLUGINS}
|
||||
... --plugin=hardware::devices::camera::avigilon::snmp::plugin
|
||||
... --mode=memory
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
@ -24,12 +24,7 @@ Avigilon camera Memory ${tc}/3
|
||||
... --warning-available='${warning_available}'
|
||||
... --critical-available='${critical_available}'
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc warning_available critical_available expected_result --
|
||||
... 1 ${EMPTY} ${EMPTY} OK: total system memory available: 464.85 KB | 'memory.available'=476004B;;;0;
|
||||
|
@ -10,8 +10,8 @@ Test Timeout 120s
|
||||
${CMD} ${CENTREON_PLUGINS}
|
||||
... --plugin=hardware::devices::camera::avigilon::snmp::plugin
|
||||
... --mode=storage
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
@ -25,12 +25,7 @@ Avigilon camera Storage ${tc}/3
|
||||
... --critical-status='${critical_status}'
|
||||
... --unknown-status='${unknown_status}'
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc warning_status critical_status unknown_status expected_result --
|
||||
... 1 ${EMPTY} ${EMPTY} ${EMPTY} OK: state of the SD card: mediaNotPresent
|
||||
|
@ -10,8 +10,8 @@ Test Timeout 120s
|
||||
${CMD} ${CENTREON_PLUGINS}
|
||||
... --plugin=hardware::devices::camera::avigilon::snmp::plugin
|
||||
... --mode=temperature
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
@ -26,12 +26,7 @@ Avigilon camera Temperature ${tc}/5
|
||||
... --warning-status='${warning_status}'
|
||||
... --critical-status='${critical_status}'
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc warning_temperature critical_temperature warning_status critical_status expected_result --
|
||||
... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: temperature: 23.00 C, sensor 1 [type:mainSensor] status: ok | 'sensor.temperature.celsius'=23C;;;0;
|
||||
|
@ -7,9 +7,6 @@ Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${HOSTADDRESS} 127.0.0.1
|
||||
${SNMPPORT} 2024
|
||||
${SNMPVERSION} 2c
|
||||
${SNMPCOMMUNITY} hardware/kvm/avocent/acs/8000/avocent8000
|
||||
|
||||
|
||||
@ -93,7 +90,7 @@ Run Avocent 8000 Plugin
|
||||
... ${CENTREON_PLUGINS}
|
||||
... --plugin=hardware::kvm::avocent::acs::8000::snmp::plugin
|
||||
... --mode=${mode}
|
||||
... --hostname=${HOSTADDRESS}
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=${SNMPCOMMUNITY}
|
||||
|
@ -7,7 +7,7 @@ Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=hardware::sensors::apc::snmp::plugin --mode=sensors --hostname=127.0.0.1 --snmp-version=2c --snmp-port=2024
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=hardware::sensors::apc::snmp::plugin --mode=sensors --hostname=${HOSTNAME} --snmp-version=${SNMPVERSION} --snmp-port=${SNMPPORT}
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
@ -22,12 +22,7 @@ APC Sensors ${tc}/9
|
||||
${command} Append Option To Command ${command} --critical ${critical}
|
||||
${command} Append Option To Command ${command} --component ${component}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... Wrong output result for compliance of ${expected_result}{\n}Command output:{\n}${output}{\n}{\n}{\n}
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
# --component 'temperature' --warning='humidity,.,45:65' --critical='humidity,.,35:70'
|
||||
Examples: tc component warning critical expected_result --
|
||||
... 1 _empty_ _empty_ _empty_ OK: All 2 components are ok [2/2 temperatures]. | 'Main Module:Sonde de temperature#hardware.sensor.temperature.celsius'=23C;;;; 'Main Module:Sonde de temperature#hardware.sensor.humidity.percentage'=35%;;;0;100 'hardware.temperature.count'=2;;;;
|
||||
|
@ -16,9 +16,9 @@ Sputnik UPS - Environment ${tc}/9
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=environment
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-version=2c
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=hardware/ups/inmatics/sputnik/snmp/hardware-ups-sputnik
|
||||
|
||||
# Append options to command
|
||||
@ -33,12 +33,7 @@ Sputnik UPS - Environment ${tc}/9
|
||||
${opt} Append Option --filter-id ${filter_id}
|
||||
${command} Catenate ${command} ${opt}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... Wrong output result for compliance of ${expected_result}{\n}Command output:{\n}${output}{\n}{\n}{\n}
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc filter_id w_temperature c_temperature w_humidity c_humidity expected_result --
|
||||
... 1 1 30 50 50 70 OK: 'Sensor 1': temperature 20.06 C, humidity 33 % | 'Sensor 1#environment.temperature.celsius'=20.06C;0:30;0:50;; 'Sensor 1#environment.humidity.percentage'=33%;0:50;0:70;0;100
|
||||
|
@ -16,9 +16,9 @@ Battery ${tc}/4
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=battery
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-version=2c
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=hardware/ups/socomec/netvision/snmp/battery
|
||||
|
||||
# Append options to command
|
||||
@ -27,12 +27,7 @@ Battery ${tc}/4
|
||||
${opt} Append Option --critical-temperature ${c_temperature}
|
||||
${command} Catenate ${command} ${opt}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... ${command} \nWrong output result for compliance of ${expected_result}{\n}Command output:{\n}${output}{\n}{\n}{\n}
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc w_temperature c_temperature expected_result --
|
||||
... 1 30 50 OK: battery status is normal - charge remaining: 100% (0 minutes remaining) | 'battery.charge.remaining.percent'=100%;;;0;100 'battery.charge.remaining.minutes'=0;;;0; 'battery.voltage.volt'=339.1V;;;; 'battery.temperature.celsius'=22C;0:30;0:50;;
|
||||
|
@ -65,9 +65,9 @@ Hardware UPS Standard SNMP input lines
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=input-lines
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-version=2c
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=${ups_standard_test.snmpcommunity}
|
||||
${length} Get Length ${ups_standard_test.warningpower}
|
||||
IF ${length} > 0
|
||||
|
@ -7,7 +7,7 @@ Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::aruba::instant::snmp::plugin --mode=ap-usage --hostname=127.0.0.1 --snmp-version=2c --snmp-port=2024
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::aruba::instant::snmp::plugin --mode=ap-usage --hostname=${HOSTNAME} --snmp-version=${SNMPVERSION} --snmp-port=${SNMPPORT}
|
||||
|
||||
&{ap_usage_test_1}
|
||||
... documentation=Test AP usage without filters
|
||||
@ -66,10 +66,5 @@ Network Aruba Instant SNMP plugin
|
||||
... --snmp-community=${ap_usage_tc.snmpcommunity}
|
||||
|
||||
Log To Console ${command}
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${ap_usage_tc.result}
|
||||
... Wrong output result for compliance of ${ap_usage_tc.result}{\n}Command output:{\n}${output}{\n}{\n}{\n}
|
||||
Ctn Run Command And Check Result As Strings ${command} ${ap_usage_tc.result}
|
||||
END
|
||||
|
@ -10,15 +10,16 @@ Test Timeout 120s
|
||||
*** Variables ***
|
||||
${MOCKOON_JSON} ${CURDIR}${/}meraki.mockoon.json
|
||||
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::cisco::meraki::cloudcontroller::restapi::plugin
|
||||
... --api-token=EEECGFCGFCGF
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=network::cisco::meraki::cloudcontroller::restapi::plugin
|
||||
... --api-token=EEECGFCGFCGF
|
||||
... --statefile-dir=/dev/shm/
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
Create cache from API
|
||||
[Tags] meraki api vpn network cache
|
||||
${output} Run
|
||||
... ${CMD} --mode=cache --proto http --port 3000 --hostname=127.0.0.1
|
||||
... ${CMD} --mode=cache --proto=http --port=${APIPORT} --hostname=${HOSTNAME}
|
||||
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
@ -30,17 +31,13 @@ Create cache from API
|
||||
|
||||
Check if ${test_desc} works
|
||||
[Tags] meraki api vpn network
|
||||
${output} Run
|
||||
... ${CMD} --mode=vpn-tunnels --filter-network-name=${filter_network_name} --cache-use --critical-total-dormant=1:
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=vpn-tunnels --filter-network-name=${filter_network_name} --cache-use --critical-total-dormant=1:
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected}
|
||||
... Wrong output result:\n\n ${output}\nInstead of:\n ${expected}\n\n
|
||||
|
||||
Examples: test_desc filter_network_name expected --
|
||||
Examples: test_desc filter_network_name expected_result --
|
||||
... all links .* OK: vpn tunnel 'C3PO-R2P2-BB88' status: dormant [mode: spoke] | 'vpn.tunnels.online.count'=0;;;0;1 'vpn.tunnels.offline.count'=0;;;0;1 'vpn.tunnels.dormant.count'=1;;1:;0;1
|
||||
... empty filter ${EMPTY} OK: vpn tunnel 'C3PO-R2P2-BB88' status: dormant [mode: spoke] | 'vpn.tunnels.online.count'=0;;;0;1 'vpn.tunnels.offline.count'=0;;;0;1 'vpn.tunnels.dormant.count'=1;;1:;0;1
|
||||
... absurd filter toto CRITICAL: Vpn tunnels dormant: 0 | 'vpn.tunnels.online.count'=0;;;0;0 'vpn.tunnels.offline.count'=0;;;0;0 'vpn.tunnels.dormant.count'=0;;1:;0;0
|
||||
|
||||
|
@ -17,18 +17,13 @@ check psu components ${tc}/2
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=health
|
||||
... --hostname='127.0.0.1'
|
||||
... --snmp-port='2024'
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community='network/citrix/netscaler/snmp/mode/components/${community}'
|
||||
... --component=psu
|
||||
... --alternative-status-mapping='${alternative_status_mapping}'
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc alternative_status_mapping community expected_result --
|
||||
... 1 true psu-citrix-v13 OK: All 4 components are ok [4/4 psus]. | 'count_psu'=4;;;;
|
||||
|
@ -306,9 +306,9 @@ Network Fortinet Fortigate SNMP link monitor
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=link-monitor
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-version=2c
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/fortinet/fortigate/snmp/linkmonitor
|
||||
${length} Get Length ${fortinet_fortigate_linkmonitor_test.filterid}
|
||||
IF ${length} > 0
|
||||
@ -382,14 +382,9 @@ Network Fortinet Fortigate SNMP link monitor
|
||||
... ${command}
|
||||
... --critical-packet-loss=${fortinet_fortigate_linkmonitor_test.criticalpacketloss}
|
||||
END
|
||||
${output} Run ${command}
|
||||
|
||||
Log To Console . no_newline=true
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${fortinet_fortigate_linkmonitor_test.result}
|
||||
... Wrong result output for:${\n}Command: ${\n}${command}${\n}${\n}Expected output: ${\n}${fortinet_fortigate_linkmonitor_test.result}${\n}${\n}Obtained output:${\n}${output}${\n}${\n}${\n}
|
||||
... values=False
|
||||
Ctn Run Command And Check Result As Strings ${command} ${fortinet_fortigate_linkmonitor_test.result}
|
||||
END
|
||||
|
||||
Network Fortinet Fortigate SNMP list link monitor
|
||||
@ -399,9 +394,9 @@ Network Fortinet Fortigate SNMP list link monitor
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=list-link-monitors
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-version=2c
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=network/fortinet/fortigate/snmp/linkmonitor
|
||||
${length} Get Length ${fortinet_fortigate_listlinkmonitors_test.filterstate}
|
||||
IF ${length} > 0
|
||||
@ -421,12 +416,5 @@ Network Fortinet Fortigate SNMP list link monitor
|
||||
... ${command}
|
||||
... --filter-vdom=${fortinet_fortigate_listlinkmonitors_test.filtervdom}
|
||||
END
|
||||
${output} Run ${command}
|
||||
Log To Console . no_newline=true
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${fortinet_fortigate_listlinkmonitors_test.result}
|
||||
... Wrong result output for:${\n}Command: ${\n}${command}${\n}${\n}Expected output: ${\n}${fortinet_fortigate_listlinkmonitors_test.result}${\n}${\n}Obtained output:${\n}${output}${\n}${\n}${\n}
|
||||
... values=False
|
||||
Ctn Run Command And Check Result As Strings ${command} ${fortinet_fortigate_listlinkmonitors_test.result}
|
||||
END
|
||||
|
@ -33,17 +33,10 @@ Cells radio ${tc}
|
||||
... --warning-module-cellradio-snr=${warningmodulecellradiosnr}
|
||||
... --critical-module-cellradio-snr=${criticalmodulecellradiosnr}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${result}
|
||||
... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${result}\n
|
||||
... values=False
|
||||
... collapse_spaces=True
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
|
||||
Examples: tc customperfdatainstances criticalstatus warningmodulescellradiodetected criticalmodulescellradiodetected warningmodulecellradiorsrp criticalmodulecellradiorsrp warningmodulecellradiorsrq criticalmodulecellradiorsrq warningmodulecellradiocsq criticalmodulecellradiocsq warningmodulecellradiosnr criticalmodulecellradiosnr result --
|
||||
Examples: tc customperfdatainstances criticalstatus warningmodulescellradiodetected criticalmodulescellradiodetected warningmodulecellradiorsrp criticalmodulecellradiorsrp warningmodulecellradiorsrq criticalmodulecellradiorsrq warningmodulecellradiocsq criticalmodulecellradiocsq warningmodulecellradiosnr criticalmodulecellradiosnr expected_result --
|
||||
... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: All cellular radio interfaces are ok | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
|
||||
... 4 '%(operator) %(simIcc)' ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: All cellular radio interfaces are ok | 'modules.cellradio.detected.count'=3;;;0; '---~89330122115801091660#module.cellradio.rsrp.dbm'=-114;;;0; '---~89330122115801091660#module.cellradio.rsrq.dbm'=-18;;;0; '---~89330122115801091660#module.cellradio.snr.db'=-1;;;0; '---~89330122115801091660#module.cellradio.csq.dbm'=-73;;;0; 'PHENIX~89330122115801091660#module.cellradio.rsrp.dbm'=-114;;;0; 'PHENIX~89330122115801091660#module.cellradio.rsrq.dbm'=-18;;;0; 'PHENIX~89330122115801091660#module.cellradio.snr.db'=-1;;;0; 'PHENIX~89330122115801091660#module.cellradio.csq.dbm'=-73;;;0;
|
||||
... 5 ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Number of cellular radio interfacesdetected: 3 | 'modules.cellradio.detected.count'=3;0:2;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
|
||||
|
@ -27,16 +27,10 @@ CPU ${tc}
|
||||
... --warning-cpu-utilization-5m=${warningcpuutilization5m}
|
||||
... --critical-cpu-utilization-5m=${criticalcpuutilization5m}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${result}
|
||||
... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${result}\n
|
||||
... values=False
|
||||
... collapse_spaces=True
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc warningcpuutilization5s criticalcpuutilization5s warningcpuutilization1m criticalcpuutilization1m warningcpuutilization5m criticalcpuutilization5m result --
|
||||
|
||||
Examples: tc warningcpuutilization5s criticalcpuutilization5s warningcpuutilization1m criticalcpuutilization1m warningcpuutilization5m criticalcpuutilization5m expected_result --
|
||||
... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: cpu average usage: 1.00 % (5s), 1.00 % (1m), 1.00 % (5m) | 'cpu.utilization.5s.percentage'=1.00%;;;0;100 'cpu.utilization.1m.percentage'=1.00%;;;0;100 'cpu.utilization.15m.percentage'=1.00%;;;0;100
|
||||
... 2 0.5 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: cpu average usage: 1.00 % (5s) | 'cpu.utilization.5s.percentage'=1.00%;0:0.5;;0;100 'cpu.utilization.1m.percentage'=1.00%;;;0;100 'cpu.utilization.15m.percentage'=1.00%;;;0;100
|
||||
... 3 ${EMPTY} 0.5 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: cpu average usage: 1.00 % (5s) | 'cpu.utilization.5s.percentage'=1.00%;;0:0.5;0;100 'cpu.utilization.1m.percentage'=1.00%;;;0;100 'cpu.utilization.15m.percentage'=1.00%;;;0;100
|
||||
|
@ -27,14 +27,8 @@ Memory ${tc}
|
||||
... --warning-usage-prct=${warningusageprct}
|
||||
... --critical-usage-prct=${criticalusageprct}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n
|
||||
... values=False
|
||||
... collapse_spaces=True
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
|
||||
Examples: tc warningusage criticalusage warningusagefree criticalusagefree warningusageprct criticalusageprct expected_result --
|
||||
... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Memory 'system' total: 256.00 MB used: 100.54 MB (39.27%) free: 155.46 MB (60.73%) | 'system#memory.usage.bytes'=105419600B;;;0;268435456 'system#memory.free.bytes'=163015856B;;;0;268435456 'system#memory.usage.percentage'=39.27%;;;0;100
|
||||
|
@ -7,7 +7,7 @@ Test Timeout 120s
|
||||
|
||||
|
||||
*** Variables ***
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=os::linux::snmp::plugin
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=os::linux::snmp::plugin
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
@ -17,9 +17,9 @@ List diskio ${tc}
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=list-diskio
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-version=2
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --disco-show
|
||||
... --snmp-community=${snmpcommunity}
|
||||
${output} Run ${command}
|
||||
@ -32,5 +32,5 @@ List diskio ${tc}
|
||||
... Wrong output result for command:{\n}{\n}${command}{\n}{\n}Command output:{\n}{\n}${output}
|
||||
|
||||
Examples: tc snmpcommunity expected_result --
|
||||
... 1 os/linux/snmp/list-diskio 10
|
||||
... 2 os/linux/snmp/list-diskio-2 4
|
||||
... 1 os/linux/snmp/list-diskio 10
|
||||
... 2 os/linux/snmp/list-diskio-2 4
|
||||
|
@ -10,8 +10,8 @@ Test Timeout 120s
|
||||
${CMD} ${CENTREON_PLUGINS}
|
||||
... --plugin=os::linux::snmp::plugin
|
||||
... --mode=interfaces
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=os/linux/snmp/network-interfaces
|
||||
... --statefile-dir=/tmp/cache/
|
||||
|
||||
@ -26,15 +26,10 @@ Interfaces by id ${tc}/5
|
||||
... --interface='${filter}'
|
||||
... ${extra_options}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc filter extra_options expected_result --
|
||||
... 1 1 ${EMPTY} OK: Interface 'lo' Status : up (admin: up)
|
||||
Examples: tc filter extra_options expected_result --
|
||||
... 1 1 ${EMPTY} OK: Interface 'lo' Status : up (admin: up)
|
||||
... 2 1,3 --add-traffic OK: All interfaces are ok
|
||||
... 3 1,3 --add-traffic OK: All interfaces are ok | 'traffic_in_lo'=0.00b/s;;;0;10000000 'traffic_out_lo'=0.00b/s;;;0;10000000 'traffic_in_eth1'=0.00b/s;;;0;1000000000 'traffic_out_eth1'=0.00b/s;;;0;1000000000
|
||||
... 4 2,3,4 --add-traffic OK: All interfaces are ok
|
||||
@ -50,12 +45,7 @@ Interfaces by id regexp ${tc}/6
|
||||
... --regex-id
|
||||
... ${extra_options}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc filter extra_options expected_result --
|
||||
... 1 ^1$ ${EMPTY} OK: Interface 'lo' Status : up (admin: up)
|
||||
|
@ -10,12 +10,12 @@ Test Timeout 120s
|
||||
${CMD} ${CENTREON_PLUGINS}
|
||||
... --plugin=os::windows::snmp::plugin
|
||||
... --mode=service
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
Windows Services EN ${tc}/x
|
||||
Windows Services EN ${tc}
|
||||
[Documentation] Full ASCII
|
||||
[Tags] os linux local
|
||||
${command} Catenate
|
||||
@ -24,12 +24,7 @@ Windows Services EN ${tc}/x
|
||||
... --filter-name='${filter}'
|
||||
... ${extra_option}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc filter extra_option expected_result --
|
||||
... 1 ${EMPTY} ${EMPTY} OK: All services are ok | 'services.total.count'=168;;;0; 'services.active.count'=168;;;0; 'services.continue.pending.count'=0;;;0; 'services.pause.pending.count'=0;;;0; 'services.paused.count'=0;;;0;
|
||||
|
@ -11,50 +11,53 @@ Test Timeout 120s
|
||||
*** Variables ***
|
||||
${MOCKOON_JSON} ${CURDIR}${/}storage-datacore-api.json
|
||||
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=storage::datacore::restapi::plugin --password=pass --username=user --port=3000 --hostname=127.0.0.1 --proto=http
|
||||
${CMD} ${CENTREON_PLUGINS} --plugin=storage::datacore::restapi::plugin --password=pass --username=user --port=${APIPORT} --hostname=${HOSTNAME} --proto=http
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
Datacore check pool usage
|
||||
[Documentation] Check Datacore pool usage
|
||||
[Tags] storage api
|
||||
${output} Run
|
||||
... ${CMD} --mode=pool-usage --critical-oversubscribed=${critical-oversubscribed} --warning-oversubscribed=${warning-oversubscribed} --warning-bytesallocatedpercentage=${warning-bytesallocatedpercentage} --critical-bytesallocatedpercentage=${critical-bytesallocatedpercentage} --pool-id=B5C140F5-6B13-4CAD-AF9D-F7C4172B3A1D:{4dec1b5a-2577-11e5-80c3-00155d651622}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${result}
|
||||
... Wrong output result for pool usage :\n\n ${output} \n\n ${result}\n\n
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=pool-usage
|
||||
... --critical-oversubscribed=${critical-oversubscribed}
|
||||
... --warning-oversubscribed=${warning-oversubscribed}
|
||||
... --warning-bytesallocatedpercentage=${warning-bytesallocatedpercentage}
|
||||
... --critical-bytesallocatedpercentage=${critical-bytesallocatedpercentage}
|
||||
... --pool-id=B5C140F5-6B13-4CAD-AF9D-F7C4172B3A1D:{4dec1b5a-2577-11e5-80c3-00155d651622}
|
||||
|
||||
Examples: warning-bytesallocatedpercentage critical-bytesallocatedpercentage warning-oversubscribed critical-oversubscribed result --
|
||||
... 2 5 -1 3 CRITICAL: Bytes Allocated : 12 % WARNING: Over subscribed bytes : 0 | 'datacore.pool.bytesallocated.percentage'=12%;0:2;0:5;0;100 'datacore.pool.oversubscribed.bytes'=0bytes;0:-1;0:3;0;
|
||||
... 70 80 10 20 OK: Bytes Allocated : 12 % - Over subscribed bytes : 0 | 'datacore.pool.bytesallocated.percentage'=12%;0:70;0:80;0;100 'datacore.pool.oversubscribed.bytes'=0bytes;0:10;0:20;0;
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: warning-bytesallocatedpercentage critical-bytesallocatedpercentage warning-oversubscribed critical-oversubscribed expected_result --
|
||||
... 2 5 -1 3 CRITICAL: Bytes Allocated : 12 % WARNING: Over subscribed bytes : 0 | 'datacore.pool.bytesallocated.percentage'=12%;0:2;0:5;0;100 'datacore.pool.oversubscribed.bytes'=0bytes;0:-1;0:3;0;
|
||||
... 70 80 10 20 OK: Bytes Allocated : 12 % - Over subscribed bytes : 0 | 'datacore.pool.bytesallocated.percentage'=12%;0:70;0:80;0;100 'datacore.pool.oversubscribed.bytes'=0bytes;0:10;0:20;0;
|
||||
|
||||
Datacore check alert count
|
||||
[Documentation] Check Datacore pool usage
|
||||
[Tags] storage api
|
||||
${output} Run
|
||||
... ${CMD} --mode=alerts --warning-error=${warning-error} --critical-error=${critical-error} --warning-warning=${warning-warning} --critical-warning=${critical-warning}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${result}
|
||||
... Wrong output result for alert count :\n\n ${output} \n\n ${result}\n\n
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=alerts
|
||||
... --warning-error=${warning-error}
|
||||
... --critical-error=${critical-error}
|
||||
... --warning-warning=${warning-warning}
|
||||
... --critical-warning=${critical-warning}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: warning-error critical-error warning-warning critical-warning result --
|
||||
... 0 1 5 5 WARNING: number of error alerts : 1 | 'datacore.event.error.count'=1;0:0;0:1;0; 'datacore.alerts.warning.count'=1;0:5;0:5;0; 'datacore.alerts.info.count'=0;;;0; 'datacore.alerts.trace.count'=0;;;0;
|
||||
... 5 5 5 5 OK: number of error alerts : 1, number of warning alerts : 1, number of info alerts : 0, number of trace alerts : 0 | 'datacore.event.error.count'=1;0:5;0:5;0; 'datacore.alerts.warning.count'=1;0:5;0:5;0; 'datacore.alerts.info.count'=0;;;0; 'datacore.alerts.trace.count'=0;;;0;
|
||||
Examples: warning-error critical-error warning-warning critical-warning expected_result --
|
||||
... 0 1 5 5 WARNING: number of error alerts : 1 | 'datacore.event.error.count'=1;0:0;0:1;0; 'datacore.alerts.warning.count'=1;0:5;0:5;0; 'datacore.alerts.info.count'=0;;;0; 'datacore.alerts.trace.count'=0;;;0;
|
||||
... 5 5 5 5 OK: number of error alerts : 1, number of warning alerts : 1, number of info alerts : 0, number of trace alerts : 0 | 'datacore.event.error.count'=1;0:5;0:5;0; 'datacore.alerts.warning.count'=1;0:5;0:5;0; 'datacore.alerts.info.count'=0;;;0; 'datacore.alerts.trace.count'=0;;;0;
|
||||
|
||||
Datacore check status monitor
|
||||
[Documentation] Check Datacore pool usage
|
||||
[Tags] storage api
|
||||
${output} Run
|
||||
... ${CMD} --mode=status-monitor
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${result}
|
||||
... Wrong output result for status monitor :\n${output} \nresult:\n${result}\n\n
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=status-monitor
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: result --
|
||||
... CRITICAL: 'State of HostVM2' status : 'Critical', message is 'Connected'
|
||||
Examples: expected_result --
|
||||
... CRITICAL: 'State of HostVM2' status : 'Critical', message is 'Connected'
|
||||
|
@ -63,16 +63,12 @@ Components
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=components
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-version=2
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=${check_components_test.snmpcommunity}
|
||||
|
||||
${output} Run ${command}
|
||||
Should Be Equal As Strings
|
||||
... ${check_components_test.expected_output}
|
||||
... ${output}
|
||||
... ${check_components_test.description} failed. Wrong output for components mode: ${check_components_test}.{\n}Command output:{\n}${output}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${check_components_test.expected_output}
|
||||
END
|
||||
|
||||
Uptime
|
||||
@ -81,16 +77,12 @@ Uptime
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=uptime
|
||||
... --hostname=127.0.0.1
|
||||
... --snmp-version=2
|
||||
... --snmp-port=2024
|
||||
... --hostname=${HOSTNAME}
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=${test_item.snmpcommunity}
|
||||
... --warning-uptime=${test_item.warning}
|
||||
... --critical-uptime=${test_item.critical}
|
||||
|
||||
${output} Run ${command}
|
||||
Should Be Equal As Strings
|
||||
... ${test_item.expected_output}
|
||||
... ${output}
|
||||
... ${test_item.description} failed. Wrong output for components mode: ${test_item}.{\n}Command output:{\n}${output}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${test_item.expected_output}
|
||||
END
|
||||
|
Loading…
x
Reference in New Issue
Block a user