Skip to content

Commit

Permalink
Ctor 862 automated test (#5204)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfarouq-ext authored and omercier committed Oct 28, 2024
1 parent 0818cc0 commit 876399f
Show file tree
Hide file tree
Showing 22 changed files with 11,831 additions and 23 deletions.
35 changes: 35 additions & 0 deletions tests/os/windows/snmp/cpu.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
*** Settings ***
Documentation Check Windows operating systems in SNMP.
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource

Test Timeout 120s


*** Variables ***
${CMD} ${CENTREON_PLUGINS}

*** Test Cases ***
cpu ${tc}
[Tags] os Windows
${command} Catenate
... ${CMD}
... --plugin=os::windows::snmp::plugin
... --mode=cpu
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/windows/snmp/windows_anon
... --snmp-timeout=1
... --critical-average=${critical-average}
... --warning-average=${warning-average}
... --warning-core=${warning-core}
... --critical-core=${critical-core}

Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc critical-average warning-average warning-core critical-core expected_result --
... 2 '90' '80' ${EMPTY} ${EMPTY} OK: 2 CPU(s) average usage is 0.50 % | 'total_cpu_avg'=0.50%;0:80;0:90;0;100 'cpu_0'=1.00%;;;0;100 'cpu_1'=0.00%;;;0;100
... 3 '1180' '0' ${EMPTY} ${EMPTY} WARNING: 2 CPU(s) average usage is 0.50 % | 'total_cpu_avg'=0.50%;0:0;0:1180;0;100 'cpu_0'=1.00%;;;0;100 'cpu_1'=0.00%;;;0;100
... 4 ${EMPTY} ${EMPTY} '0' '0' CRITICAL: CPU '0' usage : 1.00 % | 'total_cpu_avg'=0.50%;;;0;100 'cpu_0'=1.00%;0:0;0:0;0;100 'cpu_1'=0.00%;0:0;0:0;0;100
... 5 '0' '0' ${EMPTY} ${EMPTY} CRITICAL: 2 CPU(s) average usage is 0.50 % | 'total_cpu_avg'=0.50%;0:0;0:0;0;100 'cpu_0'=1.00%;;;0;100 'cpu_1'=0.00%;;;0;100
32 changes: 32 additions & 0 deletions tests/os/windows/snmp/interfaces.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*** Settings ***
Documentation Check Windows operating systems in SNMP.
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource

Test Timeout 120s


*** Variables ***
${CMD} ${CENTREON_PLUGINS}

*** Test Cases ***
interfaces ${tc}
[Tags] os Windows
${command} Catenate
... ${CMD}
... --plugin=os::windows::snmp::plugin
... --mode=interfaces
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/windows/snmp/interfaces
... --snmp-timeout=1
... ${extra_options}

Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 --verbose CRITICAL: Interface 'Anonymized 232' Status : down (admin: up) - Interface 'Anonymized 184' Status : down (admin: up) - Interface 'Anonymized 101' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 232' Status : down (admin: up) - Interface 'Anonymized 072' Status : down (admin: up)${SPACE}Interface 'Anonymized 250' Status : up (admin: up)${SPACE}Interface 'Anonymized 012' Status : notPresent (admin: down)${SPACE}Interface 'Anonymized 118' Status : notPresent (admin: down)${SPACE}Interface 'Anonymized 073' Status : up (admin: up)${SPACE}Interface 'Anonymized 071' Status : up (admin: up)${SPACE}Interface 'Anonymized 073' Status : up (admin: up)${SPACE}Interface 'Anonymized 232' Status : down (admin: up)${SPACE}Interface 'Anonymized 191' Status : up (admin: up)${SPACE}Interface 'Anonymized 242' Status : up (admin: up)${SPACE}Interface 'Anonymized 175' Status : up (admin: up)${SPACE}Interface 'Anonymized 128' Status : up (admin: up)${SPACE}Interface 'Anonymized 037' Status : notPresent (admin: down)${SPACE}Interface 'Anonymized 080' Status : up (admin: up)${SPACE}Interface 'Anonymized 229' Status : up (admin: up)${SPACE}Interface 'Anonymized 248' Status : up (admin: up)${SPACE}Interface 'Anonymized 092' Status : up (admin: up)${SPACE}Interface 'Anonymized 187' Status : up (admin: up)${SPACE}Interface 'Anonymized 184' Status : down (admin: up)${SPACE}Interface 'Anonymized 101' Status : down (admin: up)${SPACE}Interface 'Anonymized 252' Status : notPresent (admin: down)${SPACE}Interface 'Anonymized 012' Status : down (admin: up)${SPACE}Interface 'Anonymized 232' Status : down (admin: up)${SPACE}Interface 'Anonymized 072' Status : down (admin: up)${SPACE}Interface 'Anonymized 037' Status : up (admin: up)
... 2 --display-transform-src='eth' --display-transform-dst='ens' CRITICAL: Interface 'Anonymized 232' Status : down (admin: up) - Interface 'Anonymized 184' Status : down (admin: up) - Interface 'Anonymized 101' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 232' Status : down (admin: up) - Interface 'Anonymized 072' Status : down (admin: up)
... 3 --oid-display='ifName' CRITICAL: Interface 'Anonymized 232' Status : down (admin: up) - Interface 'Anonymized 184' Status : down (admin: up) - Interface 'Anonymized 101' Status : down (admin: up) - Interface 'Anonymized 012' Status : down (admin: up) - Interface 'Anonymized 232' Status : down (admin: up) - Interface 'Anonymized 072' Status : down (admin: up)
... 4 --oid-extra-display='ifDesc' CRITICAL: Interface 'Anonymized 232' [ WAN Miniport (L2TP) ] Status : down (admin: up) - Interface 'Anonymized 184' [ WAN Miniport (IKEv2) ] Status : down (admin: up) - Interface 'Anonymized 101' [ WAN Miniport (SSTP) ] Status : down (admin: up) - Interface 'Anonymized 012' [ WAN Miniport (GRE) ] Status : down (admin: up) - Interface 'Anonymized 232' [ WAN Miniport (PPPOE) ] Status : down (admin: up) - Interface 'Anonymized 072' [ WAN Miniport (PPTP) ] Status : down (admin: up)
Loading

0 comments on commit 876399f

Please sign in to comment.