From af73ab03befde18a729ff369780d05c64a4e294c Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Wed, 10 Jul 2024 11:26:55 +0200 Subject: [PATCH 01/12] Adding hosts test + fix a test to run locally --- .../ansible/tower/ansible_tower.json | 92 +++++++++++++++++++ .../apps/automation/ansible/tower/hosts.robot | 38 ++++++++ .../2012/local/nodeintegrationservice.robot | 2 +- 3 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 tests/robot/apps/automation/ansible/tower/ansible_tower.json create mode 100644 tests/robot/apps/automation/ansible/tower/hosts.robot diff --git a/tests/robot/apps/automation/ansible/tower/ansible_tower.json b/tests/robot/apps/automation/ansible/tower/ansible_tower.json new file mode 100644 index 000000000..deab256bf --- /dev/null +++ b/tests/robot/apps/automation/ansible/tower/ansible_tower.json @@ -0,0 +1,92 @@ +{ + "uuid": "54ff47ec-292e-487b-ab22-42c08b05dd91", + "lastMigration": 32, + "name": "Ansible tower", + "endpointPrefix": "", + "latency": 0, + "port": 3000, + "hostname": "", + "folders": [], + "routes": [ + { + "uuid": "781bf78c-43f7-4da1-9515-1d324b7a59d1", + "type": "http", + "documentation": "", + "method": "get", + "endpoint": "api/v2/hosts", + "responses": [ + { + "uuid": "a4edd4f6-d560-44d5-8faf-3e6d532e22b4", + "body": "{\n \"count\": 20,\n \"next\": {{#if (lt (queryParam 'page') 2)}}\"/api/v2/hosts\"{{else}}null{{/if}},\n \"previous\": {{#if (gte (queryParam 'page') 2)}}\"/api/v2/hosts\"{{else}}null{{/if}},\n \"results\": [\n {\n \"ansible_facts_modified\": null,\n \"created\": \"2018-02-01T08:00:00.000000Z\",\n \"description\": \"\",\n \"enabled\": true,\n \"has_active_failures\": false,\n \"has_inventory_sources\": false,\n \"id\": 14,\n \"insights_system_id\": null,\n \"instance_id\": \"\",\n \"inventory\": 1,\n \"last_job\": null,\n \"last_job_host_summary\": null,\n \"modified\": \"2018-02-01T08:00:00.000000Z\",\n \"name\": \"host-13\",\n \"related\": {\n \"activity_stream\": \"/api/v2/hosts/14/activity_stream/\",\n \"ad_hoc_command_events\": \"/api/v2/hosts/14/ad_hoc_command_events/\",\n \"ad_hoc_commands\": \"/api/v2/hosts/14/ad_hoc_commands/\",\n \"all_groups\": \"/api/v2/hosts/14/all_groups/\",\n \"ansible_facts\": \"/api/v2/hosts/14/ansible_facts/\",\n \"groups\": \"/api/v2/hosts/14/groups/\",\n \"insights\": \"/api/v2/hosts/14/insights/\",\n \"inventory\": \"/api/v2/inventories/1/\",\n \"inventory_sources\": \"/api/v2/hosts/14/inventory_sources/\",\n \"job_events\": \"/api/v2/hosts/14/job_events/\",\n \"job_host_summaries\": \"/api/v2/hosts/14/job_host_summaries/\",\n \"smart_inventories\": \"/api/v2/hosts/14/smart_inventories/\",\n \"variable_data\": \"/api/v2/hosts/14/variable_data/\"\n },\n \"summary_fields\": {\n \"groups\": {\n \"count\": 0,\n \"results\": []\n },\n \"inventory\": {\n \"description\": \"\",\n \"has_active_failures\": false,\n \"has_inventory_sources\": false,\n \"hosts_with_active_failures\": 0,\n \"id\": 1,\n \"inventory_sources_with_failures\": 0,\n \"kind\": \"\",\n \"name\": \"test-inv\",\n \"organization_id\": 1,\n \"total_groups\": 0,\n \"total_hosts\": 0,\n \"total_inventory_sources\": 0\n },\n \"recent_jobs\": [],\n \"user_capabilities\": {\n \"delete\": true,\n \"edit\": true\n }\n },\n \"type\": \"host\",\n \"url\": \"/api/v2/hosts/14/\",\n \"variables\": \"\"\n },\n {\n \"ansible_facts_modified\": null,\n \"created\": \"2018-02-01T08:00:00.000000Z\",\n \"description\": \"\",\n \"enabled\": true,\n \"has_active_failures\": false,\n \"has_inventory_sources\": false,\n \"id\": 15,\n \"insights_system_id\": null,\n \"instance_id\": \"\",\n \"inventory\": 1,\n \"last_job\": null,\n \"last_job_host_summary\": null,\n \"modified\": \"2018-02-01T08:00:00.000000Z\",\n \"name\": \"host-14\",\n \"related\": {\n \"activity_stream\": \"/api/v2/hosts/15/activity_stream/\",\n \"ad_hoc_command_events\": \"/api/v2/hosts/15/ad_hoc_command_events/\",\n \"ad_hoc_commands\": \"/api/v2/hosts/15/ad_hoc_commands/\",\n \"all_groups\": \"/api/v2/hosts/15/all_groups/\",\n \"ansible_facts\": \"/api/v2/hosts/15/ansible_facts/\",\n \"groups\": \"/api/v2/hosts/15/groups/\",\n \"insights\": \"/api/v2/hosts/15/insights/\",\n \"inventory\": \"/api/v2/inventories/1/\",\n \"inventory_sources\": \"/api/v2/hosts/15/inventory_sources/\",\n \"job_events\": \"/api/v2/hosts/15/job_events/\",\n \"job_host_summaries\": \"/api/v2/hosts/15/job_host_summaries/\",\n \"smart_inventories\": \"/api/v2/hosts/15/smart_inventories/\",\n \"variable_data\": \"/api/v2/hosts/15/variable_data/\"\n },\n \"summary_fields\": {\n \"groups\": {\n \"count\": 0,\n \"results\": []\n },\n \"inventory\": {\n \"description\": \"\",\n \"has_active_failures\": false,\n \"has_inventory_sources\": false,\n \"hosts_with_active_failures\": 0,\n \"id\": 1,\n \"inventory_sources_with_failures\": 0,\n \"kind\": \"\",\n \"name\": \"test-inv\",\n \"organization_id\": 1,\n \"total_groups\": 0,\n \"total_hosts\": 0,\n \"total_inventory_sources\": 0\n },\n \"recent_jobs\": [],\n \"user_capabilities\": {\n \"delete\": true,\n \"edit\": true\n }\n },\n \"type\": \"host\",\n \"url\": \"/api/v2/hosts/15/\",\n \"variables\": \"\"\n },\n {\n \"ansible_facts_modified\": null,\n \"created\": \"2018-02-01T08:00:00.000000Z\",\n \"description\": \"\",\n \"enabled\": true,\n \"has_active_failures\": false,\n \"has_inventory_sources\": false,\n \"id\": 16,\n \"insights_system_id\": null,\n \"instance_id\": \"\",\n \"inventory\": 1,\n \"last_job\": null,\n \"last_job_host_summary\": null,\n \"modified\": \"2018-02-01T08:00:00.000000Z\",\n \"name\": \"host-15\",\n \"related\": {\n \"activity_stream\": \"/api/v2/hosts/16/activity_stream/\",\n \"ad_hoc_command_events\": \"/api/v2/hosts/16/ad_hoc_command_events/\",\n \"ad_hoc_commands\": \"/api/v2/hosts/16/ad_hoc_commands/\",\n \"all_groups\": \"/api/v2/hosts/16/all_groups/\",\n \"ansible_facts\": \"/api/v2/hosts/16/ansible_facts/\",\n \"groups\": \"/api/v2/hosts/16/groups/\",\n \"insights\": \"/api/v2/hosts/16/insights/\",\n \"inventory\": \"/api/v2/inventories/1/\",\n \"inventory_sources\": \"/api/v2/hosts/16/inventory_sources/\",\n \"job_events\": \"/api/v2/hosts/16/job_events/\",\n \"job_host_summaries\": \"/api/v2/hosts/16/job_host_summaries/\",\n \"smart_inventories\": \"/api/v2/hosts/16/smart_inventories/\",\n \"variable_data\": \"/api/v2/hosts/16/variable_data/\"\n },\n \"summary_fields\": {\n \"groups\": {\n \"count\": 0,\n \"results\": []\n },\n \"inventory\": {\n \"description\": \"\",\n \"has_active_failures\": false,\n \"has_inventory_sources\": false,\n \"hosts_with_active_failures\": 0,\n \"id\": 1,\n \"inventory_sources_with_failures\": 0,\n \"kind\": \"\",\n \"name\": \"test-inv\",\n \"organization_id\": 1,\n \"total_groups\": 0,\n \"total_hosts\": 0,\n \"total_inventory_sources\": 0\n },\n \"recent_jobs\": [],\n \"user_capabilities\": {\n \"delete\": true,\n \"edit\": true\n }\n },\n \"type\": \"host\",\n \"url\": \"/api/v2/hosts/16/\",\n \"variables\": \"\"\n },\n {\n \"ansible_facts_modified\": null,\n \"created\": \"2018-02-01T08:00:00.000000Z\",\n \"description\": \"\",\n \"enabled\": true,\n \"has_active_failures\": false,\n \"has_inventory_sources\": false,\n \"id\": 17,\n \"insights_system_id\": null,\n \"instance_id\": \"\",\n \"inventory\": 1,\n \"last_job\": null,\n \"last_job_host_summary\": null,\n \"modified\": \"2018-02-01T08:00:00.000000Z\",\n \"name\": \"host-16\",\n \"related\": {\n \"activity_stream\": \"/api/v2/hosts/17/activity_stream/\",\n \"ad_hoc_command_events\": \"/api/v2/hosts/17/ad_hoc_command_events/\",\n \"ad_hoc_commands\": \"/api/v2/hosts/17/ad_hoc_commands/\",\n \"all_groups\": \"/api/v2/hosts/17/all_groups/\",\n \"ansible_facts\": \"/api/v2/hosts/17/ansible_facts/\",\n \"groups\": \"/api/v2/hosts/17/groups/\",\n \"insights\": \"/api/v2/hosts/17/insights/\",\n \"inventory\": \"/api/v2/inventories/1/\",\n \"inventory_sources\": \"/api/v2/hosts/17/inventory_sources/\",\n \"job_events\": \"/api/v2/hosts/17/job_events/\",\n \"job_host_summaries\": \"/api/v2/hosts/17/job_host_summaries/\",\n \"smart_inventories\": \"/api/v2/hosts/17/smart_inventories/\",\n \"variable_data\": \"/api/v2/hosts/17/variable_data/\"\n },\n \"summary_fields\": {\n \"groups\": {\n \"count\": 0,\n \"results\": []\n },\n \"inventory\": {\n \"description\": \"\",\n \"has_active_failures\": false,\n \"has_inventory_sources\": false,\n \"hosts_with_active_failures\": 0,\n \"id\": 1,\n \"inventory_sources_with_failures\": 0,\n \"kind\": \"\",\n \"name\": \"test-inv\",\n \"organization_id\": 1,\n \"total_groups\": 0,\n \"total_hosts\": 0,\n \"total_inventory_sources\": 0\n },\n \"recent_jobs\": [],\n \"user_capabilities\": {\n \"delete\": true,\n \"edit\": true\n }\n },\n \"type\": \"host\",\n \"url\": \"/api/v2/hosts/17/\",\n \"variables\": \"\"\n },\n {\n \"ansible_facts_modified\": null,\n \"created\": \"2018-02-01T08:00:00.000000Z\",\n \"description\": \"\",\n \"enabled\": true,\n \"has_active_failures\": false,\n \"has_inventory_sources\": false,\n \"id\": 18,\n \"insights_system_id\": null,\n \"instance_id\": \"\",\n \"inventory\": 1,\n \"last_job\": null,\n \"last_job_host_summary\": null,\n \"modified\": \"2018-02-01T08:00:00.000000Z\",\n \"name\": \"host-17\",\n \"related\": {\n \"activity_stream\": \"/api/v2/hosts/18/activity_stream/\",\n \"ad_hoc_command_events\": \"/api/v2/hosts/18/ad_hoc_command_events/\",\n \"ad_hoc_commands\": \"/api/v2/hosts/18/ad_hoc_commands/\",\n \"all_groups\": \"/api/v2/hosts/18/all_groups/\",\n \"ansible_facts\": \"/api/v2/hosts/18/ansible_facts/\",\n \"groups\": \"/api/v2/hosts/18/groups/\",\n \"insights\": \"/api/v2/hosts/18/insights/\",\n \"inventory\": \"/api/v2/inventories/1/\",\n \"inventory_sources\": \"/api/v2/hosts/18/inventory_sources/\",\n \"job_events\": \"/api/v2/hosts/18/job_events/\",\n \"job_host_summaries\": \"/api/v2/hosts/18/job_host_summaries/\",\n \"smart_inventories\": \"/api/v2/hosts/18/smart_inventories/\",\n \"variable_data\": \"/api/v2/hosts/18/variable_data/\"\n },\n \"summary_fields\": {\n \"groups\": {\n \"count\": 0,\n \"results\": []\n },\n \"inventory\": {\n \"description\": \"\",\n \"has_active_failures\": false,\n \"has_inventory_sources\": false,\n \"hosts_with_active_failures\": 0,\n \"id\": 1,\n \"inventory_sources_with_failures\": 0,\n \"kind\": \"\",\n \"name\": \"test-inv\",\n \"organization_id\": 1,\n \"total_groups\": 0,\n \"total_hosts\": 0,\n \"total_inventory_sources\": 0\n },\n \"recent_jobs\": [],\n \"user_capabilities\": {\n \"delete\": true,\n \"edit\": true\n }\n },\n \"type\": \"host\",\n \"url\": \"/api/v2/hosts/18/\",\n \"variables\": \"\"\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" + } + ], + "proxyMode": false, + "proxyHost": "", + "proxyRemovePrefix": false, + "tlsOptions": { + "enabled": false, + "type": "CERT", + "pfxPath": "", + "certPath": "", + "keyPath": "", + "caPath": "", + "passphrase": "" + }, + "cors": true, + "headers": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Access-Control-Allow-Methods", + "value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS" + }, + { + "key": "Access-Control-Allow-Headers", + "value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With" + } + ], + "proxyReqHeaders": [ + { + "key": "", + "value": "" + } + ], + "proxyResHeaders": [ + { + "key": "", + "value": "" + } + ], + "data": [], + "callbacks": [] +} \ No newline at end of file diff --git a/tests/robot/apps/automation/ansible/tower/hosts.robot b/tests/robot/apps/automation/ansible/tower/hosts.robot new file mode 100644 index 000000000..6812f9980 --- /dev/null +++ b/tests/robot/apps/automation/ansible/tower/hosts.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check the hosts mode with api custom mode + +Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource + +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 + + +*** Test Cases *** +Hosts ${tc} + [Documentation] Check the number of returned hosts + [Tags] apps automation ansible service-disco + ${command} Catenate + ... ${CMD} + ... --mode=hosts + ${output} Run ${command} + ${output} Strip String ${output} + Should Be Equal As Strings + ... ${expected_result} + ... ${output} + ... 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 OK: Hosts total: 10, failed: 0 - All hosts are ok | 'hosts.total.count'=10;;;0; 'hosts.failed.count'=0;;;0;10 diff --git a/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot b/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot index 7cd3da3d8..6edc44e22 100644 --- a/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot +++ b/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot @@ -13,7 +13,7 @@ ${CMD} ${CENTREON_PLUGINS} ... --command=cat ... --command-path=/usr/bin ... --no-ps -... --command-options=nodeintegrationservice-2022.json +... --command-options=${CURDIR}/nodeintegrationservice-2022.json *** Test Cases *** HyperV 2022 ${tc}/3 From e4215a80d5456ab8a5172f8679abd37a1ef17bdf Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Wed, 10 Jul 2024 16:21:28 +0200 Subject: [PATCH 02/12] Use global variables for tests (usefull for local tests) + robotidy --- tests/resources/import.resource | 3 +- tests/resources/resources.resource | 14 ++++++-- .../ansible/tower/ansible_tower.json | 33 +++++++++++++++++++ .../apps/automation/ansible/tower/hosts.robot | 22 ++++++------- .../2012/local/nodeintegrationservice.robot | 2 +- .../http/collection-centreon-web.robot | 10 ++++-- .../protocols/snmp/collection-sputnik.robot | 6 ++-- .../snmp/hashicorp-password-manager.robot | 10 +++--- ...ud-azure-policyinsights-policystates.robot | 11 ++++--- .../devices/camera/avigilon/snmp/memory.robot | 4 +-- .../camera/avigilon/snmp/storage.robot | 4 +-- .../camera/avigilon/snmp/temperature.robot | 4 +-- .../8000/hardware-kvm-avocent-acs-8000.robot | 5 +-- .../apc/snmp/hardware-sensors-apc-snmp.robot | 2 +- .../snmp/hardware-ups-sputnik-snmp.robot | 6 ++-- .../hardware-ups-socomec-netvision-snmp.robot | 6 ++-- .../snmp/hardware-ups-standard-snmp.robot | 6 ++-- .../instant/snmp/aruba-instant-ap-usage.robot | 2 +- .../cloudcontroller/restapi/vpntunnels.robot | 8 ++--- .../mode/components/netscaler-health.robot | 4 +-- .../network-fortinet-fortigate-snmp.robot | 12 +++---- tests/robot/network/teldat/snmp/teldat.robot | 18 +++++----- tests/robot/os/linux/snmp/list-diskio.robot | 12 +++---- .../os/linux/snmp/network-interfaces.robot | 4 +-- tests/robot/os/windows/snmp/services.robot | 4 +-- .../restapi/storage-datacore-restapi.robot | 2 +- .../synology/snmp/storage-synology-snmp.robot | 12 +++---- 27 files changed, 135 insertions(+), 91 deletions(-) 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 index 86a5e5619..2ea9cc213 100644 --- a/tests/robot/network/teldat/snmp/teldat.robot +++ b/tests/robot/network/teldat/snmp/teldat.robot @@ -508,9 +508,9 @@ Network Teldat SNMP cells radio ${command} Catenate ... ${CMD} ... --mode=cells-radio - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=network/teldat/snmp/teldat ${length} Get Length ${teldat_cellsradio_test.filtercellid} IF ${length} > 0 @@ -623,9 +623,9 @@ Network Teldat SNMP CPU ${command} Catenate ... ${CMD} ... --mode=cpu - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=network/teldat/snmp/teldat ${length} Get Length ${teldat_cpu_test.warningcpuutilization5s} IF ${length} > 0 @@ -680,9 +680,9 @@ Network Teldat SNMP Memory ${command} Catenate ... ${CMD} ... --mode=memory - ... --hostname=127.0.0.1 - ... --snmp-version=2c - ... --snmp-port=2024 + ... --hostname=${HOSTNAME} + ... --snmp-version=${SNMPVERSION} + ... --snmp-port=${SNMPPORT} ... --snmp-community=network/teldat/snmp/teldat ${length} Get Length ${teldat_memory_test.warningusage} IF ${length} > 0 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} From 0a72dd0a42b1bd3b9a57ca23dc91827b854a60cb Mon Sep 17 00:00:00 2001 From: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:22:40 +0200 Subject: [PATCH 03/12] new test mode(jobs) --- .../apps/automation/ansible/tower/jobs.robot | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/robot/apps/automation/ansible/tower/jobs.robot diff --git a/tests/robot/apps/automation/ansible/tower/jobs.robot b/tests/robot/apps/automation/ansible/tower/jobs.robot new file mode 100644 index 000000000..e9f8d3541 --- /dev/null +++ b/tests/robot/apps/automation/ansible/tower/jobs.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation Check the jobs mode with api custom mode + +Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource + +Suite Setup Start Mockoon ${MOCKOON_JSON} +Suite Teardown Stop Mockoon +Test Timeout 120s + + +*** Variables *** +${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 *** +jobs ${tc} + [Documentation] Check the number of returned jobs + [Tags] apps automation ansible service-disco + ${command} Catenate + ... ${CMD} + ... --mode=jobs + ... ${extraoptions} + ${output} Run ${command} + ${output} Strip String ${output} + Should Be Equal As Strings + ... ${expected_result} + ... ${output} + ... Wrong output result for command:{\n}{\n}${command}{\n}{\n}Command output:{\n}{\n}${output} + + Examples: tc extraoptions expected_result -- + ... 1 --filter-name='' OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 + ... 2 --filter-name=toto OK: Jobs total: 0, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=0;;;0; 'jobs.successful.count'=0;;;0;0 'jobs.failed.count'=0;;;0;0 'jobs.running.count'=0;;;0;0 'jobs.canceled.count'=0;;;0;0 'jobs.pending.count'=0;;;0;0 'jobs.default.count'=0;;;0;0 + ... 3 --filter-name=toto --critical-total=1:1 CRITICAL: Jobs total: 0 | 'jobs.total.count'=0;;1:1;0; 'jobs.successful.count'=0;;;0;0 'jobs.failed.count'=0;;;0;0 'jobs.running.count'=0;;;0;0 'jobs.canceled.count'=0;;;0;0 'jobs.pending.count'=0;;;0;0 'jobs.default.count'=0;;;0;0 + ... 4 --filter-name='' --critical-total=1:1 CRITICAL: Jobs total: 2 | 'jobs.total.count'=2;;1:1;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 + ... 5 --filter-name='' --critical-total=2:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;2:2;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 + ... 6 --filter-name=toto --display-failed-jobs OK: Jobs total: 0, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=0;;;0; 'jobs.successful.count'=0;;;0;0 'jobs.failed.count'=0;;;0;0 'jobs.running.count'=0;;;0;0 'jobs.canceled.count'=0;;;0;0 'jobs.pending.count'=0;;;0;0 'jobs.default.count'=0;;;0;0 + ... 7 --filter-name='' --display-failed-jobs OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 + ... 8 --filter-name='' --warning-total=1:1 WARNING: Jobs total: 2 | 'jobs.total.count'=2;1:1;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 + ... 9 --filter-name='' --warning-total=2:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;2:2;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 + ... 10 --filter-name=toto --warning-total=1:1 WARNING: Jobs total: 0 | 'jobs.total.count'=0;1:1;;0; 'jobs.successful.count'=0;;;0;0 'jobs.failed.count'=0;;;0;0 'jobs.running.count'=0;;;0;0 'jobs.canceled.count'=0;;;0;0 'jobs.pending.count'=0;;;0;0 'jobs.default.count'=0;;;0;0 + ... 11 --warning-total=1:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;1:2;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 + ... 12 --warning-total=2:1 WARNING: Jobs total: 2 | 'jobs.total.count'=2;2:1;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 + ... 13 --critical-total=1:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;1:2;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 + ... 14 --critical-total=2:1 CRITICAL: Jobs total: 2 | 'jobs.total.count'=2;;2:1;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 From 362d8f5e230664740b90b36a9eaabb7c3b22b3a8 Mon Sep 17 00:00:00 2001 From: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:13:12 +0200 Subject: [PATCH 04/12] test mode(jobs) --- tests/robot/apps/automation/ansible/tower/jobs.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/robot/apps/automation/ansible/tower/jobs.robot b/tests/robot/apps/automation/ansible/tower/jobs.robot index e9f8d3541..0853a714a 100644 --- a/tests/robot/apps/automation/ansible/tower/jobs.robot +++ b/tests/robot/apps/automation/ansible/tower/jobs.robot @@ -23,7 +23,7 @@ ${CMD} ${CENTREON_PLUGINS} *** Test Cases *** jobs ${tc} [Documentation] Check the number of returned jobs - [Tags] apps automation ansible service-disco + [Tags] apps automation ansible jobs ${command} Catenate ... ${CMD} ... --mode=jobs From 858a4fe1183d8cb68cd3015e6ae4cd4ad3572be7 Mon Sep 17 00:00:00 2001 From: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:52:39 +0200 Subject: [PATCH 05/12] test --- tests/robot/apps/automation/ansible/tower/jobs.robot | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/robot/apps/automation/ansible/tower/jobs.robot b/tests/robot/apps/automation/ansible/tower/jobs.robot index 0853a714a..382077a28 100644 --- a/tests/robot/apps/automation/ansible/tower/jobs.robot +++ b/tests/robot/apps/automation/ansible/tower/jobs.robot @@ -41,7 +41,7 @@ jobs ${tc} ... 3 --filter-name=toto --critical-total=1:1 CRITICAL: Jobs total: 0 | 'jobs.total.count'=0;;1:1;0; 'jobs.successful.count'=0;;;0;0 'jobs.failed.count'=0;;;0;0 'jobs.running.count'=0;;;0;0 'jobs.canceled.count'=0;;;0;0 'jobs.pending.count'=0;;;0;0 'jobs.default.count'=0;;;0;0 ... 4 --filter-name='' --critical-total=1:1 CRITICAL: Jobs total: 2 | 'jobs.total.count'=2;;1:1;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 ... 5 --filter-name='' --critical-total=2:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;2:2;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 - ... 6 --filter-name=toto --display-failed-jobs OK: Jobs total: 0, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=0;;;0; 'jobs.successful.count'=0;;;0;0 'jobs.failed.count'=0;;;0;0 'jobs.running.count'=0;;;0;0 'jobs.canceled.count'=0;;;0;0 'jobs.pending.count'=0;;;0;0 'jobs.default.count'=0;;;0;0 + ... 6 --critical-total=2:1 CRITICAL: Jobs total: 2 | 'jobs.total.count'=2;;2:1;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 ... 7 --filter-name='' --display-failed-jobs OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 ... 8 --filter-name='' --warning-total=1:1 WARNING: Jobs total: 2 | 'jobs.total.count'=2;1:1;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 ... 9 --filter-name='' --warning-total=2:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;2:2;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 @@ -49,4 +49,3 @@ jobs ${tc} ... 11 --warning-total=1:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;1:2;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 ... 12 --warning-total=2:1 WARNING: Jobs total: 2 | 'jobs.total.count'=2;2:1;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 ... 13 --critical-total=1:2 OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;1:2;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 - ... 14 --critical-total=2:1 CRITICAL: Jobs total: 2 | 'jobs.total.count'=2;;2:1;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 From e98fda00cc7e6357e62dacfaad0bb7b0f31da063 Mon Sep 17 00:00:00 2001 From: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com> Date: Tue, 16 Jul 2024 20:58:36 +0200 Subject: [PATCH 06/12] test --- tests/resources/resources.resource | 2 +- tests/robot/apps/automation/ansible/tower/jobs.robot | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/resources/resources.resource b/tests/resources/resources.resource index 9d8d1cd44..9cd9cdccb 100644 --- a/tests/resources/resources.resource +++ b/tests/resources/resources.resource @@ -25,7 +25,7 @@ Start Mockoon ... ${MOCKOON_JSON} ... --port ... 3000 - Sleep 10s + Sleep 20s Stop Mockoon Terminate All Processes diff --git a/tests/robot/apps/automation/ansible/tower/jobs.robot b/tests/robot/apps/automation/ansible/tower/jobs.robot index 382077a28..239806b24 100644 --- a/tests/robot/apps/automation/ansible/tower/jobs.robot +++ b/tests/robot/apps/automation/ansible/tower/jobs.robot @@ -11,7 +11,7 @@ Test Timeout 120s *** Variables *** ${MOCKOON_JSON} ${CURDIR}${/}ansible_tower.json -${CMD} ${CENTREON_PLUGINS} +${cmd} ${CENTREON_PLUGINS} ... --plugin=apps::automation::ansible::tower::plugin ... --custommode=api ... --hostname=${HOSTNAME} @@ -25,9 +25,10 @@ jobs ${tc} [Documentation] Check the number of returned jobs [Tags] apps automation ansible jobs ${command} Catenate - ... ${CMD} + ... ${cmd} ... --mode=jobs ... ${extraoptions} + Log ${cmd} ${output} Run ${command} ${output} Strip String ${output} Should Be Equal As Strings From d6d604f61f552c7ba0710e0d46e26bd96fd23024 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Wed, 17 Jul 2024 10:13:05 +0200 Subject: [PATCH 07/12] format update to run tests --- src/apps/automation/ansible/tower/plugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/automation/ansible/tower/plugin.pm b/src/apps/automation/ansible/tower/plugin.pm index 064e9546c..60005fe7c 100644 --- a/src/apps/automation/ansible/tower/plugin.pm +++ b/src/apps/automation/ansible/tower/plugin.pm @@ -39,7 +39,7 @@ sub new { 'schedules' => 'apps::automation::ansible::tower::mode::schedules' }; - $self->{custom_modes}->{api} = 'apps::automation::ansible::tower::custom::api'; + $self->{custom_modes}->{api} = 'apps::automation::ansible::tower::custom::api'; $self->{custom_modes}->{towercli} = 'apps::automation::ansible::tower::custom::towercli'; return $self; From 50569dec847646a9784fbba47bb0845064adf133 Mon Sep 17 00:00:00 2001 From: Sophie Depassio Date: Wed, 17 Jul 2024 10:18:37 +0200 Subject: [PATCH 08/12] update to fix spell check --- tests/resources/spellcheck/stopwords.t | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/resources/spellcheck/stopwords.t b/tests/resources/spellcheck/stopwords.t index e2257eb37..bf58ceadb 100644 --- a/tests/resources/spellcheck/stopwords.t +++ b/tests/resources/spellcheck/stopwords.t @@ -45,6 +45,7 @@ ADSL ASAM Alcatel +Ansible Avigilon Centreon Datacore @@ -66,6 +67,7 @@ Netscaler OID PKCS1 QoS +RestAPI RRDCached SNMP SSH @@ -118,6 +120,7 @@ total-offline-prct total-online-prct total-oper-down total-oper-up +tower-cli uptime userpass v1 From 69050c0876383d135b58cd83d82c375b30cd1aff Mon Sep 17 00:00:00 2001 From: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:49:01 +0200 Subject: [PATCH 09/12] Update tests/robot/apps/automation/ansible/tower/hosts.robot Co-authored-by: omercier <32134301+omercier@users.noreply.github.com> --- tests/robot/apps/automation/ansible/tower/hosts.robot | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/robot/apps/automation/ansible/tower/hosts.robot b/tests/robot/apps/automation/ansible/tower/hosts.robot index 7b4e4d7db..383b2ee89 100644 --- a/tests/robot/apps/automation/ansible/tower/hosts.robot +++ b/tests/robot/apps/automation/ansible/tower/hosts.robot @@ -32,7 +32,9 @@ Hosts ${tc} Should Be Equal As Strings ... ${expected_result} ... ${output} - ... Wrong output result for command:{\n}{\n}${command}{\n}{\n}Command output:{\n}{\n}${output} + ... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n + ... values=False + ... collapse_spaces=True Examples: tc snmpcommunity expected_result -- ... 1 os/linux/snmp/list-diskio OK: Hosts total: 10, failed: 0 - All hosts are ok | 'hosts.total.count'=10;;;0; 'hosts.failed.count'=0;;;0;10 From ec938863a21227b7683d10b01b1905752de52e08 Mon Sep 17 00:00:00 2001 From: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:49:14 +0200 Subject: [PATCH 10/12] Update tests/robot/apps/automation/ansible/tower/jobs.robot Co-authored-by: omercier <32134301+omercier@users.noreply.github.com> --- tests/robot/apps/automation/ansible/tower/jobs.robot | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/robot/apps/automation/ansible/tower/jobs.robot b/tests/robot/apps/automation/ansible/tower/jobs.robot index 239806b24..11594b538 100644 --- a/tests/robot/apps/automation/ansible/tower/jobs.robot +++ b/tests/robot/apps/automation/ansible/tower/jobs.robot @@ -34,7 +34,9 @@ jobs ${tc} Should Be Equal As Strings ... ${expected_result} ... ${output} - ... Wrong output result for command:{\n}{\n}${command}{\n}{\n}Command output:{\n}{\n}${output} + ... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n + ... values=False + ... collapse_spaces=True Examples: tc extraoptions expected_result -- ... 1 --filter-name='' OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 From d614eb7c3d35129cc953b9e97ec499db8f49f6d1 Mon Sep 17 00:00:00 2001 From: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com> Date: Fri, 26 Jul 2024 14:56:01 +0200 Subject: [PATCH 11/12] Update tests/resources/resources.resource Co-authored-by: omercier <32134301+omercier@users.noreply.github.com> --- tests/resources/resources.resource | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/resources.resource b/tests/resources/resources.resource index 9cd9cdccb..9d8d1cd44 100644 --- a/tests/resources/resources.resource +++ b/tests/resources/resources.resource @@ -25,7 +25,7 @@ Start Mockoon ... ${MOCKOON_JSON} ... --port ... 3000 - Sleep 20s + Sleep 10s Stop Mockoon Terminate All Processes From d2f6ed1b7b934e98662f00ec0f40e2f063b33828 Mon Sep 17 00:00:00 2001 From: sfarouq-ext <116093375+sfarouq-ext@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:24:41 +0200 Subject: [PATCH 12/12] modifiying tests --- .gitignore | 3 +++ tests/resources/resources.resource | 11 +++++++++++ .../apps/automation/ansible/tower/hosts.robot | 9 +-------- .../apps/automation/ansible/tower/jobs.robot | 9 +-------- .../2012/local/nodeintegrationservice.robot | 8 +------- .../protocols/http/collection-centreon-web.robot | 12 ++++-------- .../apps/protocols/snmp/collection-sputnik.robot | 7 +------ .../snmp/hashicorp-password-manager.robot | 13 ++++--------- ...cloud-azure-policyinsights-policystates.robot | 8 ++------ .../devices/camera/avigilon/snmp/memory.robot | 7 +------ .../devices/camera/avigilon/snmp/storage.robot | 7 +------ .../camera/avigilon/snmp/temperature.robot | 7 +------ .../apc/snmp/hardware-sensors-apc-snmp.robot | 7 +------ .../sputnik/snmp/hardware-ups-sputnik-snmp.robot | 7 +------ .../hardware-ups-socomec-netvision-snmp.robot | 7 +------ .../instant/snmp/aruba-instant-ap-usage.robot | 7 +------ .../cloudcontroller/restapi/vpntunnels.robot | 15 ++++++--------- .../snmp/mode/components/netscaler-health.robot | 7 +------ .../snmp/network-fortinet-fortigate-snmp.robot | 16 ++-------------- 19 files changed, 44 insertions(+), 123 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..9e2372829 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +log.html +output.xml +report.html \ No newline at end of file diff --git a/tests/resources/resources.resource b/tests/resources/resources.resource index 9d8d1cd44..aa5d4191b 100644 --- a/tests/resources/resources.resource +++ b/tests/resources/resources.resource @@ -29,3 +29,14 @@ Start Mockoon Stop Mockoon Terminate All Processes + +Ctn Run Command And Check Result As Strings + [Arguments] ${command} ${expected_result} + ${output} Run ${command} + ${output} Strip String ${output} + Should Be Equal As Strings + ... ${expected_result} + ... ${output} + ... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n + ... values=False + ... collapse_spaces=True \ No newline at end of file diff --git a/tests/robot/apps/automation/ansible/tower/hosts.robot b/tests/robot/apps/automation/ansible/tower/hosts.robot index 383b2ee89..930597bac 100644 --- a/tests/robot/apps/automation/ansible/tower/hosts.robot +++ b/tests/robot/apps/automation/ansible/tower/hosts.robot @@ -27,14 +27,7 @@ Hosts ${tc} ${command} Catenate ... ${CMD} ... --mode=hosts - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${expected_result} - ... ${output} - ... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n - ... values=False - ... collapse_spaces=True + Ctn Run Command And Check Result As Strings ${command} ${expected_result} Examples: tc snmpcommunity expected_result -- ... 1 os/linux/snmp/list-diskio OK: Hosts total: 10, failed: 0 - All hosts are ok | 'hosts.total.count'=10;;;0; 'hosts.failed.count'=0;;;0;10 diff --git a/tests/robot/apps/automation/ansible/tower/jobs.robot b/tests/robot/apps/automation/ansible/tower/jobs.robot index 11594b538..7ace1dab0 100644 --- a/tests/robot/apps/automation/ansible/tower/jobs.robot +++ b/tests/robot/apps/automation/ansible/tower/jobs.robot @@ -29,14 +29,7 @@ jobs ${tc} ... --mode=jobs ... ${extraoptions} Log ${cmd} - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${expected_result} - ... ${output} - ... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${expected_result}\n - ... values=False - ... collapse_spaces=True + Ctn Run Command And Check Result As Strings ${command} ${expected_result} Examples: tc extraoptions expected_result -- ... 1 --filter-name='' OK: Jobs total: 2, successful: 0, failed: 0, running: 0 | 'jobs.total.count'=2;;;0; 'jobs.successful.count'=0;;;0;2 'jobs.failed.count'=0;;;0;2 'jobs.running.count'=0;;;0;2 'jobs.canceled.count'=0;;;0;2 'jobs.pending.count'=0;;;0;2 'jobs.default.count'=0;;;0;2 diff --git a/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot b/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot index 5177aaadb..2aaf93b12 100644 --- a/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot +++ b/tests/robot/apps/microsoft/hyperv/2012/local/nodeintegrationservice.robot @@ -23,13 +23,7 @@ HyperV 2022 ${tc}/3 ${command} Catenate ... ${CMD} ... --filter-vm='${filter_vm}' - - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected_result} - ... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n + Ctn Run Command And Check Result As Strings ${command} ${expected_result} Examples: tc filter_vm expected_result -- ... 1 ${EMPTY} CRITICAL: 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 09aa89efd..4e7d0ced6 100644 --- a/tests/robot/apps/protocols/http/collection-centreon-web.robot +++ b/tests/robot/apps/protocols/http/collection-centreon-web.robot @@ -23,15 +23,11 @@ ${CMD} ${CENTREON_PLUGINS} --plugin=apps::protocols::http::plugin *** Test Cases *** Check if ${test_desc} on Centreon [Tags] centreon collections http - ${output} Run - ... ${CMD} --config=${CURDIR}/${collection} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected} - ... Wrong output result:\n\n ${output}\nInstead of:\n ${expected}\n\n + ${command} Catenate + ... ${CMD} --config=${CURDIR}/${collection} + Ctn Run Command And Check Result As Strings ${command} ${expected_result} - Examples: test_desc collection expected -- + Examples: test_desc collection expected_result -- ... authentication succeeds collection-centreon-web-check-auth.collection.json OK: Authentication resulted in 200 HTTP code ... hosts are down collection-centreon-web-check-down-hosts.collection.json OK: All hosts are UP | 'hostsRequest.down.count'=0;0;;0;1 ... commands are broken collection-centreon-web-check-broken-commands.collection.json WARNING:${SPACE} - Service FakeHostThatIsDown/Svc-BadCommand output is '(Execute command failed)' | 'commands.broken.count'=1;0;;0; diff --git a/tests/robot/apps/protocols/snmp/collection-sputnik.robot b/tests/robot/apps/protocols/snmp/collection-sputnik.robot index 134412437..18893c1e9 100644 --- a/tests/robot/apps/protocols/snmp/collection-sputnik.robot +++ b/tests/robot/apps/protocols/snmp/collection-sputnik.robot @@ -22,12 +22,7 @@ SNMP Collection - Sputnik Environment ${tc}/3 ... --snmp-community=apps/protocols/snmp/collection-sputnik ... --config=${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}src/contrib/collection/snmp/sputnik-environment.json - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected_result} - ... ${command}\nWrong output result for compliance of ${expected_result}{\n}Command output:{\n}${output}{\n}{\n}{\n} + 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 diff --git a/tests/robot/apps/protocols/snmp/hashicorp-password-manager.robot b/tests/robot/apps/protocols/snmp/hashicorp-password-manager.robot index 41d02f6f1..16eae15e3 100644 --- a/tests/robot/apps/protocols/snmp/hashicorp-password-manager.robot +++ b/tests/robot/apps/protocols/snmp/hashicorp-password-manager.robot @@ -16,7 +16,7 @@ ${CMD} ${CENTREON_PLUGINS} --plugin apps::protocols::snmp::plugin - check hashicorp vault manager${Name} [Documentation] Check hashicorp vaultmanager [Tags] snmp vault - ${cmd_hashicorp} Catenate + ${command} Catenate ... ${CMD} ... --pass-manager=hashicorpvault ... --vault-address=${HOSTNAME} @@ -34,15 +34,10 @@ check hashicorp vault manager${Name} ... --format-ok='current value is: \\%{details_ok}' ... --format-details-warning='current value is: \\%{details_warning}' ... --format-details-critical='current value is: \\%{details_critical}' - ${output} Run - ... ${cmd_hashicorp} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${result} - ... ${cmd_hashicorp}\n\n Wrong output result for hashicorp auth manager on snmp generic plugin, output got :\n${output} \nExpected : \n ${result}\n + + Ctn Run Command And Check Result As Strings ${command} ${expected_result} - Examples: Name path-param result -- + Examples: Name path-param expected_result -- ... default path --auth-path='' --auth-settings="password=secrethashicorpPassword" OK: current value is: Linux centreon-devbox 5.10.0-28-amd64 #1 SMP Debian 5.10.209-2 (2024-01-31) x86_64 ... wrong path --auth-path='specific-url' --auth-settings="password=secrethashicorpPassword" OK: current value is: Linux centreon-devbox 5.10.0-28-amd64 #1 SMP Debian 5.10.209-2 (2024-01-31) x86_64 ... wrong password --auth-path='' --auth-settings="password=WrongPassword" UNKNOWN: 401 Unauthorized 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 f894a142e..ec2518dd5 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 @@ -63,10 +63,6 @@ Azure PolicyInsights PolicyStates compliance IF ${length} > 0 ${command} Catenate ${command} --resource-type=${compliance_value.resourcetype} END - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${compliance_value.result} - ... Wrong output result for compliance of ${compliance_value}.{\n}Command output:{\n}${output} + + Ctn Run Command And Check Result As Strings ${command} ${compliance_value.result} END diff --git a/tests/robot/hardware/devices/camera/avigilon/snmp/memory.robot b/tests/robot/hardware/devices/camera/avigilon/snmp/memory.robot index c5f50d8d3..3f1b51a02 100644 --- a/tests/robot/hardware/devices/camera/avigilon/snmp/memory.robot +++ b/tests/robot/hardware/devices/camera/avigilon/snmp/memory.robot @@ -24,12 +24,7 @@ Avigilon camera Memory ${tc}/3 ... --warning-available='${warning_available}' ... --critical-available='${critical_available}' - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected_result} - ... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n + Ctn Run Command And Check Result As Strings ${command} ${expected_result} Examples: tc warning_available critical_available expected_result -- ... 1 ${EMPTY} ${EMPTY} OK: total system memory available: 464.85 KB | 'memory.available'=476004B;;;0; diff --git a/tests/robot/hardware/devices/camera/avigilon/snmp/storage.robot b/tests/robot/hardware/devices/camera/avigilon/snmp/storage.robot index c7503181c..33b422adb 100644 --- a/tests/robot/hardware/devices/camera/avigilon/snmp/storage.robot +++ b/tests/robot/hardware/devices/camera/avigilon/snmp/storage.robot @@ -25,12 +25,7 @@ Avigilon camera Storage ${tc}/3 ... --critical-status='${critical_status}' ... --unknown-status='${unknown_status}' - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected_result} - ... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n + Ctn Run Command And Check Result As Strings ${command} ${expected_result} Examples: tc warning_status critical_status unknown_status expected_result -- ... 1 ${EMPTY} ${EMPTY} ${EMPTY} OK: state of the SD card: mediaNotPresent diff --git a/tests/robot/hardware/devices/camera/avigilon/snmp/temperature.robot b/tests/robot/hardware/devices/camera/avigilon/snmp/temperature.robot index 51597160f..63461c14c 100644 --- a/tests/robot/hardware/devices/camera/avigilon/snmp/temperature.robot +++ b/tests/robot/hardware/devices/camera/avigilon/snmp/temperature.robot @@ -26,12 +26,7 @@ Avigilon camera Temperature ${tc}/5 ... --warning-status='${warning_status}' ... --critical-status='${critical_status}' - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected_result} - ... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n + Ctn Run Command And Check Result As Strings ${command} ${expected_result} Examples: tc warning_temperature critical_temperature warning_status critical_status expected_result -- ... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: temperature: 23.00 C, sensor 1 [type:mainSensor] status: ok | 'sensor.temperature.celsius'=23C;;;0; 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 c90871374..9dc74e06e 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 @@ -22,12 +22,7 @@ APC Sensors ${tc}/9 ${command} Append Option To Command ${command} --critical ${critical} ${command} Append Option To Command ${command} --component ${component} - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected_result} - ... Wrong output result for compliance of ${expected_result}{\n}Command output:{\n}${output}{\n}{\n}{\n} + Ctn Run Command And Check Result As Strings ${command} ${expected_result} # --component 'temperature' --warning='humidity,.,45:65' --critical='humidity,.,35:70' Examples: tc component warning critical expected_result -- ... 1 _empty_ _empty_ _empty_ OK: All 2 components are ok [2/2 temperatures]. | 'Main Module:Sonde de temperature#hardware.sensor.temperature.celsius'=23C;;;; 'Main Module:Sonde de temperature#hardware.sensor.humidity.percentage'=35%;;;0;100 'hardware.temperature.count'=2;;;; 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 ab7cc9079..b8bb55b34 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 @@ -33,12 +33,7 @@ Sputnik UPS - Environment ${tc}/9 ${opt} Append Option --filter-id ${filter_id} ${command} Catenate ${command} ${opt} - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected_result} - ... Wrong output result for compliance of ${expected_result}{\n}Command output:{\n}${output}{\n}{\n}{\n} + Ctn Run Command And Check Result As Strings ${command} ${expected_result} Examples: tc filter_id w_temperature c_temperature w_humidity c_humidity expected_result -- ... 1 1 30 50 50 70 OK: 'Sensor 1': temperature 20.06 C, humidity 33 % | 'Sensor 1#environment.temperature.celsius'=20.06C;0:30;0:50;; 'Sensor 1#environment.humidity.percentage'=33%;0:50;0:70;0;100 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 3ea0cb6b3..1bcef49b0 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 @@ -27,12 +27,7 @@ Battery ${tc}/4 ${opt} Append Option --critical-temperature ${c_temperature} ${command} Catenate ${command} ${opt} - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected_result} - ... ${command} \nWrong output result for compliance of ${expected_result}{\n}Command output:{\n}${output}{\n}{\n}{\n} + Ctn Run Command And Check Result As Strings ${command} ${expected_result} Examples: tc w_temperature c_temperature expected_result -- ... 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;; 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 6bc9586ee..be24da5b9 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 @@ -66,10 +66,5 @@ Network Aruba Instant SNMP plugin ... --snmp-community=${ap_usage_tc.snmpcommunity} Log To Console ${command} - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${ap_usage_tc.result} - ... Wrong output result for compliance of ${ap_usage_tc.result}{\n}Command output:{\n}${output}{\n}{\n}{\n} + Ctn Run Command And Check Result As Strings ${command} ${ap_usage_tc.result} END diff --git a/tests/robot/network/cisco/meraki/cloudcontroller/restapi/vpntunnels.robot b/tests/robot/network/cisco/meraki/cloudcontroller/restapi/vpntunnels.robot index 8c6fa0f8d..59876807d 100644 --- a/tests/robot/network/cisco/meraki/cloudcontroller/restapi/vpntunnels.robot +++ b/tests/robot/network/cisco/meraki/cloudcontroller/restapi/vpntunnels.robot @@ -31,16 +31,13 @@ Create cache from API Check if ${test_desc} works [Tags] meraki api vpn network - ${output} Run - ... ${CMD} --mode=vpn-tunnels --filter-network-name=${filter_network_name} --cache-use --critical-total-dormant=1: + ${command} Catenate + ... ${CMD} + ... --mode=vpn-tunnels --filter-network-name=${filter_network_name} --cache-use --critical-total-dormant=1: + + Ctn Run Command And Check Result As Strings ${command} ${expected_result} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected} - ... Wrong output result:\n\n ${output}\nInstead of:\n ${expected}\n\n - - Examples: test_desc filter_network_name expected -- + Examples: test_desc filter_network_name expected_result -- ... 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 485a78049..2fa17547b 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 @@ -23,12 +23,7 @@ check psu components ${tc}/2 ... --component=psu ... --alternative-status-mapping='${alternative_status_mapping}' - ${output} Run ${command} - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${expected_result} - ... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n + Ctn Run Command And Check Result As Strings ${command} ${expected_result} Examples: tc alternative_status_mapping community expected_result -- ... 1 true psu-citrix-v13 OK: All 4 components are ok [4/4 psus]. | 'count_psu'=4;;;; 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 ccfbdfb88..1b7faf639 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 @@ -382,14 +382,8 @@ Network Fortinet Fortigate SNMP link monitor ... ${command} ... --critical-packet-loss=${fortinet_fortigate_linkmonitor_test.criticalpacketloss} END - ${output} Run ${command} Log To Console . no_newline=true - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${fortinet_fortigate_linkmonitor_test.result} - ... Wrong result output for:${\n}Command: ${\n}${command}${\n}${\n}Expected output: ${\n}${fortinet_fortigate_linkmonitor_test.result}${\n}${\n}Obtained output:${\n}${output}${\n}${\n}${\n} - ... values=False + Ctn Run Command And Check Result As Strings ${command} ${fortinet_fortigate_linkmonitor_test.result} END Network Fortinet Fortigate SNMP list link monitor @@ -421,12 +415,6 @@ Network Fortinet Fortigate SNMP list link monitor ... ${command} ... --filter-vdom=${fortinet_fortigate_listlinkmonitors_test.filtervdom} END - ${output} Run ${command} Log To Console . no_newline=true - ${output} Strip String ${output} - Should Be Equal As Strings - ... ${output} - ... ${fortinet_fortigate_listlinkmonitors_test.result} - ... Wrong result output for:${\n}Command: ${\n}${command}${\n}${\n}Expected output: ${\n}${fortinet_fortigate_listlinkmonitors_test.result}${\n}${\n}Obtained output:${\n}${output}${\n}${\n}${\n} - ... values=False + Ctn Run Command And Check Result As Strings ${command} ${fortinet_fortigate_listlinkmonitors_test.result} END