centreon-plugins/tests/apps/protocols/snmp/collection-sputnik.robot
sfarouq-ext 4730dc1891
enh(tests): enable testing with collect's perl connector (#5641)
Co-authored-by: omercier <omercier@centreon.com>
refs: CTOR-1244
2025-08-28 10:53:59 +02:00

41 lines
1.8 KiB
Plaintext

*** Settings ***
Documentation Hardware UPS Sputnik SNMP plugin
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource
Test Timeout 120s
Suite Setup Ctn Generic Suite Setup
Suite Teardown Ctn Generic Suite Teardown
*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=apps::protocols::snmp::plugin
*** Test Cases ***
SNMP Collection - Sputnik Environment ${tc}/3
[Tags] snmp collection
${command} Catenate
... ${CMD}
... --mode=collection
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=apps/protocols/snmp/collection-sputnik
... --config=${CURDIR}${/}..${/}..${/}..${/}..${/}src/contrib/collection/snmp/sputnik-environment.json
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc expected_result --
... 1 OK: Sensor '1' temperature is '20.06'°C and humidity is '33'% | '1#environment.temperature.celsius'=20.06C;;;; '1#environment.humidity.percent'=33%;;;0;100
... 2 OK: Sensor '1' temperature is '20.06'°C and humidity is '33'% | '1#environment.temperature.celsius'=20.06C;;;; '1#environment.humidity.percent'=33%;;;0;100
... 3 OK: Sensor '1' temperature is '20.06'°C and humidity is '33'% | '1#environment.temperature.celsius'=20.06C;;;; '1#environment.humidity.percent'=33%;;;0;100
*** Keywords ***
Append Option
[Documentation] Concatenates the first argument (option) with the second (value) after having replaced the value with "" if its content is '_empty_'
[Arguments] ${option} ${value}
${value} Set Variable If '${value}' == '_empty_' '' ${value}
RETURN ${option}=${value}