diff --git a/tests/resources/import.resource b/tests/resources/import.resource index ce5505009..ad856b220 100644 --- a/tests/resources/import.resource +++ b/tests/resources/import.resource @@ -1,5 +1,6 @@ *** Settings *** -Documentation This is the documentation for the import resource file. +Documentation This is the documentation for the import resource file. + Library Examples Library OperatingSystem Library String diff --git a/tests/resources/resources.resource b/tests/resources/resources.resource index 542c4ef90..9d8d1cd44 100644 --- a/tests/resources/resources.resource +++ b/tests/resources/resources.resource @@ -1,12 +1,19 @@ *** Settings *** Documentation Centreon Plugins for Robot Framework + Library Process + *** Variables *** -${CENTREON_PLUGINS} perl ${CURDIR}${/}..${/}..${/}src${/}centreon_plugins.pl +${CENTREON_PLUGINS} perl ${CURDIR}${/}..${/}..${/}src${/}centreon_plugins.pl # one we use package, we need to remove the "perl" part to be sure the plugin is executable and is correctly formated # with a shebang at the top. -${PERCENT} % +${HOSTNAME} 127.0.0.1 +${APIPORT} 3000 +${SNMPPORT} 2024 +${SNMPVERSION} 2c +${PERCENT} % + *** Keywords *** Start Mockoon @@ -19,5 +26,6 @@ Start Mockoon ... --port ... 3000 Sleep 10s + Stop Mockoon - Terminate All Processes \ No newline at end of file + Terminate All Processes diff --git a/tests/robot/apps/automation/ansible/tower/ansible_tower.json b/tests/robot/apps/automation/ansible/tower/ansible_tower.json index deab256bf..016173f64 100644 --- a/tests/robot/apps/automation/ansible/tower/ansible_tower.json +++ b/tests/robot/apps/automation/ansible/tower/ansible_tower.json @@ -36,12 +36,45 @@ } ], "responseMode": null + }, + { + "uuid": "f912f745-85f5-4313-9852-682f55b256bb", + "type": "http", + "documentation": "", + "method": "get", + "endpoint": "api/v2/unified_jobs", + "responses": [ + { + "uuid": "158d9bce-bc86-4411-8977-afac4a1eaedd", + "body": "{\n \"count\": 1,\n \"next\": {{#if (lt (queryParam 'page') 2)}}\"/api/v2/unified_jobs\"{{else}}null{{/if}},\n \"previous\": {{#if (gte (queryParam 'page') 2)}}\"/api/v2/unified_jobs\"{{else}}null{{/if}},\n \"results\": [\n {\n \"allow_simultaneous\": false,\n \"artifacts\": {},\n \"canceled_on\": null,\n \"controller_node\": \"\",\n \"created\": \"2018-02-01T08:00:00.000000Z\",\n \"description\": \"\",\n \"diff_mode\": false,\n \"elapsed\": 0,\n \"execution_node\": \"\",\n \"extra_vars\": \"{}\",\n \"failed\": false,\n \"finished\": null,\n \"force_handlers\": false,\n \"forks\": 0,\n \"id\": 1,\n \"instance_group\": null,\n \"inventory\": null,\n \"job_explanation\": \"\",\n \"job_slice_count\": 1,\n \"job_slice_number\": 0,\n \"job_tags\": \"\",\n \"job_template\": 1,\n \"job_type\": \"run\",\n \"launch_type\": \"manual\",\n \"limit\": \"\",\n \"modified\": \"2018-02-01T08:00:00.000000Z\",\n \"name\": \"\",\n \"organization\": null,\n \"passwords_needed_to_start\": [],\n \"playbook\": \"\",\n \"project\": null,\n \"related\": {\n \"activity_stream\": \"/api/v2/jobs/1/activity_stream/\",\n \"cancel\": \"/api/v2/jobs/1/cancel/\",\n \"create_schedule\": \"/api/v2/jobs/1/create_schedule/\",\n \"credentials\": \"/api/v2/jobs/1/credentials/\",\n \"job_events\": \"/api/v2/jobs/1/job_events/\",\n \"job_host_summaries\": \"/api/v2/jobs/1/job_host_summaries/\",\n \"job_template\": \"/api/v2/job_templates/1/\",\n \"labels\": \"/api/v2/jobs/1/labels/\",\n \"notifications\": \"/api/v2/jobs/1/notifications/\",\n \"relaunch\": \"/api/v2/jobs/1/relaunch/\",\n \"stdout\": \"/api/v2/jobs/1/stdout/\",\n \"unified_job_template\": \"/api/v2/job_templates/1/\"\n },\n \"scm_branch\": \"\",\n \"scm_revision\": \"\",\n \"skip_tags\": \"\",\n \"start_at_task\": \"\",\n \"started\": null,\n \"status\": \"new\",\n \"summary_fields\": {\n \"credentials\": [],\n \"job_template\": {\n \"description\": \"\",\n \"id\": 1,\n \"name\": \"\"\n },\n \"labels\": {\n \"count\": 0,\n \"results\": []\n },\n \"unified_job_template\": {\n \"description\": \"\",\n \"id\": 1,\n \"name\": \"\",\n \"unified_job_type\": \"job\"\n },\n \"user_capabilities\": {\n \"delete\": true,\n \"start\": false\n }\n },\n \"timeout\": 0,\n \"type\": \"job\",\n \"unified_job_template\": 1,\n \"url\": \"/api/v2/jobs/1/\",\n \"use_fact_cache\": false,\n \"verbosity\": 0,\n \"webhook_credential\": null,\n \"webhook_guid\": \"\",\n \"webhook_service\": \"\"\n }\n ]\n}", + "latency": 0, + "statusCode": 200, + "label": "", + "headers": [], + "bodyType": "INLINE", + "filePath": "", + "databucketID": "", + "sendFileAsBody": false, + "rules": [], + "rulesOperator": "OR", + "disableTemplating": false, + "fallbackTo404": false, + "default": true, + "crudKey": "id", + "callbacks": [] + } + ], + "responseMode": null } ], "rootChildren": [ { "type": "route", "uuid": "781bf78c-43f7-4da1-9515-1d324b7a59d1" + }, + { + "type": "route", + "uuid": "f912f745-85f5-4313-9852-682f55b256bb" } ], "proxyMode": false, diff --git a/tests/robot/apps/automation/ansible/tower/hosts.robot b/tests/robot/apps/automation/ansible/tower/hosts.robot index 6812f9980..7b4e4d7db 100644 --- a/tests/robot/apps/automation/ansible/tower/hosts.robot +++ b/tests/robot/apps/automation/ansible/tower/hosts.robot @@ -3,21 +3,21 @@ Documentation Check the hosts mode with api custom mode Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource +Suite Setup Start Mockoon ${MOCKOON_JSON} +Suite Teardown Stop Mockoon Test Timeout 120s -Test Setup Set Test Variable ${cnt} ${1} -Test Teardown Set Test Variable ${cnt} ${cnt + 1} - - *** Variables *** -${CMD} ${CENTREON_PLUGINS} -... --plugin=apps::automation::ansible::tower::plugin -... --custommode=api -... --hostname=host.docker.internal -... --username=username -... --password=password -... --port=3000 +${MOCKOON_JSON} ${CURDIR}${/}ansible_tower.json + +${CMD} ${CENTREON_PLUGINS} +... --plugin=apps::automation::ansible::tower::plugin +... --custommode=api +... --hostname=${HOSTNAME} +... --username=username +... --password=password +... --port=${APIPORT} *** Test Cases *** diff --git a/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot b/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot index 6edc44e22..5177aaadb 100644 --- a/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot +++ b/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot @@ -15,6 +15,7 @@ ${CMD} ${CENTREON_PLUGINS} ... --no-ps ... --command-options=${CURDIR}/nodeintegrationservice-2022.json + *** Test Cases *** HyperV 2022 ${tc}/3 [Documentation] Apps Microsoft HyperV 2022 @@ -34,4 +35,3 @@ HyperV 2022 ${tc}/3 ... 1 ${EMPTY} CRITICAL: 1 problem(s) detected ... 2 VSERVER05 OK: VM 'VSERVER05' 0 problem(s) detected - VM 'VSERVER05' 0 problem(s) detected ... 3 VSERVER07 CRITICAL: VM 'VSERVER07' 1 problem(s) detected - diff --git a/tests/robot/apps/protocols/http/collection-centreon-web.robot b/tests/robot/apps/protocols/http/collection-centreon-web.robot index 240800dc2..09aa89efd 100644 --- a/tests/robot/apps/protocols/http/collection-centreon-web.robot +++ b/tests/robot/apps/protocols/http/collection-centreon-web.robot @@ -11,9 +11,13 @@ Test Timeout 120s *** Variables *** ${MOCKOON_JSON} ${CURDIR}${/}collection-centreon-web.mockoon.json -${CMD} ${CENTREON_PLUGINS} --plugin apps::protocols::http::plugin --mode collection -... --constant='hostname=127.0.0.1' --constant='protocol=http' --constant='port=3000' -... --constant='username=admin' --constant='password=myPassword' +${CMD} ${CENTREON_PLUGINS} --plugin=apps::protocols::http::plugin +... --mode collection +... --constant='hostname=${HOSTNAME}' +... --constant='protocol=http' +... --constant='port=${APIPORT}' +... --constant='username=admin' +... --constant='password=myPassword' *** Test Cases *** diff --git a/tests/robot/apps/protocols/snmp/collection-sputnik.robot b/tests/robot/apps/protocols/snmp/collection-sputnik.robot index cf95b5cd3..134412437 100644 --- a/tests/robot/apps/protocols/snmp/collection-sputnik.robot +++ b/tests/robot/apps/protocols/snmp/collection-sputnik.robot @@ -16,9 +16,9 @@ SNMP Collection - Sputnik Environment ${tc}/3 ${command} Catenate ... ${CMD} ... --mode=collection - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=apps/protocols/snmp/collection-sputnik ... --config=${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}src/contrib/collection/snmp/sputnik-environment.json diff --git a/tests/robot/apps/protocols/snmp/hashicorp-password-manager.robot b/tests/robot/apps/protocols/snmp/hashicorp-password-manager.robot index 625848d57..41d02f6f1 100644 --- a/tests/robot/apps/protocols/snmp/hashicorp-password-manager.robot +++ b/tests/robot/apps/protocols/snmp/hashicorp-password-manager.robot @@ -9,7 +9,7 @@ Test Timeout 120s *** Variables *** ${MOCKOON_JSON} ${CURDIR}${/}vault-authentication-hashicorp.json -${CMD} ${CENTREON_PLUGINS} --plugin apps::protocols::snmp::plugin --hostname=127.0.0.1 +${CMD} ${CENTREON_PLUGINS} --plugin apps::protocols::snmp::plugin --hostname=${HOSTNAME} *** Test Cases *** @@ -19,16 +19,16 @@ check hashicorp vault manager${Name} ${cmd_hashicorp} Catenate ... ${CMD} ... --pass-manager=hashicorpvault - ... --vault-address=127.0.0.1 - ... --vault-port=3000 + ... --vault-address=${HOSTNAME} + ... --vault-port=${APIPORT} ... --vault-protocol=http ... --auth-method=userpass ... --auth-settings="username=hcvaultuser" ... --secret-path="path/of/the/secret" - ... --snmp-port=2024 + ... --snmp-port=${SNMPPORT} ... --map-option="snmp_community=\\%{value_path/of/the/secret}" ... --mode=string-value - ... --snmp-version=2c + ... --snmp-version=${SNMPVERSION} ... --snmp-community=apps/protocols/snmp/snmp-single-oid ... --oid='.1.3.6.1.2.1.1.1.0' ${path-param} ... --format-ok='current value is: \\%{details_ok}' diff --git a/tests/robot/cloud/azure/policyinsights/policystates/cloud-azure-policyinsights-policystates.robot b/tests/robot/cloud/azure/policyinsights/policystates/cloud-azure-policyinsights-policystates.robot index b5f29c723..f894a142e 100644 --- a/tests/robot/cloud/azure/policyinsights/policystates/cloud-azure-policyinsights-policystates.robot +++ b/tests/robot/cloud/azure/policyinsights/policystates/cloud-azure-policyinsights-policystates.robot @@ -11,29 +11,30 @@ Test Timeout 120s *** Variables *** ${MOCKOON_JSON} ${CURDIR}${/}cloud-azure-policyinsights-policystates.json -${LOGIN_ENDPOINT} http://localhost:3000/login +${BASE_URL} http://${HOSTNAME}:${APIPORT} +${LOGIN_ENDPOINT} ${BASE_URL}/login ${CMD} ${CENTREON_PLUGINS} --plugin=cloud::azure::policyinsights::policystates::plugin --subscription=subscription --tenant=tenant --client-id=client_id --client-secret=secret --statefile-dir=/tmp/cache/ --login-endpoint=${LOGIN_ENDPOINT} &{compliance_value1} -... endpoint=http://localhost:3000/ok +... endpoint=${BASE_URL}/ok ... policyname= ... resourcelocation= ... resourcetype= ... result=OK: Number of non compliant policies: 0 - All compliances states are ok | 'policies.non_compliant.count'=0;;;0; &{compliance_value2} -... endpoint=http://localhost:3000/oknextlink +... endpoint=${BASE_URL}/oknextlink ... policyname=9daedab3-fb2d-461e-b861-71790eead4f6 ... resourcelocation= ... resourcetype= ... result=OK: Number of non compliant policies: 0 - All compliances states are ok | 'policies.non_compliant.count'=0;;;0; &{compliance_value3} -... endpoint=http://localhost:3000/nok1 +... endpoint=${BASE_URL}/nok1 ... policyname=9daedab3-fb2d-461e-b861-71790eead4f6 ... resourcelocation=fr ... resourcetype= ... result=CRITICAL: Compliance state for policy '9daedab3-fb2d-461e-b861-71790eead4f6' on resource 'mypubip1' is 'NonCompliant' | 'policies.non_compliant.count'=1;;;0; &{compliance_value4} -... endpoint=http://localhost:3000/nok2 +... endpoint=${BASE_URL}/nok2 ... policyname=9daedab3-fb2d-461e-b861-71790eead4f6 ... resourcelocation=fr ... resourcetype=ip diff --git a/tests/robot/hardware/devices/camera/avigilon/snmp/memory.robot b/tests/robot/hardware/devices/camera/avigilon/snmp/memory.robot index 748028e14..c5f50d8d3 100644 --- a/tests/robot/hardware/devices/camera/avigilon/snmp/memory.robot +++ b/tests/robot/hardware/devices/camera/avigilon/snmp/memory.robot @@ -10,8 +10,8 @@ Test Timeout 120s ${CMD} ${CENTREON_PLUGINS} ... --plugin=hardware::devices::camera::avigilon::snmp::plugin ... --mode=memory -... --hostname=127.0.0.1 -... --snmp-port=2024 +... --hostname=${HOSTNAME} +... --snmp-port=${SNMPPORT} *** Test Cases *** diff --git a/tests/robot/hardware/devices/camera/avigilon/snmp/storage.robot b/tests/robot/hardware/devices/camera/avigilon/snmp/storage.robot index cf19e1597..c7503181c 100644 --- a/tests/robot/hardware/devices/camera/avigilon/snmp/storage.robot +++ b/tests/robot/hardware/devices/camera/avigilon/snmp/storage.robot @@ -10,8 +10,8 @@ Test Timeout 120s ${CMD} ${CENTREON_PLUGINS} ... --plugin=hardware::devices::camera::avigilon::snmp::plugin ... --mode=storage -... --hostname=127.0.0.1 -... --snmp-port=2024 +... --hostname=${HOSTNAME} +... --snmp-port=${SNMPPORT} *** Test Cases *** diff --git a/tests/robot/hardware/devices/camera/avigilon/snmp/temperature.robot b/tests/robot/hardware/devices/camera/avigilon/snmp/temperature.robot index 10ce589f7..51597160f 100644 --- a/tests/robot/hardware/devices/camera/avigilon/snmp/temperature.robot +++ b/tests/robot/hardware/devices/camera/avigilon/snmp/temperature.robot @@ -10,8 +10,8 @@ Test Timeout 120s ${CMD} ${CENTREON_PLUGINS} ... --plugin=hardware::devices::camera::avigilon::snmp::plugin ... --mode=temperature -... --hostname=127.0.0.1 -... --snmp-port=2024 +... --hostname=${HOSTNAME} +... --snmp-port=${SNMPPORT} *** Test Cases *** diff --git a/tests/robot/hardware/kvm/avocent/acs/8000/hardware-kvm-avocent-acs-8000.robot b/tests/robot/hardware/kvm/avocent/acs/8000/hardware-kvm-avocent-acs-8000.robot index 80c050225..5031172d0 100644 --- a/tests/robot/hardware/kvm/avocent/acs/8000/hardware-kvm-avocent-acs-8000.robot +++ b/tests/robot/hardware/kvm/avocent/acs/8000/hardware-kvm-avocent-acs-8000.robot @@ -7,9 +7,6 @@ Test Timeout 120s *** Variables *** -${HOSTADDRESS} 127.0.0.1 -${SNMPPORT} 2024 -${SNMPVERSION} 2c ${SNMPCOMMUNITY} hardware/kvm/avocent/acs/8000/avocent8000 @@ -93,7 +90,7 @@ Run Avocent 8000 Plugin ... ${CENTREON_PLUGINS} ... --plugin=hardware::kvm::avocent::acs::8000::snmp::plugin ... --mode=${mode} - ... --hostname=${HOSTADDRESS} + ... --hostname=${HOSTNAME} ... --snmp-version=${SNMPVERSION} ... --snmp-port=${SNMPPORT} ... --snmp-community=${SNMPCOMMUNITY} diff --git a/tests/robot/hardware/sensors/apc/snmp/hardware-sensors-apc-snmp.robot b/tests/robot/hardware/sensors/apc/snmp/hardware-sensors-apc-snmp.robot index 1fd854422..c90871374 100644 --- a/tests/robot/hardware/sensors/apc/snmp/hardware-sensors-apc-snmp.robot +++ b/tests/robot/hardware/sensors/apc/snmp/hardware-sensors-apc-snmp.robot @@ -7,7 +7,7 @@ Test Timeout 120s *** Variables *** -${CMD} ${CENTREON_PLUGINS} --plugin=hardware::sensors::apc::snmp::plugin --mode=sensors --hostname=127.0.0.1 --snmp-version=2c --snmp-port=2024 +${CMD} ${CENTREON_PLUGINS} --plugin=hardware::sensors::apc::snmp::plugin --mode=sensors --hostname=${HOSTNAME} --snmp-version=${SNMPVERSION} --snmp-port=${SNMPPORT} *** Test Cases *** diff --git a/tests/robot/hardware/ups/inmatics/sputnik/snmp/hardware-ups-sputnik-snmp.robot b/tests/robot/hardware/ups/inmatics/sputnik/snmp/hardware-ups-sputnik-snmp.robot index 7ba4d1290..ab7cc9079 100644 --- a/tests/robot/hardware/ups/inmatics/sputnik/snmp/hardware-ups-sputnik-snmp.robot +++ b/tests/robot/hardware/ups/inmatics/sputnik/snmp/hardware-ups-sputnik-snmp.robot @@ -16,9 +16,9 @@ Sputnik UPS - Environment ${tc}/9 ${command} Catenate ... ${CMD} ... --mode=environment - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=hardware/ups/inmatics/sputnik/snmp/hardware-ups-sputnik # Append options to command diff --git a/tests/robot/hardware/ups/socomec/netvision/snmp/hardware-ups-socomec-netvision-snmp.robot b/tests/robot/hardware/ups/socomec/netvision/snmp/hardware-ups-socomec-netvision-snmp.robot index daff8dba2..3ea0cb6b3 100644 --- a/tests/robot/hardware/ups/socomec/netvision/snmp/hardware-ups-socomec-netvision-snmp.robot +++ b/tests/robot/hardware/ups/socomec/netvision/snmp/hardware-ups-socomec-netvision-snmp.robot @@ -16,9 +16,9 @@ Battery ${tc}/4 ${command} Catenate ... ${CMD} ... --mode=battery - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=hardware/ups/socomec/netvision/snmp/battery # Append options to command diff --git a/tests/robot/hardware/ups/standard/snmp/hardware-ups-standard-snmp.robot b/tests/robot/hardware/ups/standard/snmp/hardware-ups-standard-snmp.robot index 1387268ea..d1cd1f6f8 100644 --- a/tests/robot/hardware/ups/standard/snmp/hardware-ups-standard-snmp.robot +++ b/tests/robot/hardware/ups/standard/snmp/hardware-ups-standard-snmp.robot @@ -65,9 +65,9 @@ Hardware UPS Standard SNMP input lines ${command} Catenate ... ${CMD} ... --mode=input-lines - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=${ups_standard_test.snmpcommunity} ${length} Get Length ${ups_standard_test.warningpower} IF ${length} > 0 diff --git a/tests/robot/network/aruba/instant/snmp/aruba-instant-ap-usage.robot b/tests/robot/network/aruba/instant/snmp/aruba-instant-ap-usage.robot index f40c34144..6bc9586ee 100644 --- a/tests/robot/network/aruba/instant/snmp/aruba-instant-ap-usage.robot +++ b/tests/robot/network/aruba/instant/snmp/aruba-instant-ap-usage.robot @@ -7,7 +7,7 @@ Test Timeout 120s *** Variables *** -${CMD} ${CENTREON_PLUGINS} --plugin=network::aruba::instant::snmp::plugin --mode=ap-usage --hostname=127.0.0.1 --snmp-version=2c --snmp-port=2024 +${CMD} ${CENTREON_PLUGINS} --plugin=network::aruba::instant::snmp::plugin --mode=ap-usage --hostname=${HOSTNAME} --snmp-version=${SNMPVERSION} --snmp-port=${SNMPPORT} &{ap_usage_test_1} ... documentation=Test AP usage without filters diff --git a/tests/robot/network/cisco/meraki/cloudcontroller/restapi/vpntunnels.robot b/tests/robot/network/cisco/meraki/cloudcontroller/restapi/vpntunnels.robot index af59e31b9..8c6fa0f8d 100644 --- a/tests/robot/network/cisco/meraki/cloudcontroller/restapi/vpntunnels.robot +++ b/tests/robot/network/cisco/meraki/cloudcontroller/restapi/vpntunnels.robot @@ -10,15 +10,16 @@ Test Timeout 120s *** Variables *** ${MOCKOON_JSON} ${CURDIR}${/}meraki.mockoon.json -${CMD} ${CENTREON_PLUGINS} --plugin=network::cisco::meraki::cloudcontroller::restapi::plugin -... --api-token=EEECGFCGFCGF +${CMD} ${CENTREON_PLUGINS} --plugin=network::cisco::meraki::cloudcontroller::restapi::plugin +... --api-token=EEECGFCGFCGF ... --statefile-dir=/dev/shm/ + *** Test Cases *** Create cache from API [Tags] meraki api vpn network cache ${output} Run - ... ${CMD} --mode=cache --proto http --port 3000 --hostname=127.0.0.1 + ... ${CMD} --mode=cache --proto=http --port=${APIPORT} --hostname=${HOSTNAME} ${output} Strip String ${output} Should Be Equal As Strings @@ -43,4 +44,3 @@ Check if ${test_desc} works ... all links .* OK: vpn tunnel 'C3PO-R2P2-BB88' status: dormant [mode: spoke] | 'vpn.tunnels.online.count'=0;;;0;1 'vpn.tunnels.offline.count'=0;;;0;1 'vpn.tunnels.dormant.count'=1;;1:;0;1 ... empty filter ${EMPTY} OK: vpn tunnel 'C3PO-R2P2-BB88' status: dormant [mode: spoke] | 'vpn.tunnels.online.count'=0;;;0;1 'vpn.tunnels.offline.count'=0;;;0;1 'vpn.tunnels.dormant.count'=1;;1:;0;1 ... absurd filter toto CRITICAL: Vpn tunnels dormant: 0 | 'vpn.tunnels.online.count'=0;;;0;0 'vpn.tunnels.offline.count'=0;;;0;0 'vpn.tunnels.dormant.count'=0;;1:;0;0 - diff --git a/tests/robot/network/citrix/netscaler/snmp/mode/components/netscaler-health.robot b/tests/robot/network/citrix/netscaler/snmp/mode/components/netscaler-health.robot index 127ae7db0..485a78049 100644 --- a/tests/robot/network/citrix/netscaler/snmp/mode/components/netscaler-health.robot +++ b/tests/robot/network/citrix/netscaler/snmp/mode/components/netscaler-health.robot @@ -17,8 +17,8 @@ check psu components ${tc}/2 ${command} Catenate ... ${CMD} ... --mode=health - ... --hostname='127.0.0.1' - ... --snmp-port='2024' + ... --hostname=${HOSTNAME} + ... --snmp-port=${SNMPPORT} ... --snmp-community='network/citrix/netscaler/snmp/mode/components/${community}' ... --component=psu ... --alternative-status-mapping='${alternative_status_mapping}' diff --git a/tests/robot/network/fortinet/fortigate/snmp/network-fortinet-fortigate-snmp.robot b/tests/robot/network/fortinet/fortigate/snmp/network-fortinet-fortigate-snmp.robot index 0ed4814b0..ccfbdfb88 100644 --- a/tests/robot/network/fortinet/fortigate/snmp/network-fortinet-fortigate-snmp.robot +++ b/tests/robot/network/fortinet/fortigate/snmp/network-fortinet-fortigate-snmp.robot @@ -306,9 +306,9 @@ Network Fortinet Fortigate SNMP link monitor ${command} Catenate ... ${CMD} ... --mode=link-monitor - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=network/fortinet/fortigate/snmp/linkmonitor ${length} Get Length ${fortinet_fortigate_linkmonitor_test.filterid} IF ${length} > 0 @@ -399,9 +399,9 @@ Network Fortinet Fortigate SNMP list link monitor ${command} Catenate ... ${CMD} ... --mode=list-link-monitors - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=network/fortinet/fortigate/snmp/linkmonitor ${length} Get Length ${fortinet_fortigate_listlinkmonitors_test.filterstate} IF ${length} > 0 diff --git a/tests/robot/network/teldat/snmp/teldat.robot b/tests/robot/network/teldat/snmp/teldat.robot deleted file mode 100644 index 6f6c1e8da..000000000 --- a/tests/robot/network/teldat/snmp/teldat.robot +++ /dev/null @@ -1,273 +0,0 @@ -*** Settings *** -Documentation Network Teldat SNMP plugin - -Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}resources/import.resource - -Test Timeout 120s - - -*** Variables *** -${CMD} ${CENTREON_PLUGINS} --plugin=network::teldat::snmp::plugin - -# Test simple usage of the CPU mode -&{teldat_cpu_test1} -... warningcpuutilization5s= -... criticalcpuutilization5s= -... warningcpuutilization1m= -... criticalcpuutilization1m= -... warningcpuutilization5m= -... criticalcpuutilization5m= -... result=OK: cpu average usage: 1.00 % (5s), 1.00 % (1m), 1.00 % (5m) | 'cpu.utilization.5s.percentage'=1.00%;;;0;100 'cpu.utilization.1m.percentage'=1.00%;;;0;100 'cpu.utilization.15m.percentage'=1.00%;;;0;100 - -# Test CPU mode with warning-cpu-utilization-5s option set to a 0.5 -&{teldat_cpu_test2} -... warningcpuutilization5s=0.5 -... criticalcpuutilization5s= -... warningcpuutilization1m= -... criticalcpuutilization1m= -... warningcpuutilization5m= -... criticalcpuutilization5m= -... result=WARNING: cpu average usage: 1.00 % (5s) | 'cpu.utilization.5s.percentage'=1.00%;0:0.5;;0;100 'cpu.utilization.1m.percentage'=1.00%;;;0;100 'cpu.utilization.15m.percentage'=1.00%;;;0;100 - -# Test CPU mode with critical-cpu-utilization-5s option set to a 0.5 -&{teldat_cpu_test3} -... warningcpuutilization5s= -... criticalcpuutilization5s=0.5 -... warningcpuutilization1m= -... criticalcpuutilization1m= -... warningcpuutilization5m= -... criticalcpuutilization5m= -... result=CRITICAL: cpu average usage: 1.00 % (5s) | 'cpu.utilization.5s.percentage'=1.00%;;0:0.5;0;100 'cpu.utilization.1m.percentage'=1.00%;;;0;100 'cpu.utilization.15m.percentage'=1.00%;;;0;100 - -# Test CPU mode with warning-cpu-utilization-1m option set to a 0.5 -&{teldat_cpu_test4} -... warningcpuutilization5s= -... criticalcpuutilization5s= -... warningcpuutilization1m=0.5 -... criticalcpuutilization1m= -... warningcpuutilization5m= -... criticalcpuutilization5m= -... result=WARNING: cpu average usage: 1.00 % (1m) | 'cpu.utilization.5s.percentage'=1.00%;;;0;100 'cpu.utilization.1m.percentage'=1.00%;0:0.5;;0;100 'cpu.utilization.15m.percentage'=1.00%;;;0;100 - -# Test CPU mode with critical-cpu-utilization-1m option set to a 0.5 -&{teldat_cpu_test5} -... warningcpuutilization5s= -... criticalcpuutilization5s= -... warningcpuutilization1m= -... criticalcpuutilization1m=0.5 -... warningcpuutilization5m= -... criticalcpuutilization5m= -... result=CRITICAL: cpu average usage: 1.00 % (1m) | 'cpu.utilization.5s.percentage'=1.00%;;;0;100 'cpu.utilization.1m.percentage'=1.00%;;0:0.5;0;100 'cpu.utilization.15m.percentage'=1.00%;;;0;100 - -# Test CPU mode with warning-cpu-utilization-5m option set to a 0.5 -&{teldat_cpu_test6} -... warningcpuutilization5s= -... criticalcpuutilization5s= -... warningcpuutilization1m= -... criticalcpuutilization1m= -... warningcpuutilization5m=0.5 -... criticalcpuutilization5m= -... result=WARNING: cpu average usage: 1.00 % (5m) | 'cpu.utilization.5s.percentage'=1.00%;;;0;100 'cpu.utilization.1m.percentage'=1.00%;;;0;100 'cpu.utilization.15m.percentage'=1.00%;0:0.5;;0;100 - -# Test CPU mode with critical-cpu-utilization-5m option set to a 0.5 -&{teldat_cpu_test7} -... warningcpuutilization5s= -... criticalcpuutilization5s= -... warningcpuutilization1m= -... criticalcpuutilization1m= -... warningcpuutilization5m= -... criticalcpuutilization5m=0.5 -... result=CRITICAL: cpu average usage: 1.00 % (5m) | 'cpu.utilization.5s.percentage'=1.00%;;;0;100 'cpu.utilization.1m.percentage'=1.00%;;;0;100 'cpu.utilization.15m.percentage'=1.00%;;0:0.5;0;100 - -@{teldat_cpu_tests} -... &{teldat_cpu_test1} -... &{teldat_cpu_test2} -... &{teldat_cpu_test3} -... &{teldat_cpu_test4} -... &{teldat_cpu_test5} -... &{teldat_cpu_test6} -... &{teldat_cpu_test7} - -# Test simple usage of the memory mode -&{teldat_memory_test1} -... warningusage= -... criticalusage= -... warningusagefree= -... criticalusagefree= -... warningusageprct= -... criticalusageprct= -... result=OK: Memory 'system' total: 256.00 MB used: 100.54 MB (39.27%) free: 155.46 MB (60.73%) | 'system#memory.usage.bytes'=105419600B;;;0;268435456 'system#memory.free.bytes'=163015856B;;;0;268435456 'system#memory.usage.percentage'=39.27%;;;0;100 - -# Test memory mode with warning-usage option set to a 100 -&{teldat_memory_test2} -... warningusage=100 -... criticalusage= -... warningusagefree= -... criticalusagefree= -... warningusageprct= -... criticalusageprct= -... result=WARNING: Memory 'system' total: 256.00 MB used: 100.54 MB (39.27%) free: 155.46 MB (60.73%) | 'system#memory.usage.bytes'=105419600B;0:100;;0;268435456 'system#memory.free.bytes'=163015856B;;;0;268435456 'system#memory.usage.percentage'=39.27%;;;0;100 - -# Test memory mode with critical-usage option set to a 100 -&{teldat_memory_test3} -... warningusage= -... criticalusage=100 -... warningusagefree= -... criticalusagefree= -... warningusageprct= -... criticalusageprct= -... result=CRITICAL: Memory 'system' total: 256.00 MB used: 100.54 MB (39.27%) free: 155.46 MB (60.73%) | 'system#memory.usage.bytes'=105419600B;;0:100;0;268435456 'system#memory.free.bytes'=163015856B;;;0;268435456 'system#memory.usage.percentage'=39.27%;;;0;100 - -# Test memory mode with warning-usage-free option set to a 100 -&{teldat_memory_test4} -... warningusage= -... criticalusage= -... warningusagefree=100 -... criticalusagefree= -... warningusageprct= -... criticalusageprct= -... result=WARNING: Memory 'system' total: 256.00 MB used: 100.54 MB (39.27%) free: 155.46 MB (60.73%) | 'system#memory.usage.bytes'=105419600B;;;0;268435456 'system#memory.free.bytes'=163015856B;0:100;;0;268435456 'system#memory.usage.percentage'=39.27%;;;0;100 - -# Test memory mode with critical-usage-free option set to a 100 -&{teldat_memory_test5} -... warningusage= -... criticalusage= -... warningusagefree= -... criticalusagefree=100 -... warningusageprct= -... criticalusageprct= -... result=CRITICAL: Memory 'system' total: 256.00 MB used: 100.54 MB (39.27%) free: 155.46 MB (60.73%) | 'system#memory.usage.bytes'=105419600B;;;0;268435456 'system#memory.free.bytes'=163015856B;;0:100;0;268435456 'system#memory.usage.percentage'=39.27%;;;0;100 - -# Test memory mode with warning-usage-prct option set to a 30 -&{teldat_memory_test6} -... warningusage= -... criticalusage= -... warningusagefree= -... criticalusagefree= -... warningusageprct=30 -... criticalusageprct= -... result=WARNING: Memory 'system' total: 256.00 MB used: 100.54 MB (39.27%) free: 155.46 MB (60.73%) | 'system#memory.usage.bytes'=105419600B;;;0;268435456 'system#memory.free.bytes'=163015856B;;;0;268435456 'system#memory.usage.percentage'=39.27%;0:30;;0;100 - -# Test memory mode with critical-usage-prct option set to a 30 -&{teldat_memory_test7} -... warningusage= -... criticalusage= -... warningusagefree= -... criticalusagefree= -... warningusageprct= -... criticalusageprct=30 -... result=CRITICAL: Memory 'system' total: 256.00 MB used: 100.54 MB (39.27%) free: 155.46 MB (60.73%) | 'system#memory.usage.bytes'=105419600B;;;0;268435456 'system#memory.free.bytes'=163015856B;;;0;268435456 'system#memory.usage.percentage'=39.27%;;0:30;0;100 - -@{teldat_memory_tests} -... &{teldat_memory_test1} -... &{teldat_memory_test2} -... &{teldat_memory_test3} -... &{teldat_memory_test4} -... &{teldat_memory_test5} -... &{teldat_memory_test6} -... &{teldat_memory_test7} - - -*** Test Cases *** - -Network Teldat SNMP CPU - [Documentation] Network Teldat SNMP CPU - [Tags] network teldat snmp - FOR ${teldat_cpu_test} IN @{teldat_cpu_tests} - ${command} Catenate - ... ${CMD} - ... --mode=cpu - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 - ... --snmp-community=network/teldat/snmp/teldat - ${length} Get Length ${teldat_cpu_test.warningcpuutilization5s} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --warning-cpu-utilization-5s=${teldat_cpu_test.warningcpuutilization5s} - END - ${length} Get Length ${teldat_cpu_test.criticalcpuutilization5s} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --critical-cpu-utilization-5s=${teldat_cpu_test.criticalcpuutilization5s} - END - ${length} Get Length ${teldat_cpu_test.warningcpuutilization1m} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --warning-cpu-utilization-1m=${teldat_cpu_test.warningcpuutilization1m} - END - ${length} Get Length ${teldat_cpu_test.criticalcpuutilization1m} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --critical-cpu-utilization-1m=${teldat_cpu_test.criticalcpuutilization1m} - END - ${length} Get Length ${teldat_cpu_test.warningcpuutilization5m} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --warning-cpu-utilization-5m=${teldat_cpu_test.warningcpuutilization5m} - END - ${length} Get Length ${teldat_cpu_test.criticalcpuutilization5m} - IF ${length} > 0 - ${command} Catenate - ... ${command} - ... --critical-cpu-utilization-5m=${teldat_cpu_test.criticalcpuutilization5m} - END - ${output} Run ${command} - Log To Console . no_newline=true - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${teldat_cpu_test.result} - ... Wrong result output for:${\n}Command: ${\n}${command}${\n}${\n}Expected output: ${\n}${teldat_cpu_test.result}${\n}${\n}Obtained output:${\n}${output}${\n}${\n}${\n} - ... values=False - END - -Network Teldat SNMP Memory - [Documentation] Network Teldat SNMP memory - [Tags] network teldat snmp - FOR ${teldat_memory_test} IN @{teldat_memory_tests} - ${command} Catenate - ... ${CMD} - ... --mode=memory - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 - ... --snmp-community=network/teldat/snmp/teldat - ${length} Get Length ${teldat_memory_test.warningusage} - IF ${length} > 0 - ${command} Catenate ${command} --warning-usage=${teldat_memory_test.warningusage} - END - ${length} Get Length ${teldat_memory_test.criticalusage} - IF ${length} > 0 - ${command} Catenate ${command} --critical-usage=${teldat_memory_test.criticalusage} - END - ${length} Get Length ${teldat_memory_test.warningusagefree} - IF ${length} > 0 - ${command} Catenate ${command} --warning-usage-free=${teldat_memory_test.warningusagefree} - END - ${length} Get Length ${teldat_memory_test.criticalusagefree} - IF ${length} > 0 - ${command} Catenate ${command} --critical-usage-free=${teldat_memory_test.criticalusagefree} - END - ${length} Get Length ${teldat_memory_test.warningusageprct} - IF ${length} > 0 - ${command} Catenate ${command} --warning-usage-prct=${teldat_memory_test.warningusageprct} - END - ${length} Get Length ${teldat_memory_test.criticalusageprct} - IF ${length} > 0 - ${command} Catenate ${command} --critical-usage-prct=${teldat_memory_test.criticalusageprct} - END - ${output} Run ${command} - Log To Console . no_newline=true - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${teldat_memory_test.result} - ... Wrong result output for:${\n}Command: ${\n}${command}${\n}${\n}Expected output: ${\n}${teldat_memory_test.result}${\n}${\n}Obtained output:${\n}${output}${\n}${\n}${\n} - ... values=False - END diff --git a/tests/robot/os/linux/snmp/list-diskio.robot b/tests/robot/os/linux/snmp/list-diskio.robot index 15ba6333f..04a6ce48e 100644 --- a/tests/robot/os/linux/snmp/list-diskio.robot +++ b/tests/robot/os/linux/snmp/list-diskio.robot @@ -7,7 +7,7 @@ Test Timeout 120s *** Variables *** -${CMD} ${CENTREON_PLUGINS} --plugin=os::linux::snmp::plugin +${CMD} ${CENTREON_PLUGINS} --plugin=os::linux::snmp::plugin *** Test Cases *** @@ -17,9 +17,9 @@ List diskio ${tc} ${command} Catenate ... ${CMD} ... --mode=list-diskio - ... --hostname=127.0.0.1 - ... --snmp-version=2 - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --disco-show ... --snmp-community=${snmpcommunity} ${output} Run ${command} @@ -32,5 +32,5 @@ List diskio ${tc} ... Wrong output result for command:{\n}{\n}${command}{\n}{\n}Command output:{\n}{\n}${output} Examples: tc snmpcommunity expected_result -- - ... 1 os/linux/snmp/list-diskio 10 - ... 2 os/linux/snmp/list-diskio-2 4 \ No newline at end of file + ... 1 os/linux/snmp/list-diskio 10 + ... 2 os/linux/snmp/list-diskio-2 4 diff --git a/tests/robot/os/linux/snmp/network-interfaces.robot b/tests/robot/os/linux/snmp/network-interfaces.robot index 1284ef19a..c19e03e73 100644 --- a/tests/robot/os/linux/snmp/network-interfaces.robot +++ b/tests/robot/os/linux/snmp/network-interfaces.robot @@ -10,8 +10,8 @@ Test Timeout 120s ${CMD} ${CENTREON_PLUGINS} ... --plugin=os::linux::snmp::plugin ... --mode=interfaces -... --hostname=127.0.0.1 -... --snmp-port=2024 +... --hostname=${HOSTNAME} +... --snmp-port=${SNMPPORT} ... --snmp-community=os/linux/snmp/network-interfaces ... --statefile-dir=/tmp/cache/ diff --git a/tests/robot/os/windows/snmp/services.robot b/tests/robot/os/windows/snmp/services.robot index d00096e9d..a9021d073 100644 --- a/tests/robot/os/windows/snmp/services.robot +++ b/tests/robot/os/windows/snmp/services.robot @@ -10,8 +10,8 @@ Test Timeout 120s ${CMD} ${CENTREON_PLUGINS} ... --plugin=os::windows::snmp::plugin ... --mode=service -... --hostname=127.0.0.1 -... --snmp-port=2024 +... --hostname=${HOSTNAME} +... --snmp-port=${SNMPPORT} *** Test Cases *** diff --git a/tests/robot/storage/datacore/restapi/storage-datacore-restapi.robot b/tests/robot/storage/datacore/restapi/storage-datacore-restapi.robot index 00bbb67a9..c76ceb117 100644 --- a/tests/robot/storage/datacore/restapi/storage-datacore-restapi.robot +++ b/tests/robot/storage/datacore/restapi/storage-datacore-restapi.robot @@ -11,7 +11,7 @@ Test Timeout 120s *** Variables *** ${MOCKOON_JSON} ${CURDIR}${/}storage-datacore-api.json -${CMD} ${CENTREON_PLUGINS} --plugin=storage::datacore::restapi::plugin --password=pass --username=user --port=3000 --hostname=127.0.0.1 --proto=http +${CMD} ${CENTREON_PLUGINS} --plugin=storage::datacore::restapi::plugin --password=pass --username=user --port=${APIPORT} --hostname=${HOSTNAME} --proto=http *** Test Cases *** diff --git a/tests/robot/storage/synology/snmp/storage-synology-snmp.robot b/tests/robot/storage/synology/snmp/storage-synology-snmp.robot index be230e3bb..a356f1348 100644 --- a/tests/robot/storage/synology/snmp/storage-synology-snmp.robot +++ b/tests/robot/storage/synology/snmp/storage-synology-snmp.robot @@ -63,9 +63,9 @@ Components ${command} Catenate ... ${CMD} ... --mode=components - ... --hostname=127.0.0.1 - ... --snmp-version=2 - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=${check_components_test.snmpcommunity} ${output} Run ${command} @@ -81,9 +81,9 @@ Uptime ${command} Catenate ... ${CMD} ... --mode=uptime - ... --hostname=127.0.0.1 - ... --snmp-version=2 - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=${test_item.snmpcommunity} ... --warning-uptime=${test_item.warning} ... --critical-uptime=${test_item.critical}