Skip to content

Commit

Permalink
enh(tests): enhanced what is displayed in the console
Browse files Browse the repository at this point in the history
  • Loading branch information
omercier committed Nov 28, 2023
1 parent 10090e8 commit dba74c2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/functional/snmp/storage-synology-snmp.robot
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ ${CENTREON_PLUGINS} ${CURDIR}${/}..${/}..${/}..${/}src${/}centreon_plugi
${CMD} perl ${CENTREON_PLUGINS} --plugin=storage::synology::snmp::plugin

&{check_components_test1}
... description=Checking disk components when all disks are ok
... snmpcommunity=synology_component_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=synology_component_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=synology_component_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=synology_component_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}
Expand All @@ -32,7 +36,7 @@ ${CMD} perl ${CENTREON_PLUGINS} --plugin=storage::synology:


*** Test Cases ***
Synology SNMP check disk components
Synology SNMP: Checking disk components
[Documentation] Monitor the different states of disk health
[Tags] storage synology snmp
FOR ${check_components_test} IN @{check_components_tests}
Expand All @@ -44,8 +48,9 @@ Synology SNMP check disk components
... --snmp-port=2024
${command} Catenate ${command} --snmp-community=${check_components_test.snmpcommunity}
${output} Run ${command}
Log To Console ${command}
Log To Console Synology SNMP: Checking disk components
Should Be Equal As Strings
... Log To Console ${check_components_test.description}
... ${check_components_test.expected_output}
... ${output}
... Wrong output for components mode: ${check_components_test}.{\n}Command output:{\n}${output}
Expand Down

0 comments on commit dba74c2

Please sign in to comment.