| 1 |
*** Settings *** |
| 2 |
Documentation Hardware UPS Socomec Netvision SNMP plugin |
| 3 |
|
| 4 |
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource |
| 5 |
|
| 6 |
Test Timeout 120s |
| 7 |
|
| 8 |
|
| 9 |
*** Variables *** |
| 10 |
${CMD} ${CENTREON_PLUGINS} --plugin=hardware::ups::socomec::netvision::snmp::plugin |
| 11 |
|
| 12 |
|
| 13 |
*** Test Cases *** |
| 14 |
Battery ${tc}/4 |
| 15 |
[Tags] hardware ups snmp |
| 16 |
${command} Catenate |
| 17 |
... ${CMD} |
| 18 |
... --mode=battery |
| 19 |
... --hostname=${HOSTNAME} |
| 20 |
... --snmp-version=${SNMPVERSION} |
| 21 |
... --snmp-port=${SNMPPORT} |
| 22 |
... --snmp-community=hardware/ups/socomec/netvision/snmp/battery |
| 23 |
|
| 24 |
# Append options to command |
| 25 |
${opt} Append Option --warning-temperature ${w_temperature} |
| 26 |
${command} Catenate ${command} ${opt} |
| 27 |
${opt} Append Option --critical-temperature ${c_temperature} |
| 28 |
${command} Catenate ${command} ${opt} |
| 29 |
|
| 30 |
Ctn Run Command And Check Result As Strings ${command} ${expected_result} |
| 31 |
|
| 32 |
Examples: tc w_temperature c_temperature expected_result -- |
| 33 |
... 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;; |
| 34 |
... 2 20 50 WARNING: temperature: 22 C | 'battery.charge.remaining.percent'=100%;;;0;100 'battery.charge.remaining.minutes'=0;;;0; 'battery.voltage.volt'=339.1V;;;; 'battery.temperature.celsius'=22C;0:20;0:50;; |
| 35 |
... 3 10 20 CRITICAL: temperature: 22 C | 'battery.charge.remaining.percent'=100%;;;0;100 'battery.charge.remaining.minutes'=0;;;0; 'battery.voltage.volt'=339.1V;;;; 'battery.temperature.celsius'=22C;0:10;0:20;; |
| 36 |
... 4 _empty_ _empty_ 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;;;; |
| 37 |
|
| 38 |
|
| 39 |
*** Keywords *** |
| 40 |
Append Option |
| 41 |
[Documentation] Concatenates the first argument (option) with the second (value) after having replaced the value with "" if its content is '_empty_' |
| 42 |
[Arguments] ${option} ${value} |
| 43 |
${value} Set Variable If '${value}' == '_empty_' '' ${value} |
| 44 |
RETURN ${option}=${value} |