ENH(test):add new tests for aix

This commit is contained in:
sfarouq-ext 2025-08-24 17:58:35 +02:00
parent e800def677
commit 5e2d096814
10 changed files with 2114 additions and 0 deletions

View File

@ -0,0 +1,31 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Ctn Generic Suite Setup
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin
*** Test Cases ***
cpu ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=cpu
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --verbose OK: 8 CPU(s) average usage is 17.50 % | 'total_cpu_avg'=17.50%;;;0;100 'cpu_0'=91.00%;;;0;100 'cpu_1'=22.00%;;;0;100 'cpu_2'=13.00%;;;0;100 'cpu_3'=6.00%;;;0;100 'cpu_4'=0.00%;;;0;100 'cpu_5'=1.00%;;;0;100 'cpu_6'=6.00%;;;0;100 'cpu_7'=1.00%;;;0;100 CPU '0' usage : 91.00 % CPU '1' usage : 22.00 % CPU '2' usage : 13.00 % CPU '3' usage : 6.00 % CPU '4' usage : 0.00 % CPU '5' usage : 1.00 % CPU '6' usage : 6.00 % CPU '7' usage : 1.00 %
... 2 --warning-average=3 --critical-average=5 CRITICAL: 8 CPU(s) average usage is 17.50 % | 'total_cpu_avg'=17.50%;0:3;0:5;0;100 'cpu_0'=91.00%;;;0;100 'cpu_1'=22.00%;;;0;100 'cpu_2'=13.00%;;;0;100 'cpu_3'=6.00%;;;0;100 'cpu_4'=0.00%;;;0;100 'cpu_5'=1.00%;;;0;100 'cpu_6'=6.00%;;;0;100 'cpu_7'=1.00%;;;0;100
... 3 --warning-core=5 WARNING: CPU '0' usage : 91.00 % - CPU '1' usage : 22.00 % - CPU '2' usage : 13.00 % - CPU '3' usage : 6.00 % - CPU '6' usage : 6.00 % | 'total_cpu_avg'=17.50%;;;0;100 'cpu_0'=91.00%;0:5;;0;100 'cpu_1'=22.00%;0:5;;0;100 'cpu_2'=13.00%;0:5;;0;100 'cpu_3'=6.00%;0:5;;0;100 'cpu_4'=0.00%;0:5;;0;100 'cpu_5'=1.00%;0:5;;0;100 'cpu_6'=6.00%;0:5;;0;100 'cpu_7'=1.00%;0:5;;0;100
... 4 --warning-core=3 --critical-core=5 CRITICAL: CPU '0' usage : 91.00 % - CPU '1' usage : 22.00 % - CPU '2' usage : 13.00 % - CPU '3' usage : 6.00 % - CPU '6' usage : 6.00 % | 'total_cpu_avg'=17.50%;;;0;100 'cpu_0'=91.00%;0:3;0:5;0;100 'cpu_1'=22.00%;0:3;0:5;0;100 'cpu_2'=13.00%;0:3;0:5;0;100 'cpu_3'=6.00%;0:3;0:5;0;100 'cpu_4'=0.00%;0:3;0:5;0;100 'cpu_5'=1.00%;0:3;0:5;0;100 'cpu_6'=6.00%;0:3;0:5;0;100 'cpu_7'=1.00%;0:3;0:5;0;100

View File

@ -0,0 +1,35 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Ctn Generic Suite Setup
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin
*** Test Cases ***
interfaces ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=interfaces
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=5
... ${extra_options}
# first run to build cache
Run ${command}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 ${EMPTY} OK: Interface 'en0' Status : up (admin: up)
... 2 --warning-status='\\\%{admstatus}' WARNING: Interface 'en0' Status : up (admin: up)
... 3 --critical-status='\\\%{admstatus}' CRITICAL: Interface 'en0' Status : up (admin: up)
... 4 --display-transform-src='en0' --display-transform-dst='test' OK: Interface 'test' Status : up (admin: up)
... 5 --interface=1 OK: Interface 'en0' Status : up (admin: up)

View File

@ -0,0 +1,30 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Ctn Generic Suite Setup
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin
*** Test Cases ***
list-interfaces ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=list-interfaces
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 ${EMPTY} List interfaces: 'en0' [speed = 1500][status = up][id = 1][type = ethernetCsmacd]
... 2 --name='en0' List interfaces: 'en0' [speed = 1500][status = up][id = 1][type = ethernetCsmacd]
... 3 --display-transform-src='en0' --display-transform-dst='test' List interfaces: 'test' [speed = 1500][status = up][id = 1][type = ethernetCsmacd]

View File

@ -0,0 +1,29 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Ctn Generic Suite Setup
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin
*** Test Cases ***
list-processes ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=list-processes
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --filter-name='Anonymized 136' List processes: [name = Anonymized 136] [path = Anonymized 008] [parameters = ] [type = deviceDriver] [pid = 5] [status = notRunnable]
... 2 --add-stats --filter-name='Anonymized 129' List processes: [name = Anonymized 129] [path = /usr/lib/drivers/vdev_busdd] [parameters = ] [type = deviceDriver] [pid = 47] [status = notRunnable] [cpu = 0] [mem = 0]

View File

@ -0,0 +1,29 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Ctn Generic Suite Setup
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin
*** Test Cases ***
list-storages ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=list-storages
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --verbose --storage=1 List storage: '/dev/hd4' [size = 1073741824B] [id = 1]
... 2 --display-transform-src='Anonymized 205' --display-transform-dst='test' List storage: '/dev/hd4' [size = 1073741824B] [id = 1] '/dev/lv_logiciel' [size = 212600881152B] [id = 10] '/dev/lv_statsnmon' [size = 1073741824B] [id = 11] '/dev/lv_exp0x00' [size = 536870912B] [id = 12] '/dev/lv_oradiag' [size = 4294967296B] [id = 13] '/dev/lvrubrik' [size = 268435456B] [id = 14] '/dev/lv_automx01' [size = 1073741824B] [id = 15] '/dev/lvorar1DJET4' [size = 4294967296B] [id = 16] '/dev/lvorar2DJET4' [size = 4294967296B] [id = 17] '/dev/lvorafraDJET4' [size = 53687091200B] [id = 18] '/dev/lvoradbDJET4' [size = 429496729600B] [id = 19] '/dev/hd2' [size = 5368709120B] [id = 2] '/dev/lvoradpDJET4' [size = 805306368B] [id = 20] '/dev/lv_automx02' [size = 2147483648B] [id = 21] Skipping storage '/dev/hd6': no type or no matching filter type Skipping storage 'test': no type or no matching filter type '/dev/hd9var' [size = 1140850688B] [id = 3] '/dev/hd3' [size = 2147483648B] [id = 4] '/dev/hd1' [size = 603979776B] [id = 5] '/dev/hd11admin' [size = 134217728B] [id = 6] '/dev/hd10opt' [size = 4966055936B] [id = 7] '/dev/livedump' [size = 268435456B] [id = 8] '/dev/lv_automx00' [size = 1073741824B] [id = 9]

View File

@ -0,0 +1,40 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Ctn Generic Suite Setup
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin
*** Test Cases ***
processcount ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=processcount
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 ${EMPTY} --top OK: Number of current processes running: 131 | 'nbproc'=131;;;0; 'top_'=375496704B;;;0;
... 2 --process-status='running|runnable' OK: Number of current processes running: 131 | 'nbproc'=131;;;0;
... 3 --process-name=85 OK: Number of current processes running: 0 | 'nbproc'=0;;;0;
... 4 --process-args OK: Number of current processes running: 131 | 'nbproc'=131;;;0;
... 5 --warning=5 WARNING: Number of current processes running: 131 | 'nbproc'=131;0:5;;0;
... 6 --critical=8 CRITICAL: Number of current processes running: 131 | 'nbproc'=131;;0:8;0;
... 7 --memory OK: Number of current processes running: 131 - Total memory usage: 452.86 MB - Average memory usage: 3.46 MB | 'nbproc'=131;;;0; 'mem_total'=474857472B;;;0; 'mem_avg'=3624866.20B;;;0;
... 8 --warning-mem-total=5 --memory WARNING: Total memory usage: 452.86 MB | 'nbproc'=131;;;0; 'mem_total'=474857472B;0:5;;0; 'mem_avg'=3624866.20B;;;0;
... 9 --critical-mem-total=4 --memory CRITICAL: Total memory usage: 452.86 MB | 'nbproc'=131;;;0; 'mem_total'=474857472B;;0:4;0; 'mem_avg'=3624866.20B;;;0;
... 10 --warning-mem-avg=3 --memory WARNING: Average memory usage: 3.46 MB | 'nbproc'=131;;;0; 'mem_total'=474857472B;;;0; 'mem_avg'=3624866.20B;0:3;;0;
... 11 --critical-mem-avg=3 --memory CRITICAL: Average memory usage: 3.46 MB | 'nbproc'=131;;;0; 'mem_total'=474857472B;;;0; 'mem_avg'=3624866.20B;;0:3;0;
... 12 --warning-cpu-total=10 --cpu OK: Number of current processes running: 131 | 'nbproc'=131;;;0;
... 13 --critical-cpu-total=5 --cpu OK: Number of current processes running: 131 - Total CPU usage: 0.00 % | 'nbproc'=131;;;0; 'cpu_total'=0.00%;;0:5;0;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Ctn Generic Suite Setup
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin
*** Test Cases ***
storage ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=storage
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=5
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 ${EMPTY} --storage=2 OK: Storage '/dev/hd2' Usage Total: 5.00 GB Used: 3.35 GB (66.97%) Free: 1.65 GB (33.03%) | 'count'=1;;;0; 'used'=3595264000B;;;0;5368709120
... 2 --warning-usage=45 --storage=1 WARNING: Storage '/dev/hd4' Usage Total: 1.00 GB Used: 498.18 MB (48.65%) Free: 525.82 MB (51.35%) | 'count'=1;;;0; 'used'=522375168B;0:483183820;;0;1073741824
... 3 --critical-usage=40 --storage=1 CRITICAL: Storage '/dev/hd4' Usage Total: 1.00 GB Used: 498.18 MB (48.65%) Free: 525.82 MB (51.35%) | 'count'=1;;;0; 'used'=522375168B;;0:429496729;0;1073741824
... 4 --free=51 --storage=1 OK: Storage '/dev/hd4' Usage Total: 1.00 GB Used: 498.18 MB (48.65%) Free: 525.82 MB (51.35%) | 'count'=1;;;0; 'free'=551366656B;;;0;1073741824
... 5 --critical-access=readWrite OK: All storages are ok | 'count'=21;;;0; 'used_/dev/hd4'=522375168B;;;0;1073741824 'used_/dev/lv_logiciel'=30902849536B;;;0;212600881152 'used_/dev/lv_statsnmon'=499585024B;;;0;1073741824 'used_/dev/lv_exp0x00'=151797760B;;;0;536870912 'used_/dev/lv_oradiag'=383913984B;;;0;4294967296 'used_/dev/lvrubrik'=696320B;;;0;268435456 'used_/dev/lv_automx01'=8888320B;;;0;1073741824 'used_/dev/lvorar1DJET4'=3528171520B;;;0;4294967296 'used_/dev/lvorar2DJET4'=3528171520B;;;0;4294967296 'used_/dev/lvorafraDJET4'=152616960B;;;0;53687091200 'used_/dev/lvoradbDJET4'=331419025408B;;;0;429496729600 'used_/dev/hd2'=3595264000B;;;0;5368709120 'used_/dev/lvoradpDJET4'=458752B;;;0;805306368 'used_/dev/lv_automx02'=9052160B;;;0;2147483648 'used_/dev/hd9var'=722554880B;;;0;1140850688 'used_/dev/hd3'=538583040B;;;0;2147483648 'used_/dev/hd1'=122642432B;;;0;603979776 'used_/dev/hd11admin'=389120B;;;0;134217728 'used_/dev/hd10opt'=1821675520B;;;0;4966055936 'used_/dev/livedump'=376832B;;;0;268435456 'used_/dev/lv_automx00'=499712B;;;0;1073741824

View File

@ -0,0 +1,35 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Ctn Generic Suite Setup
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin
*** Test Cases ***
swap ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=swap
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 --verbose OK: Page space 'Anonymized 162' Usage Total: 4.00 GB Used: 0.00 B (0.00%) Free: 4.00 GB (100.00%) | 'page_space'=0B;;;0;4294967296 Page space 'Anonymized 162' Usage Total: 4.00 GB Used: 0.00 B (0.00%) Free: 4.00 GB (100.00%)
... 2 --warning-usage=0 OK: Page space 'Anonymized 162' Usage Total: 4.00 GB Used: 0.00 B (0.00%) Free: 4.00 GB (100.00%) | 'page_space'=0B;0:0;;0;4294967296
... 3 --critical-usage=0 OK: Page space 'Anonymized 162' Usage Total: 4.00 GB Used: 0.00 B (0.00%) Free: 4.00 GB (100.00%) | 'page_space'=0B;;0:0;0;4294967296
... 4 --warning-total-usage=4 OK: Page space 'Anonymized 162' Usage Total: 4.00 GB Used: 0.00 B (0.00%) Free: 4.00 GB (100.00%) | 'page_space'=0B;;;0;4294967296
... 5 --critical-total-usage=3 OK: Page space 'Anonymized 162' Usage Total: 4.00 GB Used: 0.00 B (0.00%) Free: 4.00 GB (100.00%) | 'page_space'=0B;;;0;4294967296
... 6 --warning-total-active=4 OK: Page space 'Anonymized 162' Usage Total: 4.00 GB Used: 0.00 B (0.00%) Free: 4.00 GB (100.00%) | 'page_space'=0B;;;0;4294967296
... 7 --critical-total-active=3 OK: Page space 'Anonymized 162' Usage Total: 4.00 GB Used: 0.00 B (0.00%) Free: 4.00 GB (100.00%) | 'page_space'=0B;;;0;4294967296
... 8 --paging-state-buggy OK:

View File

@ -0,0 +1,33 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Suite Setup Ctn Generic Suite Setup
Test Timeout 120s
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin
*** Test Cases ***
uptime ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=uptime
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=5
... ${extra_options}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 ${EMPTY} OK: System uptime is: 100d 22h 2m 45s | 'uptime'=8719365.00s;;;0;
... 2 --warning-uptime=5 WARNING: System uptime is: 100d 22h 2m 45s | 'uptime'=8719365.00s;0:5;;0;
... 3 --critical-uptime=4 CRITICAL: System uptime is: 100d 22h 2m 45s | 'uptime'=8719365.00s;;0:4;0;
... 4 --add-sysdesc OK: System uptime is: 100d 22h 2m 45s, Anonymized 023Machine Type: 0x0800004c Processor id: 00C812714B00Base Operating System Runtime AIX version: 07.03.0002.0003TCP/IP Client Core Support version: 07.03.0002.0001 | 'uptime'=8719365.00s;;;0;
... 5 --check-overload OK: System uptime is: 100d 22h 2m 45s | 'uptime'=8719365.00s;;;0;
... 6 --unit=hd1 OK: System uptime is: 100d 22h 2m 45s | 'uptime'=8719365.00s;;;0;