test(various): split old automated tests (#5229)

Refs: CTOR-951
This commit is contained in:
sfarouq-ext 2024-11-08 10:47:34 +01:00 committed by GitHub
parent 08695b6f33
commit 77237f9fea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 510 additions and 402 deletions

View File

@ -0,0 +1,30 @@
*** Settings ***
Documentation Eclipse Mosquitto MQTT plugin tests
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Keyword Tags notauto
*** Variables ***
${HOSTNAME} mosquitto_openssl
${MQTT_PORT} 8883
${MQTT_CA_CERTIFICATE} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/ca.crt
${MQTT_SSL_CERTIFICATE} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/client.crt
${MQTT_SSL_KEY} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/client.key
${CMD} ${CENTREON_PLUGINS} --plugin=apps::eclipse::mosquitto::mqtt::plugin --hostname=${HOSTNAME} --mqtt-port=${MQTT_PORT} --mqtt-ca-certificate=${MQTT_CA_CERTIFICATE} --mqtt-ssl-certificate=${MQTT_SSL_CERTIFICATE} --mqtt-ssl-key=${MQTT_SSL_KEY}
*** Test Cases ***
Mosquitto MQTT clients
[Documentation] Check Mosquitto MQTT uptime
[Tags] eclipse mosquitto mqtt
${command} Catenate
... ${CMD}
... --mode=clients
... --help
${output} Run ${command}
${output} Strip String ${output}

View File

@ -0,0 +1,30 @@
*** Settings ***
Documentation Eclipse Mosquitto MQTT plugin tests
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Keyword Tags notauto
*** Variables ***
${HOSTNAME} mosquitto_openssl
${MQTT_PORT} 8883
${MQTT_CA_CERTIFICATE} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/ca.crt
${MQTT_SSL_CERTIFICATE} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/client.crt
${MQTT_SSL_KEY} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/client.key
${CMD} ${CENTREON_PLUGINS} --plugin=apps::eclipse::mosquitto::mqtt::plugin --hostname=${HOSTNAME} --mqtt-port=${MQTT_PORT} --mqtt-ca-certificate=${MQTT_CA_CERTIFICATE} --mqtt-ssl-certificate=${MQTT_SSL_CERTIFICATE} --mqtt-ssl-key=${MQTT_SSL_KEY}
*** Test Cases ***
Mosquitto MQTT messages
[Documentation] Check Mosquitto MQTT uptime
[Tags] eclipse mosquitto mqtt
${command} Catenate
... ${CMD}
... --mode=messages
... --help
${output} Run ${command}
${output} Strip String ${output}

View File

@ -0,0 +1,30 @@
*** Settings ***
Documentation Eclipse Mosquitto MQTT plugin tests
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Keyword Tags notauto
*** Variables ***
${HOSTNAME} mosquitto_openssl
${MQTT_PORT} 8883
${MQTT_CA_CERTIFICATE} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/ca.crt
${MQTT_SSL_CERTIFICATE} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/client.crt
${MQTT_SSL_KEY} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/client.key
${CMD} ${CENTREON_PLUGINS} --plugin=apps::eclipse::mosquitto::mqtt::plugin --hostname=${HOSTNAME} --mqtt-port=${MQTT_PORT} --mqtt-ca-certificate=${MQTT_CA_CERTIFICATE} --mqtt-ssl-certificate=${MQTT_SSL_CERTIFICATE} --mqtt-ssl-key=${MQTT_SSL_KEY}
*** Test Cases ***
Mosquitto MQTT numeric-value
[Documentation] Check Mosquitto MQTT uptime
[Tags] eclipse mosquitto mqtt
${command} Catenate
... ${CMD}
... --mode=numeric-value
... --help
${output} Run ${command}
${output} Strip String ${output}

View File

@ -18,50 +18,6 @@ ${CMD} ${CENTREON_PLUGINS} --plugin=apps::eclipse::mosquitt
*** Test Cases ***
Mosquitto MQTT uptime
[Documentation] Check Mosquitto MQTT uptime
[Tags] eclipse mosquitto mqtt
${command} Catenate
... ${CMD}
... --mode=uptime
... --help
${output} Run ${command}
${output} Strip String ${output}
Mosquitto MQTT clients
[Documentation] Check Mosquitto MQTT uptime
[Tags] eclipse mosquitto mqtt
${command} Catenate
... ${CMD}
... --mode=clients
... --help
${output} Run ${command}
${output} Strip String ${output}
Mosquitto MQTT messages
[Documentation] Check Mosquitto MQTT uptime
[Tags] eclipse mosquitto mqtt
${command} Catenate
... ${CMD}
... --mode=messages
... --help
${output} Run ${command}
${output} Strip String ${output}
Mosquitto MQTT numeric-value
[Documentation] Check Mosquitto MQTT uptime
[Tags] eclipse mosquitto mqtt
${command} Catenate
... ${CMD}
... --mode=numeric-value
... --help
${output} Run ${command}
${output} Strip String ${output}
Mosquitto MQTT string-value
[Documentation] Check Mosquitto MQTT uptime
[Tags] eclipse mosquitto mqtt

View File

@ -0,0 +1,30 @@
*** Settings ***
Documentation Eclipse Mosquitto MQTT plugin tests
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Keyword Tags notauto
*** Variables ***
${HOSTNAME} mosquitto_openssl
${MQTT_PORT} 8883
${MQTT_CA_CERTIFICATE} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/ca.crt
${MQTT_SSL_CERTIFICATE} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/client.crt
${MQTT_SSL_KEY} /home/code/tests/robot/apps/eclipse/mosquitto/mqtt/certs/client.key
${CMD} ${CENTREON_PLUGINS} --plugin=apps::eclipse::mosquitto::mqtt::plugin --hostname=${HOSTNAME} --mqtt-port=${MQTT_PORT} --mqtt-ca-certificate=${MQTT_CA_CERTIFICATE} --mqtt-ssl-certificate=${MQTT_SSL_CERTIFICATE} --mqtt-ssl-key=${MQTT_SSL_KEY}
*** Test Cases ***
Mosquitto MQTT uptime
[Documentation] Check Mosquitto MQTT uptime
[Tags] eclipse mosquitto mqtt
${command} Catenate
... ${CMD}
... --mode=uptime
... --help
${output} Run ${command}
${output} Strip String ${output}

View File

@ -0,0 +1,32 @@
*** Settings ***
Documentation Application Microsoft HyperV 2022
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS}
... --plugin=apps::microsoft::hyperv::2012::local::plugin
... --mode=node-integration-service
... --command=cat
... --command-path=/usr/bin
... --no-ps
*** Test Cases ***
HyperV 2022-1 ${tc}
[Documentation] Apps Microsoft HyperV 2022
[Tags] applications microsoft hyperv virtualization
${command} Catenate
... ${CMD}
... --command-options=${CURDIR}/nodeintegrationservice-2022-1.json
... --filter-vm='${filter_vm}'
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

View File

@ -16,20 +16,6 @@ ${CMD} ${CENTREON_PLUGINS}
*** Test Cases ***
HyperV 2022-1 ${tc}
[Documentation] Apps Microsoft HyperV 2022
[Tags] applications microsoft hyperv virtualization
${command} Catenate
... ${CMD}
... --command-options=${CURDIR}/nodeintegrationservice-2022-1.json
... --filter-vm='${filter_vm}'
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
HyperV 2022-2 ${tc}
[Documentation] Apps Microsoft HyperV 2022
[Tags] applications microsoft hyperv virtualization

View File

@ -0,0 +1,37 @@
*** Settings ***
Documentation hardware mode
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${SNMPCOMMUNITY} hardware/kvm/avocent/acs/8000/avocent8000
*** Test Cases ***
Hardware
[Tags] hardware kvm avocent hardware-mode snmp
${output} Run Avocent 8000 Plugin "hardware" ""
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: All 2 components are ok [2/2 psus]. | 'hardware.psu.count'=2;;;;
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
*** Keywords ***
Run Avocent 8000 Plugin
[Arguments] ${mode} ${extraoptions}
${command} Catenate
... ${CENTREON_PLUGINS}
... --plugin=hardware::kvm::avocent::acs::8000::snmp::plugin
... --mode=${mode}
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=${SNMPCOMMUNITY}
... ${extraoptions}
${output} Run ${command}
RETURN ${output}

View File

@ -0,0 +1,48 @@
*** Settings ***
Documentation cpu-detailed mode
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${SNMPCOMMUNITY} hardware/kvm/avocent/acs/8000/avocent8000
*** Test Cases ***
Cpu-Detailed
[Tags] hardware kvm avocent cpu snmp
Remove File /dev/shm/snmpstandard_127.0.0.1_2024_cpu-detailed*
${output} Run Avocent 8000 Plugin "cpu-detailed" --statefile-dir=/dev/shm/
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: CPU Usage: user : Buffer creation, nice : Buffer creation, system : Buffer creation, idle : Buffer creation, wait : Buffer creation, kernel : Buffer creation, interrupt : Buffer creation, softirq : Buffer creation, steal : Buffer creation, guest : Buffer creation, guestnice : Buffer creation
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
${output} Run Avocent 8000 Plugin "cpu-detailed" --statefile-dir=/dev/shm/
${output} Strip String ${output}
Remove File /dev/shm/snmpstandard_127.0.0.1_2024_cpu-detailed*
Should Be Equal As Strings
... ${output}
... OK: CPU Usage: user : counter not moved, nice : counter not moved, system : counter not moved, idle : counter not moved, wait : counter not moved, kernel : counter not moved, interrupt : counter not moved, softirq : counter not moved, steal : counter not moved, guest : counter not moved, guestnice : counter not moved
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
*** Keywords ***
Run Avocent 8000 Plugin
[Arguments] ${mode} ${extraoptions}
${command} Catenate
... ${CENTREON_PLUGINS}
... --plugin=hardware::kvm::avocent::acs::8000::snmp::plugin
... --mode=${mode}
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=${SNMPCOMMUNITY}
... ${extraoptions}
${output} Run ${command}
RETURN ${output}

View File

@ -0,0 +1,38 @@
*** Settings ***
Documentation load mode
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${SNMPCOMMUNITY} hardware/kvm/avocent/acs/8000/avocent8000
*** Test Cases ***
Load
[Tags] hardware kvm avocent load snmp
${output} Run Avocent 8000 Plugin "load" ""
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: Load average: 0.04, 0.10, 0.15 | 'load1'=0.04;;;0; 'load5'=0.10;;;0; 'load15'=0.15;;;0;
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
*** Keywords ***
Run Avocent 8000 Plugin
[Arguments] ${mode} ${extraoptions}
${command} Catenate
... ${CENTREON_PLUGINS}
... --plugin=hardware::kvm::avocent::acs::8000::snmp::plugin
... --mode=${mode}
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=${SNMPCOMMUNITY}
... ${extraoptions}
${output} Run ${command}
RETURN ${output}

View File

@ -0,0 +1,38 @@
*** Settings ***
Documentation memory mode
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${SNMPCOMMUNITY} hardware/kvm/avocent/acs/8000/avocent8000
*** Test Cases ***
Memory
[Tags] hardware kvm avocent memory snmp
${output} Run Avocent 8000 Plugin "memory" ""
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: Ram Total: 1.92 GB Used (-buffers/cache): 626.18 MB (31.79%) Free: 1.31 GB (68.21%), Buffer: 2.04 MB, Cached: 723.54 MB, Shared: 26.09 MB | 'used'=656592896B;;;0;2065698816 'free'=1409105920B;;;0;2065698816 'used_prct'=31.79%;;;0;100 'buffer'=2134016B;;;0; 'cached'=758689792B;;;0; 'shared'=27357184B;;;0;
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
*** Keywords ***
Run Avocent 8000 Plugin
[Arguments] ${mode} ${extraoptions}
${command} Catenate
... ${CENTREON_PLUGINS}
... --plugin=hardware::kvm::avocent::acs::8000::snmp::plugin
... --mode=${mode}
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=${SNMPCOMMUNITY}
... ${extraoptions}
${output} Run ${command}
RETURN ${output}

View File

@ -1,5 +1,5 @@
*** Settings ***
Documentation hardware::kvm::avocent::acs::8000::snmp::plugin
Documentation serial-ports mode
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
@ -11,60 +11,7 @@ ${SNMPCOMMUNITY} hardware/kvm/avocent/acs/8000/avocent8000
*** Test Cases ***
Cpu-Detailed
[Documentation] cpu-detailed mode
[Tags] hardware kvm avocent cpu snmp
Remove File /dev/shm/snmpstandard_127.0.0.1_2024_cpu-detailed*
${output} Run Avocent 8000 Plugin "cpu-detailed" --statefile-dir=/dev/shm/
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: CPU Usage: user : Buffer creation, nice : Buffer creation, system : Buffer creation, idle : Buffer creation, wait : Buffer creation, kernel : Buffer creation, interrupt : Buffer creation, softirq : Buffer creation, steal : Buffer creation, guest : Buffer creation, guestnice : Buffer creation
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
${output} Run Avocent 8000 Plugin "cpu-detailed" --statefile-dir=/dev/shm/
${output} Strip String ${output}
Remove File /dev/shm/snmpstandard_127.0.0.1_2024_cpu-detailed*
Should Be Equal As Strings
... ${output}
... OK: CPU Usage: user : counter not moved, nice : counter not moved, system : counter not moved, idle : counter not moved, wait : counter not moved, kernel : counter not moved, interrupt : counter not moved, softirq : counter not moved, steal : counter not moved, guest : counter not moved, guestnice : counter not moved
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
Hardware
[Documentation] hardware mode
[Tags] hardware kvm avocent hardware-mode snmp
${output} Run Avocent 8000 Plugin "hardware" ""
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: All 2 components are ok [2/2 psus]. | 'hardware.psu.count'=2;;;;
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
Load
[Documentation] load mode
[Tags] hardware kvm avocent load snmp
${output} Run Avocent 8000 Plugin "load" ""
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: Load average: 0.04, 0.10, 0.15 | 'load1'=0.04;;;0; 'load5'=0.10;;;0; 'load15'=0.15;;;0;
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
Memory
[Documentation] memory mode
[Tags] hardware kvm avocent memory snmp
${output} Run Avocent 8000 Plugin "memory" ""
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... OK: Ram Total: 1.92 GB Used (-buffers/cache): 626.18 MB (31.79%) Free: 1.31 GB (68.21%), Buffer: 2.04 MB, Cached: 723.54 MB, Shared: 26.09 MB | 'used'=656592896B;;;0;2065698816 'free'=1409105920B;;;0;2065698816 'used_prct'=31.79%;;;0;100 'buffer'=2134016B;;;0; 'cached'=758689792B;;;0; 'shared'=27357184B;;;0;
... Wrong output result for command:{\n}${output}{\n}{\n}{\n}
Serial Ports
[Documentation] serial-ports mode
[Tags] hardware kvm avocent serial snmp
Remove File /dev/shm/avocent_acs_8000_127.0.0.1_2024_serial-ports*
${output} Run Avocent 8000 Plugin "serial-ports" --statefile-dir=/dev/shm/

View File

@ -0,0 +1,31 @@
*** Settings ***
Documentation Linux Local list-systemdservices
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::linux::local::plugin
${COND} ${PERCENT}\{sub\} =~ /exited/ && ${PERCENT}{display} =~ /network/'
*** Test Cases ***
List-Systemdservices v219 ${tc}
[Documentation] Systemd version < 248
[Tags] os linux local
${command} Catenate
... ${CMD}
... --mode=list-systemdservices
... --command-path=${CURDIR}${/}systemd-219
... --filter-name='${filtername}'
... --filter-description='${filterdescription}'
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc filtername filterdescription expected_result --
... 1 toto ${EMPTY} List systemd services:
... 2 NetworkManager.service ${EMPTY} List systemd services: \n\'NetworkManager.service\' [desc = Network Manager] [load = loaded] [active = active] [sub = running]
... 3 ${EMPTY} toto List systemd services:
... 4 ${EMPTY} Permit User Sessions List systemd services: \n\'systemd-user-sessions.service\' [desc = Permit User Sessions] [load = loaded] [active = active] [sub = exited]

View File

@ -0,0 +1,31 @@
*** Settings ***
Documentation Linux Local list-systemdservices
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::linux::local::plugin
${COND} ${PERCENT}\{sub\} =~ /exited/ && ${PERCENT}{display} =~ /network/'
*** Test Cases ***
List-Systemdservices v252 ${tc}
[Documentation] Systemd version >= 248
[Tags] os linux local
${command} Catenate
... ${CMD}
... --mode=list-systemdservices
... --command-path=${CURDIR}${/}systemd-252
... --filter-name='${filtername}'
... --filter-description='${filterdescription}'
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc filtername filterdescription expected_result --
... 1 toto ${EMPTY} List systemd services:
... 2 NetworkManager.service ${EMPTY} List systemd services: \n\'NetworkManager.service\' [desc = Network Manager] [load = loaded] [active = active] [sub = running]
... 3 ${EMPTY} toto List systemd services:
... 4 ${EMPTY} Permit User Sessions List systemd services: \n\'systemd-user-sessions.service\' [desc = Permit User Sessions] [load = loaded] [active = active] [sub = exited]

View File

@ -1,59 +0,0 @@
*** Settings ***
Documentation Linux Local list-systemdservices
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::linux::local::plugin
${COND} ${PERCENT}\{sub\} =~ /exited/ && ${PERCENT}{display} =~ /network/'
*** Test Cases ***
List-Systemdservices v219 ${tc}/4
[Documentation] Systemd version < 248
[Tags] os linux local
${command} Catenate
... ${CMD}
... --mode=list-systemdservices
... --command-path=${CURDIR}${/}systemd-219
... --filter-name='${filtername}'
... --filter-description='${filterdescription}'
${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
Examples: tc filtername filterdescription expected_result --
... 1 toto ${EMPTY} List systemd services:
... 2 NetworkManager.service ${EMPTY} List systemd services: \n\'NetworkManager.service\' [desc = Network Manager] [load = loaded] [active = active] [sub = running]
... 3 ${EMPTY} toto List systemd services:
... 4 ${EMPTY} Permit User Sessions List systemd services: \n\'systemd-user-sessions.service\' [desc = Permit User Sessions] [load = loaded] [active = active] [sub = exited]
List-Systemdservices v252 ${tc}/4
[Documentation] Systemd version >= 248
[Tags] os linux local
${command} Catenate
... ${CMD}
... --mode=list-systemdservices
... --command-path=${CURDIR}${/}systemd-252
... --filter-name='${filtername}'
... --filter-description='${filterdescription}'
${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
Examples: tc filtername filterdescription expected_result --
... 1 toto ${EMPTY} List systemd services:
... 2 NetworkManager.service ${EMPTY} List systemd services: \n\'NetworkManager.service\' [desc = Network Manager] [load = loaded] [active = active] [sub = running]
... 3 ${EMPTY} toto List systemd services:
... 4 ${EMPTY} Permit User Sessions List systemd services: \n\'systemd-user-sessions.service\' [desc = Permit User Sessions] [load = loaded] [active = active] [sub = exited]

View File

@ -1,97 +0,0 @@
*** Settings ***
Documentation Linux Local Systemd-sc-status
# systemd changed the output format of the command starting from version 252, so we need to check for a systemd version and use the correct parameter.
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::linux::local::plugin
*** Test Cases ***
Systemd-sc-status v219 ${tc}/15
[Documentation] Systemd version < 248
[Tags] os linux local
${command} Catenate
... ${CMD}
... --mode=systemd-sc-status
... --command-path=${CURDIR}${/}systemd-219
... --filter-name='${filter}'
... --exclude-name='${exclude}'
... --warning-status='${w_stat}'
... --critical-status='${c_stat}'
... --warning-total-running='${w_running}'
... --critical-total-running='${c_running}'
... --warning-total-dead='${w_dead}'
... --critical-total-dead='${c_dead}'
... --warning-total-exited='${w_exited}'
... --critical-total-exited='${c_exited}'
... --warning-total-failed='${w_failed}'
... --critical-total-failed='${c_failed}'
${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
Examples: tc filter exclude w_stat c_stat w_running c_running w_dead c_dead w_exited c_exited w_failed c_failed expected_result --
... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 34, Total Failed: 1, Total Dead: 97, Total Exited: 25 - All services are ok | 'total_running'=34;;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;;0;220
... 2 toto ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} UNKNOWN: No service found.
... 3 NetworkManager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 1, Total Failed: 0, Total Dead: 0, Total Exited: 1 - All services are ok | 'total_running'=1;;;0;2 'total_failed'=0;;;0;2 'total_dead'=0;;;0;2 'total_exited'=1;;;0;2
... 4 ${EMPTY} Manager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 33, Total Failed: 1, Total Dead: 97, Total Exited: 24 - All services are ok | 'total_running'=33;;;0;218 'total_failed'=1;;;0;218 'total_dead'=97;;;0;218 'total_exited'=24;;;0;218
... 5 NetworkManager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 1, Total Failed: 0, Total Dead: 0, Total Exited: 1 - All services are ok | 'total_running'=1;;;0;2 'total_failed'=0;;;0;2 'total_dead'=0;;;0;2 'total_exited'=1;;;0;2
... 8 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Running: 34 | 'total_running'=34;0:0;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;;0;220
... 9 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: Total Running: 34 | 'total_running'=34;;0:0;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;;0;220
... 10 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Dead: 97 | 'total_running'=34;;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;0:0;;0;220 'total_exited'=25;;;0;220
... 11 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: Total Dead: 97 | 'total_running'=34;;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;0:0;0;220 'total_exited'=25;;;0;220
... 12 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Exited: 25 | 'total_running'=34;;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;0:0;;0;220
... 13 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} ${EMPTY} CRITICAL: Total Exited: 25 | 'total_running'=34;;;0;220 'total_failed'=1;;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;0:0;0;220
... 14 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 ${EMPTY} WARNING: Total Failed: 1 | 'total_running'=34;;;0;220 'total_failed'=1;0:0;;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;;0;220
... 15 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 0 CRITICAL: Total Failed: 1 | 'total_running'=34;;;0;220 'total_failed'=1;;0:0;0;220 'total_dead'=97;;;0;220 'total_exited'=25;;;0;220
Systemd-sc-status v252 ${tc}/15
[Documentation] Systemd version >= 248
[Tags] os linux local
${command} Catenate
... ${CMD}
... --mode=systemd-sc-status
... --command-path=${CURDIR}${/}systemd-252
... --filter-name='${filter}'
... --exclude-name='${exclude}'
... --warning-status='${w_stat}'
... --critical-status='${c_stat}'
... --warning-total-running='${w_running}'
... --critical-total-running='${c_running}'
... --warning-total-dead='${w_dead}'
... --critical-total-dead='${c_dead}'
... --warning-total-exited='${w_exited}'
... --critical-total-exited='${c_exited}'
... --warning-total-failed='${w_failed}'
... --critical-total-failed='${c_failed}'
${output} Run ${command}
${output} Strip String ${output}
Should Be Equal As Strings
... ${output}
... ${expected_result}
... Wrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n
Examples: tc filter exclude w_stat c_stat w_running c_running w_dead c_dead w_exited c_exited w_failed c_failed expected_result --
... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 31, Total Failed: 4, Total Dead: 108, Total Exited: 19 - All services are ok | 'total_running'=31;;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;;0;258
... 2 toto ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} UNKNOWN: No service found.
... 3 NetworkManager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 1, Total Failed: 0, Total Dead: 0, Total Exited: 1 - All services are ok | 'total_running'=1;;;0;2 'total_failed'=0;;;0;2 'total_dead'=0;;;0;2 'total_exited'=1;;;0;2
... 4 ${EMPTY} Manager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 30, Total Failed: 4, Total Dead: 108, Total Exited: 18 - All services are ok | 'total_running'=30;;;0;256 'total_failed'=4;;;0;256 'total_dead'=108;;;0;256 'total_exited'=18;;;0;256
... 5 NetworkManager ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Total Running: 1, Total Failed: 0, Total Dead: 0, Total Exited: 1 - All services are ok | 'total_running'=1;;;0;2 'total_failed'=0;;;0;2 'total_dead'=0;;;0;2 'total_exited'=1;;;0;2
... 8 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Running: 31 | 'total_running'=31;0:2;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;;0;258
... 9 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: Total Running: 31 | 'total_running'=31;;0:2;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;;0;258
... 10 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Dead: 108 | 'total_running'=31;;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;0:2;;0;258 'total_exited'=19;;;0;258
... 11 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} CRITICAL: Total Dead: 108 | 'total_running'=31;;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;0:2;0;258 'total_exited'=19;;;0;258
... 12 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Total Exited: 19 | 'total_running'=31;;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;0:2;;0;258
... 13 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} CRITICAL: Total Exited: 19 | 'total_running'=31;;;0;258 'total_failed'=4;;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;0:2;0;258
... 14 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 ${EMPTY} WARNING: Total Failed: 4 | 'total_running'=31;;;0;258 'total_failed'=4;0:2;;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;;0;258
... 15 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} 2 CRITICAL: Total Failed: 4 | 'total_running'=31;;;0;258 'total_failed'=4;;0:2;0;258 'total_dead'=108;;;0;258 'total_exited'=19;;;0;258

View File

@ -1,17 +1,8 @@
2c
--warning-authservers-total
--critical-authservers-total
--warning-authserver-roundtrip-time
--critical-authserver-roundtrip-time
--warning-authserver-packets-access-requests
--critical-authserver-packets-access-requests
--warning-authserver-packets-access-accepts
--critical-authserver-packets-access-accepts
--warning-authserver-clients-timeout
--critical-authserver-clients-timeout
3COM
3CX
--3cx-version
ACS
--add-fc-fe-errors
--add-qos-limit
--add-sysdesc
@ -28,6 +19,7 @@ api.meraki.com
--api-version
ASAM
Avigilon
Avocent
aws
AWSCLI
--aws-role-arn
@ -43,6 +35,11 @@ connections-dns
cpu-utilization-1m
cpu-utilization-5m
cpu-utilization-5s
--critical-authserver-clients-timeout
--critical-authserver-packets-access-accepts
--critical-authserver-packets-access-requests
--critical-authserver-roundtrip-time
--critical-authservers-total
--critical-backend-congestions
--critical-backend-outstanding-io
--critical-bytesallocatedpercentage
@ -96,7 +93,6 @@ ipv4
ipv6
ISAM
Iwsva
--jobq
JOBQ
jobqueue
jobqueues
@ -125,7 +121,6 @@ module-cellradio-rsrq
module-cellradio-snr
modules-cellradio-detected
Mosquitto
--mqtt
MQTT
--mqtt-allow-insecure
--mqtt-ca-certificate
@ -137,7 +132,6 @@ MQTT
--mqtt-timeout
--mqtt-username
multiple
nagios
Nagios
NagVis
--nagvis-perfdata
@ -148,10 +142,8 @@ NLCapacity
--noidle
-NoLogo
--nomachineaccount
--ntlmv2
NTLMv2
NTP
--oid
OID
--oid-display
--oid-extra-display
@ -218,6 +210,11 @@ VM
VMware
VPN
vSAN
--warning-authserver-clients-timeout
--warning-authserver-packets-access-accepts
--warning-authserver-packets-access-requests
--warning-authserver-roundtrip-time
--warning-authservers-total
--warning-backend-congestions
--warning-backend-outstanding-io
--warning-bytesallocatedpercentage

View File

@ -0,0 +1,33 @@
*** Settings ***
Documentation datacore rest api plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon
Test Timeout 120s
*** Variables ***
${MOCKOON_JSON} ${CURDIR}${/}storage-datacore-api.json
${CMD} ${CENTREON_PLUGINS} --plugin=storage::datacore::restapi::plugin --password=pass --username=user --port=${APIPORT} --hostname=${HOSTNAME} --proto=http
*** Test Cases ***
Datacore check alert count ${tc}
[Documentation] Check Datacore pool usage
[Tags] storage api
${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: tc warning-error critical-error warning-warning critical-warning expected_result --
... 1 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;
... 2 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;

View File

@ -31,34 +31,4 @@ Datacore check pool usage ${tc}
Examples: tc warning-bytesallocatedpercentage critical-bytesallocatedpercentage warning-oversubscribed critical-oversubscribed expected_result --
... 1 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;
... 2 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 ${tc}
[Documentation] Check Datacore pool usage
[Tags] storage api
${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: tc warning-error critical-error warning-warning critical-warning expected_result --
... 1 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;
... 2 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 ${tc}
[Documentation] Check Datacore pool usage
[Tags] storage api
${command} Catenate
... ${CMD}
... --mode=status-monitor
... --statefile-dir=/dev/shm/
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc expected_result --
... 1 CRITICAL: 'State of HostVM2' status : 'Critical', message is 'Connected'
... 2 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;

View File

@ -0,0 +1,29 @@
*** Settings ***
Documentation datacore rest api plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Start Mockoon ${MOCKOON_JSON}
Suite Teardown Stop Mockoon
Test Timeout 120s
*** Variables ***
${MOCKOON_JSON} ${CURDIR}${/}storage-datacore-api.json
${CMD} ${CENTREON_PLUGINS} --plugin=storage::datacore::restapi::plugin --password=pass --username=user --port=${APIPORT} --hostname=${HOSTNAME} --proto=http
*** Test Cases ***
Datacore check status monitor ${tc}
[Documentation] Check Datacore pool usage
[Tags] storage api
${command} Catenate
... ${CMD}
... --mode=status-monitor
... --statefile-dir=/dev/shm/
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc expected_result --
... 1 CRITICAL: 'State of HostVM2' status : 'Critical', message is 'Connected'

View File

@ -0,0 +1,29 @@
*** Settings ***
Documentation Storage Synology SNMP
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=storage::synology::snmp::plugin
*** Test Cases ***
Components ${tc}
[Tags] storage synology snmp
${command} Catenate
... ${CMD}
... --mode=components
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=${snmpcommunity}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc snmpcommunity expected_result --
... 1 storage/synology/snmp/synology-disk-ok OK: All 8 components are ok [2/2 disk, 2/2 fan, 1/1 psu, 2/2 raid, 1/1 system]. | 'Disk 1#hardware.disk.bad_sectors.count'=0;;;0; 'Disk 2#hardware.disk.bad_sectors.count'=0;;;0; 'hardware.disk.count'=2;;;; 'hardware.fan.count'=2;;;; 'hardware.psu.count'=1;;;; 'hardware.raid.count'=2;;;; 'hardware.system.count'=1;;;;
... 2 storage/synology/snmp/synology-disk-warning WARNING: Disk 'Disk 2' health is warning | 'Disk 1#hardware.disk.bad_sectors.count'=0;;;0; 'Disk 2#hardware.disk.bad_sectors.count'=0;;;0; 'hardware.disk.count'=2;;;; 'hardware.fan.count'=2;;;; 'hardware.psu.count'=1;;;; 'hardware.raid.count'=2;;;; 'hardware.system.count'=1;;;;
... 3 storage/synology/snmp/synology-disk-critical CRITICAL: Disk 'Disk 2' health is critical | 'Disk 1#hardware.disk.bad_sectors.count'=0;;;0; 'Disk 2#hardware.disk.bad_sectors.count'=0;;;0; 'hardware.disk.count'=2;;;; 'hardware.fan.count'=2;;;; 'hardware.psu.count'=1;;;; 'hardware.raid.count'=2;;;; 'hardware.system.count'=1;;;;
... 4 storage/synology/snmp/synology-disk-failing CRITICAL: Disk 'Disk 2' health is failing | 'Disk 1#hardware.disk.bad_sectors.count'=0;;;0; 'Disk 2#hardware.disk.bad_sectors.count'=0;;;0; 'hardware.disk.count'=2;;;; 'hardware.fan.count'=2;;;; 'hardware.psu.count'=1;;;; 'hardware.raid.count'=2;;;; 'hardware.system.count'=1;;;;

View File

@ -0,0 +1,30 @@
*** Settings ***
Documentation Storage Synology SNMP
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=storage::synology::snmp::plugin
*** Test Cases ***
Uptime ${tc}
[Tags] storage synology snmp
${command} Catenate
... ${CMD}
... --mode=uptime
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=storage/synology/snmp/synology-disk-ok
... --warning-uptime=${warning}
... --critical-uptime=${critical}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc warning critical expected_result --
... 1 ${Empty} ${Empty} OK: System uptime is: 46m 5s | 'uptime'=2765.00s;;;0;
... 2 10 ${Empty} WARNING: System uptime is: 46m 5s | 'uptime'=2765.00s;0:10;;0;
... 3 ${Empty} 10 CRITICAL: System uptime is: 46m 5s | 'uptime'=2765.00s;;0:10;0;

View File

@ -1,88 +0,0 @@
*** Settings ***
Documentation Storage Synology SNMP
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=storage::synology::snmp::plugin
&{check_components_test1}
... description=Checking disk components when all disks are ok
... snmpcommunity=storage/synology/snmp/synology-disk-ok
... expected_output=OK: All 8 components are ok [2/2 disk, 2/2 fan, 1/1 psu, 2/2 raid, 1/1 system]. | 'Disk 1#hardware.disk.bad_sectors.count'=0;;;0; 'Disk 2#hardware.disk.bad_sectors.count'=0;;;0; 'hardware.disk.count'=2;;;; 'hardware.fan.count'=2;;;; 'hardware.psu.count'=1;;;; 'hardware.raid.count'=2;;;; 'hardware.system.count'=1;;;;
&{check_components_test2}
... description=Checking disk components when one disks is warning
... snmpcommunity=storage/synology/snmp/synology-disk-warning
... expected_output=WARNING: Disk 'Disk 2' health is warning | 'Disk 1#hardware.disk.bad_sectors.count'=0;;;0; 'Disk 2#hardware.disk.bad_sectors.count'=0;;;0; 'hardware.disk.count'=2;;;; 'hardware.fan.count'=2;;;; 'hardware.psu.count'=1;;;; 'hardware.raid.count'=2;;;; 'hardware.system.count'=1;;;;
&{check_components_test3}
... description=Checking disk components when one disks is critical
... snmpcommunity=storage/synology/snmp/synology-disk-critical
... expected_output=CRITICAL: Disk 'Disk 2' health is critical | 'Disk 1#hardware.disk.bad_sectors.count'=0;;;0; 'Disk 2#hardware.disk.bad_sectors.count'=0;;;0; 'hardware.disk.count'=2;;;; 'hardware.fan.count'=2;;;; 'hardware.psu.count'=1;;;; 'hardware.raid.count'=2;;;; 'hardware.system.count'=1;;;;
&{check_components_test4}
... description=Checking disk components when one disks is failing
... snmpcommunity=storage/synology/snmp/synology-disk-failing
... expected_output=CRITICAL: Disk 'Disk 2' health is failing | 'Disk 1#hardware.disk.bad_sectors.count'=0;;;0; 'Disk 2#hardware.disk.bad_sectors.count'=0;;;0; 'hardware.disk.count'=2;;;; 'hardware.fan.count'=2;;;; 'hardware.psu.count'=1;;;; 'hardware.raid.count'=2;;;; 'hardware.system.count'=1;;;;
@{check_components_tests}
... &{check_components_test1}
... &{check_components_test2}
... &{check_components_test3}
... &{check_components_test4}
&{uptime_t1}
... description=Uptime check expected to be OK
... snmpcommunity=storage/synology/snmp/synology-disk-ok
... warning=
... critical=
... expected_output=OK: System uptime is: 46m 5s | 'uptime'=2765.00s;;;0;
&{uptime_t2}
... description=Uptime check expected to be warning
... snmpcommunity=storage/synology/snmp/synology-disk-ok
... warning=10
... critical=
... expected_output=WARNING: System uptime is: 46m 5s | 'uptime'=2765.00s;0:10;;0;
&{uptime_t3}
... description=Uptime check expected to be critical
... snmpcommunity=storage/synology/snmp/synology-disk-ok
... warning=
... critical=10
... expected_output=CRITICAL: System uptime is: 46m 5s | 'uptime'=2765.00s;;0:10;0;
@{uptime_tests}
... &{uptime_t1}
... &{uptime_t2}
... &{uptime_t3}
*** Test Cases ***
Components
[Tags] storage synology snmp
FOR ${check_components_test} IN @{check_components_tests}
${command} Catenate
... ${CMD}
... --mode=components
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=${check_components_test.snmpcommunity}
Ctn Run Command And Check Result As Strings ${command} ${check_components_test.expected_output}
END
Uptime
[Tags] storage synology snmp
FOR ${test_item} IN @{uptime_tests}
${command} Catenate
... ${CMD}
... --mode=uptime
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=${test_item.snmpcommunity}
... --warning-uptime=${test_item.warning}
... --critical-uptime=${test_item.critical}
Ctn Run Command And Check Result As Strings ${command} ${test_item.expected_output}
END