From f2645fee5641014794de8f33eafe7b93671fd22f Mon Sep 17 00:00:00 2001 From: tuntoja <58987095+tuntoja@users.noreply.github.com> Date: Mon, 4 Mar 2024 15:33:34 +0100 Subject: [PATCH 01/27] fix(ci): replace job conditional by dedicated step (#1169) * udpate release workflow * udpate release action * add feedbacks * Update .github/workflows/release.yml Co-authored-by: Kevin Duret * Remove unused arrays --------- Co-authored-by: Kevin Duret --- .github/actions/release/action.yml | 36 ++++++++++++++++-------------- .github/workflows/release.yml | 17 ++++++++++++-- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml index 7b427426444..ad9f980d751 100644 --- a/.github/actions/release/action.yml +++ b/.github/actions/release/action.yml @@ -4,18 +4,18 @@ inputs: github_ref_name: description: "Github ref name" required: true + jira_api_token: + description: "Token to authenticate to Jira" + required: true + jira_user_email: + description: "Email linked to token" + required: true jira_project_id: description: "Jira project id to create release" required: true jira_webhook_url: description: "Jira release webhook" required: true - jira_user_email: - description: "Jira user email" - required: true - jira_api_token: - description: "Jira api token" - required: true runs: using: "composite" @@ -26,9 +26,8 @@ runs: - name: Get released versions for components run: | set -eu - COMPONENTS_RELEASED=() - COMPONENTS_OSS=("centreon-awie" "centreon-dsm" "centreon-gorgone" "centreon-ha" "centreon-open-tickets" "centreon-web") - COMPONENTS_MODULES=("centreon-anomaly-detection" "centreon-autodiscovery" "centreon-bam" "centreon-cloud-business-extensions" "centreon-cloud-extensions" "centreon-it-edition-extensions" "centreon-license-manager" "centreon-map" "centreon-mbi" "centreon-pp-manager") + + # Variables COMPONENTS_COLLECT=("centreon-collect") CURRENT_STABLE_BRANCH_MAJOR_VERSION="" declare -a NEW_STABLE_TAGS=() @@ -53,12 +52,11 @@ runs: PREVIOUS_STABLE_TAGS+=($(git tag -l --sort=-version:refname "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION*" | head -n 1)) # New stable tags array NEW_STABLE_TAGS+=("$component-$MAJOR_VERSION.$MINOR_VERSION") - done echo "Previous releases were: ${PREVIOUS_STABLE_TAGS[*]}" echo "New releases are: ${NEW_STABLE_TAGS[*]}" - # Check that NEW_STABLE_TAGS are fully different from PREVIOUS_STABLE_TAGS + # TODO: Check that NEW_STABLE_TAGS are fully different from PREVIOUS_STABLE_TAGS # re use the part from check version ?? # or use the check-version action after turning this release action into a real workflow ? @@ -81,7 +79,7 @@ runs: if [ -z $(git tag --list "$TAG" | head -n 1) ]; then git tag -a "$TAG" -m "$TAG" git push --follow-tags - echo "::notice::Tagging branch with $TAG." + echo "::notice::Tagging stable branch with $TAG." else echo "::error::Release tag $TAG already exists, exiting." exit 1 @@ -95,12 +93,12 @@ runs: echo "Installing GH CLI." if ! command -v gh &> /dev/null; then echo "Installing GH CLI." - type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) + type -p curl >/dev/null || (sudo apt-get update && sudo apt-get install curl -y) curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null - sudo apt update - sudo apt install gh -y + sudo apt-get update + sudo apt-get install gh -y else echo "GH CLI is already installed." fi @@ -108,7 +106,7 @@ runs: # Create GITHUB release for each release components echo "Creating GITHUB releases." for TAG in ${NEW_STABLE_TAGS[@]}; do - echo "::notice::Creating release with title $TAG for tag $TAG." + echo "Creating GITHUB release with title $TAG for tag $TAG." gh release create $TAG --target "${{ inputs.github_ref_name }} --title "$TAG" --verify-tag done shell: bash @@ -117,6 +115,10 @@ runs: run: | set -eu + # Call JIRA to provide new jira versions to create + # Webhook url + JIRA_INCOMING_WEBHOOK="${{ inputs.jira_webhook_url }}" + # Rebuild NEW_STABLE_TAGS as an array for i in ${NEW_STABLE_TAGS[@]}; do NEW_RELEASE_TAGS+=("$i") @@ -179,7 +181,7 @@ runs: # DEBUG echo "JSON_TAGS: \r\n$JSON_TAGS" echo "JSON_VERSION_INFO: $JSON_VERSION_INFO" - echo "Sending to JIRA AUTOMATION: \r\n$RELEASE_JSON" + echo "Sending to JIRA automation: \r\n$RELEASE_JSON" # Call jira webhook to trigger the communication workflow # and provide versions data for communication diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85e89a1cc74..3a02068db91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,9 +20,22 @@ on: jobs: release: - if: github.event.pull_request.merged == true && (github.base_ref == 'master' || github.base_ref == '[2-9][0-9].[0-9][0-9].x') + if: ${{ github.event.pull_request.merged == true }} runs-on: ubuntu-22.04 steps: + - name: Check base_ref + run: | + set -eu + # Check if github.base_ref is either master or any of the supported version ones + # This must never run on any other than master and supported version base_ref + if [[ "${{ github.base_ref }}" == 'master' || "${{ github.base_ref }}" =~ ^[2-9][0-9].[0-9][0-9].x ]];then + echo "[DEBUG] base_ref is valid: ${{ github.base_ref }}" + else + echo "::error::base_ref is not valid (${{ github.base_ref }}), exiting." + exit 1 + fi + shell: bash + - name: Checkout sources uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: @@ -34,6 +47,6 @@ jobs: with: github_ref_name: ${{ github.head_ref || github.ref_name }} jira_project_id: ${{ secrets.JIRA_PROJECT_ID }} - jira_webhook_url: ${{ secrets.JIRA_RELEASE_WEBHOOK }} jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }} jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }} + jira_webhook_url: ${{ secrets.JIRA_RELEASE_WEBHOOK }} From f9f219525fb09bd173ae520cc55726386ea887aa Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 6 Mar 2024 10:02:13 +0100 Subject: [PATCH 02/27] fix(tests): Centreon keywords prefixed with Ctn REFS: MON-21351 --- tests/bam/bam_pb.robot | 714 ++++++------- tests/bam/boolean_rules.robot | 538 +++++----- tests/bam/inherited_downtime.robot | 298 +++--- tests/bam/pb_inherited_downtime.robot | 310 +++--- .../dedicated-connection.robot | 28 +- tests/broker-database/networkFailure.robot | 206 ++-- tests/broker-engine/acknowledgement.robot | 240 ++--- tests/broker-engine/anomaly-detection.robot | 388 +++---- tests/broker-engine/bbdo-protobuf.robot | 266 ++--- tests/broker-engine/bench.robot | 174 +-- tests/broker-engine/compression.robot | 38 +- tests/broker-engine/delete-poller.robot | 386 +++---- tests/broker-engine/downtimes.robot | 314 +++--- tests/broker-engine/external-commands.robot | 852 +++++++-------- tests/broker-engine/external-commands2.robot | 992 +++++++++--------- tests/broker-engine/hostgroups.robot | 224 ++-- .../hosts-with-notes-and-actions.robot | 86 +- tests/broker-engine/log-v2_engine.robot | 346 +++--- tests/broker-engine/muxer_filter.robot | 312 +++--- .../broker-engine/notification-unstable.robot | 686 ++++++------ tests/broker-engine/output-tables.robot | 246 ++--- .../broker-engine/retention-duplicates.robot | 542 +++++----- tests/broker-engine/reverse-connection.robot | 174 +-- tests/broker-engine/rrd-from-db.robot | 216 ++-- tests/broker-engine/rrd.robot | 382 +++---- tests/broker-engine/rrdcached-from-db.robot | 180 ++-- tests/broker-engine/rrdcached.robot | 312 +++--- tests/broker-engine/scheduler.robot | 38 +- tests/broker-engine/servicegroups.robot | 198 ++-- .../services-and-bulk-stmt.robot | 310 +++--- tests/broker-engine/services-increased.robot | 120 +-- .../services-with-notes-and-actions.robot | 92 +- tests/broker-engine/services.robot | 48 +- tests/broker-engine/start-stop.robot | 604 +++++------ tests/broker-engine/tags.robot | 826 +++++++-------- tests/broker-engine/tls.robot | 390 +++---- tests/broker-engine/victoria.robot | 130 +-- tests/broker-engine/whitelist.robot | 174 +-- tests/broker/bbdo-server-client-ko.robot | 74 +- .../broker/bbdo-server-client-reversed.robot | 342 +++--- tests/broker/bbdo-server-client.robot | 452 ++++---- tests/broker/command-line.robot | 38 +- tests/broker/filters.robot | 46 +- tests/broker/grpc-stream.robot | 102 +- tests/broker/log.robot | 64 +- tests/broker/sql.robot | 380 +++---- tests/broker/start-stop.robot | 104 +- tests/ccc/ccc.robot | 226 ++-- tests/connector_perl/connector_perl.robot | 26 +- tests/connector_ssh/connector_ssh.robot | 174 +-- tests/engine/forced_checks.robot | 288 ++--- tests/engine/perl-connectors.robot | 20 +- tests/engine/start-stop.robot | 36 +- tests/migration/migration.robot | 96 +- tests/resources/Bench.py | 28 +- tests/resources/Broker.py | 174 +-- tests/resources/Common.py | 186 ++-- tests/resources/Engine.py | 300 +++--- tests/resources/db_conf.py | 16 +- tests/resources/resources.resource | 160 +-- tests/resources/specific-duplication.py | 8 +- tests/severities/hosts.robot | 204 ++-- tests/severities/severities.robot | 328 +++--- 63 files changed, 8126 insertions(+), 8126 deletions(-) diff --git a/tests/bam/bam_pb.robot b/tests/bam/bam_pb.robot index eb2db185600..ad945119ff5 100644 --- a/tests/bam/bam_pb.robot +++ b/tests/bam/bam_pb.robot @@ -3,82 +3,82 @@ Documentation Centreon Broker and BAM with bbdo version 3.0.1 Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup BAM Setup -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn BAM Setup +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BAWORST [Documentation] With bbdo version 3.0.1, a BA of type 'worst' with two services is configured. We also check stats output [Tags] broker downtime engine bam - BAM Init + Ctn BAM Init @{svc} Set Variable ${{ [("host_16", "service_314"), ("host_16", "service_303")] }} - ${ba__svc} Create Ba With Services test worst ${svc} - Start Broker + ${ba__svc} Ctn Create Ba With Services test worst ${svc} + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${ba__svc[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - All KPIs are in an OK state ... 60 Should Be True ${result} The BA test has not the expected output # KPI set to unknown - Process Service Result Hard host_16 service_303 3 output unknown for 303 + Ctn Process Service Result Hard host_16 service_303 3 output unknown for 303 - ${result} Check Service Status With Timeout host_16 service_303 3 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 3 60 HARD Should Be True ${result} The service (host_16,service_303) is not UNKNOWN as expected # The BA should become unknown - ${result} Check Ba Status With Timeout test 3 60 - Dump Ba On Error ${result} ${ba__svc[0]} + ${result} Ctn Check Ba Status With Timeout test 3 60 + Ctn Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not UNKNOWN as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is UNKNOWN - At least one KPI is in an UNKNOWN state: KPI Service host_16/service_303 is in UNKNOWN state ... 60 Should Be True ${result} The BA test has not the expected output # KPI set to warning - Process Service Result Hard host_16 service_303 1 output warning for 303 + Ctn Process Service Result Hard host_16 service_303 1 output warning for 303 - ${result} Check Service Status With Timeout host_16 service_303 1 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 1 60 HARD Should Be True ${result} The service (host_16,service_303) is not WARNING as expected # The BA should become warning - ${result} Check Ba Status With Timeout test 1 60 - Dump Ba On Error ${result} ${ba__svc[0]} + ${result} Ctn Check Ba Status With Timeout test 1 60 + Ctn Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not WARNING as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is WARNING - At least one KPI is in a WARNING state: KPI Service host_16/service_303 is in WARNING state ... 60 Should Be True ${result} The BA test has not the expected output # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for 314 + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 - Dump Ba On Error ${result} ${ba__svc[0]} + ${result} Ctn Check Ba Status With Timeout test 2 60 + Ctn Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not CRITICAL as expected Connect To Database pymysql ${DBNameConf} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -86,58 +86,58 @@ BAWORST ... SELECT acknowledged, downtime, in_downtime, current_status FROM mod_bam WHERE name='test' Should Be Equal As Strings ${output} ((0.0, 0.0, 0, 2),) - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is CRITICAL - At least one KPI is in a CRITICAL state: KPI Service host_16/service_303 is in WARNING state, KPI Service host_16/service_314 is in CRITICAL state ... 60 Should Be True ${result} The BA test has not the expected output # check broker stats - ${res} Get Broker Stats central 1: 127.0.0.1:[0-9]+ 10 endpoint central-broker-master-input peers + ${res} Ctn Get Broker Stats central 1: 127.0.0.1:[0-9]+ 10 endpoint central-broker-master-input peers Should Be True ${res} no central-broker-master-input.peers found in broker stat output - ${res} Get Broker Stats central listening 10 endpoint central-broker-master-input state + ${res} Ctn Get Broker Stats central listening 10 endpoint central-broker-master-input state Should Be True ${res} central-broker-master-input not listening - ${res} Get Broker Stats central connected 10 endpoint centreon-bam-monitoring state + ${res} Ctn Get Broker Stats central connected 10 endpoint centreon-bam-monitoring state Should Be True ${res} central-bam-monitoring not connected - ${res} Get Broker Stats central connected 10 endpoint centreon-bam-reporting state + ${res} Ctn Get Broker Stats central connected 10 endpoint centreon-bam-reporting state Should Be True ${res} central-bam-reporting not connected - Reload Engine - Reload Broker + Ctn Reload Engine + Ctn Reload Broker # check broker stats - ${res} Get Broker Stats central 1: 127.0.0.1:[0-9]+ 10 endpoint central-broker-master-input peers + ${res} Ctn Get Broker Stats central 1: 127.0.0.1:[0-9]+ 10 endpoint central-broker-master-input peers Should Be True ${res} no central-broker-master-input.peers found in broker stat output - ${res} Get Broker Stats central listening 10 endpoint central-broker-master-input state + ${res} Ctn Get Broker Stats central listening 10 endpoint central-broker-master-input state Should Be True ${res} central-broker-master-input not listening - ${res} Get Broker Stats central connected 10 endpoint centreon-bam-monitoring state + ${res} Ctn Get Broker Stats central connected 10 endpoint centreon-bam-monitoring state Should Be True ${res} central-bam-monitoring not connected - ${res} Get Broker Stats central connected 10 endpoint centreon-bam-reporting state + ${res} Ctn Get Broker Stats central connected 10 endpoint centreon-bam-reporting state Should Be True ${res} central-bam-reporting not connected # Little check of the GetBa gRPC command ${result} Run Keyword And Return Status File Should Exist /tmp/output Run Keyword If ${result} is True Remove File /tmp/output - Broker Get Ba 51001 1 /tmp/output + Ctn Broker Get Ba 51001 1 /tmp/output Wait Until Created /tmp/output ${result} Grep File /tmp/output digraph Should Not Be Empty ${result} /tmp/output does not contain the word 'digraph' - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BAWORST2 [Documentation] a worst ba with a boolean kpi and a ba kpi [Tags] broker engine bam - BAM Init + Ctn BAM Init - ${id_ba__sid} Create Ba test worst 100 100 - Add Boolean Kpi + ${id_ba__sid} Ctn Create Ba test worst 100 100 + Ctn Add Boolean Kpi ... ${id_ba__sid[0]} ... {host_16 service_302} {IS} {OK} ... False @@ -145,572 +145,572 @@ BAWORST2 # ba kpi @{svc} Set Variable ${{ [("host_16", "service_314")] }} - ${id_ba__sid__child} Create Ba With Services test_child worst ${svc} - Add Ba Kpi ${id_ba__sid__child[0]} ${id_ba__sid[0]} 1 2 3 + ${id_ba__sid__child} Ctn Create Ba With Services test_child worst ${svc} + Ctn Add Ba Kpi ${id_ba__sid__child[0]} ${id_ba__sid[0]} 1 2 3 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - All KPIs are in an OK state ... 10 Should Be True ${result} The BA test has not the expected output # boolean critical => ba test critical - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - ${result} Check Service Status With Timeout host_16 service_302 2 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 2 60 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected Sleep 2s - ${result} Check Ba Status With Timeout test 2 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 2 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is CRITICAL - At least one KPI is in a CRITICAL state: KPI Boolean rule bool test is in CRITICAL state ... 10 Should Be True ${result} The BA test has not the expected output # child ba critical - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_314 ... 2 ... output critical for service_314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected Sleep 2s - ${result} Check Ba Status With Timeout test_child 2 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test_child 2 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test_child is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 2 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 2 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is CRITICAL - At least one KPI is in a CRITICAL state: KPI Business Activity test_child is in CRITICAL state, KPI Boolean rule bool test is in CRITICAL state ... 10 Should Be True ${result} The BA test has not the expected output # boolean rule ok stay in critical - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 0 ... output OK - ${result} Check Service Status With Timeout host_16 service_302 0 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 0 60 HARD Should Be True ${result} The service (host_16,service_302) is not OK as expected Sleep 2s - ${result} Check Ba Status With Timeout test 2 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 2 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is CRITICAL - At least one KPI is in a CRITICAL state: KPI Business Activity test_child is in CRITICAL state ... 10 Should Be True ${result} The BA test has not the expected output - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BABEST_SERVICE_CRITICAL [Documentation] With bbdo version 3.0.1, a BA of type 'best' with 2 serv, ba is critical only if the 2 services are critical [Tags] broker engine bam - BAM Init + Ctn BAM Init @{svc} Set Variable ${{ [("host_16", "service_314"), ("host_16", "service_303")] }} - ${ba__svc} Create Ba With Services test best ${svc} + ${ba__svc} Ctn Create Ba With Services test best ${svc} # Command of service_314 is set to critical - ${cmd_1} Get Command Id 314 + ${cmd_1} Ctn Get Command Id 314 Log To Console service_314 has command id ${cmd_1} - Set Command Status ${cmd_1} 2 - Start Broker + Ctn Set Command Status ${cmd_1} 2 + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${ba__svc[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - At least one KPI is in an OK state ... 60 Should Be True ${result} The BA test has not the expected output # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for 314 + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should remain OK Sleep 2s - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${ba__svc[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - At least one KPI is in an OK state ... 60 Should Be True ${result} The BA test has not the expected output # KPI set to unknown - Process Service Result Hard host_16 service_303 3 output unknown for 303 + Ctn Process Service Result Hard host_16 service_303 3 output unknown for 303 - ${result} Check Service Status With Timeout host_16 service_303 3 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 3 60 HARD Should Be True ${result} The service (host_16,service_303) is not UNKNOWN as expected # The BA should become warning - ${result} Check Ba Status With Timeout test 3 60 - Dump Ba On Error ${result} ${ba__svc[0]} + ${result} Ctn Check Ba Status With Timeout test 3 60 + Ctn Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not UNKNOWN as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is UNKNOWN - All KPIs are in an UNKNOWN state or worse (WARNING or CRITICAL) ... 60 Should Be True ${result} The BA test has not the expected output # KPI set to warning - Process Service Result Hard host_16 service_303 1 output warning for 303 + Ctn Process Service Result Hard host_16 service_303 1 output warning for 303 - ${result} Check Service Status With Timeout host_16 service_303 1 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 1 60 HARD Should Be True ${result} The service (host_16,service_303) is not WARNING as expected # The BA should become warning - ${result} Check Ba Status With Timeout test 1 60 - Dump Ba On Error ${result} ${ba__svc[0]} + ${result} Ctn Check Ba Status With Timeout test 1 60 + Ctn Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not WARNING as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is WARNING - All KPIs are in a WARNING state or worse (CRITICAL) ... 60 Should Be True ${result} The BA test has not the expected output # KPI set to critical - Process Service Result Hard host_16 service_303 2 output critical for 303 + Ctn Process Service Result Hard host_16 service_303 2 output critical for 303 - ${result} Check Service Status With Timeout host_16 service_303 2 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 2 60 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 - Dump Ba On Error ${result} ${ba__svc[0]} + ${result} Ctn Check Ba Status With Timeout test 2 60 + Ctn Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not CRITICAL as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is CRITICAL - All KPIs are in a CRITICAL state ... 60 Should Be True ${result} The BA test has not the expected output # KPI set to OK - Process Service Check Result host_16 service_314 0 output ok for 314 + Ctn Process Service Check Result host_16 service_314 0 output ok for 314 - ${result} Check Service Status With Timeout host_16 service_314 0 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_314 0 60 HARD Should Be True ${result} The service (host_16,service_314) is not OK as expected # The BA should become OK - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${ba__svc[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not OK as expected - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BA_IMPACT_2KPI_SERVICES [Documentation] With bbdo version 3.0.1, a BA of type 'impact' with 2 serv, ba is critical only if the 2 services are critical [Tags] broker engine bam - BAM Init + Ctn BAM Init - ${id_ba__sid} Create Ba test impact 20 35 - Add Service KPI host_16 service_302 ${id_ba__sid[0]} 40 30 20 - Add Service KPI host_16 service_303 ${id_ba__sid[0]} 40 30 20 + ${id_ba__sid} Ctn Create Ba test impact 20 35 + Ctn Add Service Kpi host_16 service_302 ${id_ba__sid[0]} 40 30 20 + Ctn Add Service Kpi host_16 service_303 ${id_ba__sid[0]} 40 30 20 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # service_302 critical service_303 warning => ba warning 30% - Process Service Result Hard host_16 service_302 2 output critical for service_302 - ${result} Check Service Status With Timeout host_16 service_302 2 60 HARD + Ctn Process Service Result Hard host_16 service_302 2 output critical for service_302 + ${result} Ctn Check Service Status With Timeout host_16 service_302 2 60 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - Level = 60 (warn: 35 - crit: 20) - 1 KPI out of 2 impacts the BA: KPI Service host_16/service_302 (impact: 40)|BA_Level=60;35;20;0;100 ... 60 Should Be True ${result} The BA test has not the expected output - Process Service Result Hard host_16 service_303 1 output warning for service_303 - ${result} Check Service Status With Timeout host_16 service_303 1 60 HARD + Ctn Process Service Result Hard host_16 service_303 1 output warning for service_303 + ${result} Ctn Check Service Status With Timeout host_16 service_303 1 60 HARD Should Be True ${result} The service (host_16,service_303) is not WARNING as expected - ${result} Check Ba Status With Timeout test 1 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 1 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA ba_1 is not WARNING as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is WARNING - Level = 30 - 2 KPIs out of 2 impact the BA for 70 points - KPI Service host_16/service_303 (impact: 30), KPI Service host_16/service_302 (impact: 40)|BA_Level=30;35;20;0;100 ... 10 Should Be True ${result} The BA test has not the expected output # service_302 critical service_303 critical => ba critical 80% - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_303 ... 2 ... output critical for service_303 - ${result} Check Service Status With Timeout host_16 service_303 2 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 2 60 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 2 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 2 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA ba_1 is not CRITICAL as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is CRITICAL - Level = 20 - 2 KPIs out of 2 impact the BA for 80 points - KPI Service host_16/service_303 (impact: 40), KPI Service host_16/service_302 (impact: 40)|BA_Level=20;35;20;0;100 ... 10 Should Be True ${result} The BA test has not the expected output # service_302 ok => ba ok - Process Service Check Result host_16 service_302 0 output ok for service_302 - ${result} Check Service Status With Timeout host_16 service_302 0 60 HARD + Ctn Process Service Check Result host_16 service_302 0 output ok for service_302 + ${result} Ctn Check Service Status With Timeout host_16 service_302 0 60 HARD Should Be True ${result} The service (host_16,service_302) is not OK as expected - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA ba_1 is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - Level = 60 (warn: 35 - crit: 20) - 1 KPI out of 2 impacts the BA: KPI Service host_16/service_303 (impact: 40)|BA_Level=60;35;20;0;100 ... 10 Should Be True ${result} The BA test has not the expected output # both warning => ba ok - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 1 ... output warning for service_302 - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_303 ... 1 ... output warning for service_303 - ${result} Check Service Status With Timeout host_16 service_302 1 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 1 60 HARD Should Be True ${result} The service (host_16,service_302) is not WARNING as expected - ${result} Check Service Status With Timeout host_16 service_303 1 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 1 60 HARD Should Be True ${result} The service (host_16,service_303) is not WARNING as expected - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - Level = 40 (warn: 35 - crit: 20) - 2 KPIs out of 2 impact the BA: KPI Service host_16/service_303 (impact: 30), KPI Service host_16/service_302 (impact: 30)|BA_Level=40;35;20;0;100 ... 10 Should Be True ${result} The BA test has not the expected output - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BA_RATIO_PERCENT_BA_SERVICE [Documentation] With bbdo version 3.0.1, a BA of type 'ratio percent' with 2 serv an 1 ba with one service [Tags] broker engine bam - BAM Init + Ctn BAM Init - ${id_ba__sid} Create Ba test ratio_percent 67 49 - Add Service KPI host_16 service_302 ${id_ba__sid[0]} 40 30 20 - Add Service KPI host_16 service_303 ${id_ba__sid[0]} 40 30 20 + ${id_ba__sid} Ctn Create Ba test ratio_percent 67 49 + Ctn Add Service Kpi host_16 service_302 ${id_ba__sid[0]} 40 30 20 + Ctn Add Service Kpi host_16 service_303 ${id_ba__sid[0]} 40 30 20 @{svc} Set Variable ${{ [("host_16", "service_314")] }} - ${id_ba__sid__child} Create Ba With Services test_child worst ${svc} - Add Ba Kpi ${id_ba__sid__child[0]} ${id_ba__sid[0]} 1 2 3 + ${id_ba__sid__child} Ctn Create Ba With Services test_child worst ${svc} + Ctn Add Ba Kpi ${id_ba__sid__child[0]} ${id_ba__sid[0]} 1 2 3 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - 0% of KPIs are in a CRITICAL state (warn: 49 - crit: 67)|BA_Level=0%;49;67;0;100 ... 10 Should Be True ${result} The BA test has not the expected output # one serv critical => ba ok - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - ${result} Check Service Status With Timeout host_16 service_302 2 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 2 60 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected Sleep 2s - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - 33% of KPIs are in a CRITICAL state (warn: 49 - crit: 67)|BA_Level=33%;49;67;0;100 ... 10 Should Be True ${result} The BA test has not the expected output # two serv critical => ba warning - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_303 ... 2 ... output critical for service_303 - ${result} Check Service Status With Timeout host_16 service_302 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected - ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 1 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 1 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not WARNING as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is WARNING - 66% of KPIs are in a CRITICAL state (warn: 49 - crit: 67)|BA_Level=66%;49;67;0;100 ... 10 Should Be True ${result} The BA test has not the expected output # two serv critical and child ba critical => mother ba critical - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_303 ... 2 ... output critical for service_303 - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_314 ... 2 ... output critical for service_314 - ${result} Check Service Status With Timeout host_16 service_314 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 30 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test_child 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test_child 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test_child is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is CRITICAL - 100% of KPIs are in a CRITICAL state (warn: 49 - crit: 67)|BA_Level=100%;49;67;0;100 ... 10 Should Be True ${result} The BA test has not the expected output - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BA_RATIO_NUMBER_BA_SERVICE [Documentation] With bbdo version 3.0.1, a BA of type 'ratio number' with 2 services and one ba with 1 service [Tags] broker engine bam - BAM Init + Ctn BAM Init - ${id_ba__sid} Create Ba test ratio_number 3 2 - Add Service KPI host_16 service_302 ${id_ba__sid[0]} 40 30 20 - Add Service KPI host_16 service_303 ${id_ba__sid[0]} 40 30 20 + ${id_ba__sid} Ctn Create Ba test ratio_number 3 2 + Ctn Add Service Kpi host_16 service_302 ${id_ba__sid[0]} 40 30 20 + Ctn Add Service Kpi host_16 service_303 ${id_ba__sid[0]} 40 30 20 @{svc} Set Variable ${{ [("host_16", "service_314")] }} - ${id_ba__sid__child} Create Ba With Services test_child worst ${svc} - Add BA KPI ${id_ba__sid__child[0]} ${id_ba__sid[0]} 1 2 3 + ${id_ba__sid__child} Ctn Create Ba With Services test_child worst ${svc} + Ctn Add Ba Kpi ${id_ba__sid__child[0]} ${id_ba__sid[0]} 1 2 3 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - 0 out of 3 KPIs are in a CRITICAL state (warn: 2 - crit: 3)|BA_Level=0;2;3;0;3 ... 10 Should Be True ${result} The BA test has not the expected output # One service CRITICAL => The BA is still OK - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - ${result} Check Service Status With Timeout host_16 service_302 2 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 2 60 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is OK - 1 out of 3 KPIs are in a CRITICAL state (warn: 2 - crit: 3)|BA_Level=1;2;3;0;3 ... 10 Should Be True ${result} The BA test has not the expected output # Two services CRITICAL => The BA passes to WARNING - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_303 ... 2 ... output critical for service_303 - ${result} Check Service Status With Timeout host_16 service_302 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected - ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 1 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 1 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The test BA is not in WARNING as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is WARNING - 2 out of 3 KPIs are in a CRITICAL state (warn: 2 - crit: 3)|BA_Level=2;2;3;0;3 ... 10 Should Be True ${result} The BA test has not the expected output # Two services CRITICAL and also the child BA => The mother BA passes to CRITICAL - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_303 ... 2 ... output critical for service_303 - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_314 ... 2 ... output critical for service_314 - ${result} Check Service Status With Timeout host_16 service_302 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected - ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected - ${result} Check Service Status With Timeout host_16 service_314 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 30 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test_child 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test_child 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test_child is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 2 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 2 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected - ${result} Check Ba Output With Timeout + ${result} Ctn Check Ba Output With Timeout ... test ... Status is CRITICAL - 3 out of 3 KPIs are in a CRITICAL state (warn: 2 - crit: 3)|BA_Level=3;2;3;0;3 ... 10 Should Be True ${result} The BA test has not the expected output - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BA_BOOL_KPI [Documentation] With bbdo version 3.0.1, a BA of type 'worst' with 1 boolean kpi [Tags] broker engine bam - BAM Init + Ctn BAM Init - ${id_ba__sid} Create Ba test worst 100 100 - Add Boolean Kpi + ${id_ba__sid} Ctn Create Ba test worst 100 100 + Ctn Add Boolean Kpi ... ${id_ba__sid[0]} ... {host_16 service_302} {IS} {OK} {OR} ( {host_16 service_303} {IS} {OK} {AND} {host_16 service_314} {NOT} {UNKNOWN} ) ... False ... 100 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # 302 warning and 303 critical => ba critical - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 1 ... output warning for service_302 - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_303 ... 2 ... output critical for service_303 - Process Service Check Result host_16 service_314 0 output OK for service_314 - ${result} Check Service Status With Timeout host_16 service_302 1 30 HARD + Ctn Process Service Check Result host_16 service_314 0 output OK for service_314 + ${result} Ctn Check Service Status With Timeout host_16 service_302 1 30 HARD Should Be True ${result} The service (host_16,service_302) is not WARNING as expected - ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected - ${result} Check Service Status With Timeout host_16 service_314 0 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_314 0 30 HARD Should Be True ${result} The service (host_16,service_314) is not OK as expected -# Schedule Forced Svc Check _Module_BAM_1 ba_1 - ${result} Check Ba Status With Timeout test 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} +# Ctn Schedule Forced Svc Check _Module_BAM_1 ba_1 + ${result} Ctn Check Ba Status With Timeout test 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BEPB_DIMENSION_BV_EVENT [Documentation] bbdo_version 3 use pb_dimension_bv_event message. [Tags] broker engine protobuf bam bbdo - BAM Init + Ctn BAM Init - ${id_ba__sid} Create Ba test worst 100 100 + ${id_ba__sid} Ctn Create Ba test worst 100 100 Remove File /tmp/all_lua_event.log - Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua + Ctn Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua Connect To Database pymysql ${DBNameConf} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String DELETE FROM mod_bam_ba_groups Execute SQL String ... INSERT INTO mod_bam_ba_groups (id_ba_group, ba_group_name, ba_group_description) VALUES (574, 'virsgtr', 'description_grtmxzo') - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Wait Until Created /tmp/all_lua_event.log 30s FOR ${index} IN RANGE 10 ${grep_res} Grep File @@ -722,27 +722,27 @@ BEPB_DIMENSION_BV_EVENT Should Not Be Empty ${grep_res} event not found - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker True + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker True BEPB_DIMENSION_BA_EVENT [Documentation] bbdo_version 3 use pb_dimension_ba_event message. [Tags] broker engine protobuf bam bbdo - BAM Init + Ctn BAM Init Remove File /tmp/all_lua_event.log @{svc} Set Variable ${{ [("host_16", "service_314")] }} - ${id_ba__sid} Create Ba With Services test worst ${svc} + ${id_ba__sid} Ctn Create Ba With Services test worst ${svc} - Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua + Ctn Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua Connect To Database pymysql ${DBNameConf} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String SET FOREIGN_KEY_CHECKS=0 Execute SQL String ... UPDATE mod_bam set description='fdpgvo75', sla_month_percent_warn=1.23, sla_month_percent_crit=4.56, sla_month_duration_warn=852, sla_month_duration_crit=789, id_reporting_period=741 - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Wait Until Created /tmp/all_lua_event.log 30s FOR ${index} IN RANGE 10 ${grep_res} Grep File @@ -754,28 +754,28 @@ BEPB_DIMENSION_BA_EVENT Should Not Be Empty ${grep_res} event not found - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker True + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker True BEPB_DIMENSION_BA_BV_RELATION_EVENT [Documentation] bbdo_version 3 use pb_dimension_ba_bv_relation_event message. [Tags] broker engine protobuf bam bbdo - BAM Init + Ctn BAM Init Remove File /tmp/all_lua_event.log - Clear Db mod_bam_reporting_relations_ba_bv + Ctn Clear Db mod_bam_reporting_relations_ba_bv @{svc} Set Variable ${{ [("host_16", "service_314")] }} - ${id_ba__sid} Create Ba With Services test worst ${svc} + ${id_ba__sid} Ctn Create Ba With Services test worst ${svc} - Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua + Ctn Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua Connect To Database pymysql ${DBNameConf} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Delete All Rows From Table mod_bam_bagroup_ba_relation Execute SQL String INSERT INTO mod_bam_bagroup_ba_relation (id_ba, id_ba_group) VALUES (1, 456) - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Wait Until Created /tmp/all_lua_event.log 30s FOR ${index} IN RANGE 10 ${grep_res} Grep File @@ -792,26 +792,26 @@ BEPB_DIMENSION_BA_BV_RELATION_EVENT Should Be True len(@{query_results}) >= 1 We should have one line in mod_bam_reporting_relations_ba_bv table - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker ${True} + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker ${True} BEPB_DIMENSION_TIMEPERIOD [Documentation] use of pb_dimension_timeperiod message. [Tags] broker engine protobuf bam bbdo - BAM Init + Ctn BAM Init @{svc} Set Variable ${{ [("host_16", "service_314")] }} - ${id_ba__sid} Create Ba With Services test worst ${svc} + ${id_ba__sid} Ctn Create Ba With Services test worst ${svc} Remove File /tmp/all_lua_event.log - Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua + Ctn Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua Connect To Database pymysql ${DBNameConf} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String ... INSERT INTO timeperiod (tp_id, tp_name, tp_sunday, tp_monday, tp_tuesday, tp_wednesday, tp_thursday, tp_friday, tp_saturday) VALUES (732, "ezizae", "sunday_value", "monday_value", "tuesday_value", "wednesday_value", "thursday_value", "friday_value", "saturday_value") - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Wait Until Created /tmp/all_lua_event.log 30s FOR ${index} IN RANGE 10 ${grep_res} Grep File @@ -823,20 +823,20 @@ BEPB_DIMENSION_TIMEPERIOD Should Not Be Empty ${grep_res} event not found - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker True + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker True BEPB_DIMENSION_KPI_EVENT [Documentation] bbdo_version 3 use pb_dimension_kpi_event message. [Tags] broker engine protobuf bam bbdo - BAM Init + Ctn BAM Init @{svc} Set Variable ${{ [("host_16", "service_314")] }} - ${baid_svcid} Create Ba With Services test worst ${svc} + ${baid_svcid} Ctn Create Ba With Services test worst ${svc} - Add Boolean Kpi ${baid_svcid[0]} {host_16 service_302} {IS} {OK} False 100 + Ctn Add Boolean Kpi ${baid_svcid[0]} {host_16 service_302} {IS} {OK} False 100 - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} ${expected} Catenate (('bool test', ${baid_svcid[0]} @@ -855,25 +855,25 @@ BEPB_DIMENSION_KPI_EVENT Should Be Equal As Strings ${output} ${expected} mod_bam_reporting_kpi not filled - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker True + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker True BEPB_KPI_STATUS [Documentation] bbdo_version 3 use kpi_status message. [Tags] broker engine protobuf bam bbdo - BAM Init + Ctn BAM Init @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} + Ctn Create Ba With Services test worst ${svc} - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine ${start} Get Current Date result_format=epoch # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected Connect To Database pymysql ${DBNameConf} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -891,15 +891,15 @@ BEPB_KPI_STATUS Should Be True (${output} + 0.999) >= ${start} - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker True + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker True BEPB_BA_DURATION_EVENT [Documentation] use of pb_ba_duration_event message. [Tags] broker engine protobuf bam bbdo - BAM Init + Ctn BAM Init @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} + Ctn Create Ba With Services test worst ${svc} Connect To Database pymysql ${DBNameConf} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String DELETE FROM mod_bam_relations_ba_timeperiods @@ -907,18 +907,18 @@ BEPB_BA_DURATION_EVENT Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String DELETE FROM mod_bam_reporting_ba_events_durations - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine # KPI set to critical # as GetCurrent Date floor milliseconds to upper or lower integer, we substract 1s - ${start_event} Get Round Current Date - Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + ${start_event} Ctn Get Round Current Date + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected Sleep 2s - Process Service Check Result host_16 service_314 0 output ok for 314 - ${result} Check Service Status With Timeout host_16 service_314 0 60 HARD + Ctn Process Service Check Result host_16 service_314 0 output ok for 314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 0 60 HARD Should Be True ${result} The service (host_16,service_314) is not OK as expected ${end_event} Get Current Date result_format=epoch @@ -937,15 +937,15 @@ BEPB_BA_DURATION_EVENT Should Be True ${output[0][0]} >= ${start_event} Should Be True ${output[0][1]} <= ${end_event} - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker True + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker True BEPB_DIMENSION_BA_TIMEPERIOD_RELATION [Documentation] use of pb_dimension_ba_timeperiod_relation message. [Tags] broker engine protobuf bam bbdo - BAM Init + Ctn BAM Init @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} + Ctn Create Ba With Services test worst ${svc} Connect To Database pymysql ${DBNameConf} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String @@ -953,8 +953,8 @@ BEPB_DIMENSION_BA_TIMEPERIOD_RELATION Execute SQL String DELETE FROM mod_bam_relations_ba_timeperiods Execute SQL String INSERT INTO mod_bam_relations_ba_timeperiods (ba_id, tp_id) VALUES (1,732) - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 10 @@ -968,23 +968,23 @@ BEPB_DIMENSION_BA_TIMEPERIOD_RELATION ... len("""${output}""") > 5 ... "centreon_storage.mod_bam_reporting_relations_ba_timeperiods not updated" - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker True + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker True BEPB_DIMENSION_TRUNCATE_TABLE [Documentation] use of pb_dimension_timeperiod message. [Tags] broker engine protobuf bam bbdo - BAM Init + Ctn BAM Init @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} + Ctn Create Ba With Services test worst ${svc} Remove File /tmp/all_lua_event.log - Broker Config Log central lua trace + Ctn Broker Config Log central lua trace - Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua + Ctn Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Wait Until Created /tmp/all_lua_event.log 30s FOR ${index} IN RANGE 10 ${grep_res} Grep File @@ -1000,134 +1000,134 @@ BEPB_DIMENSION_TRUNCATE_TABLE ... "_type":393246, "category":6, "element":30, "update_started":false Should Not Be Empty ${grep_res} event not found - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker True + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker True BA_RATIO_NUMBER_BA_4_SERVICE [Documentation] With bbdo version 3.0.1, a BA of type 'ratio number' with 4 serv [Tags] broker engine bam - BAM Init + Ctn BAM Init - ${id_ba__sid} Create Ba test ratio_number 2 1 - Add Service KPI host_16 service_302 ${id_ba__sid[0]} 40 30 20 - Add Service KPI host_16 service_303 ${id_ba__sid[0]} 40 30 20 - Add Service KPI host_16 service_304 ${id_ba__sid[0]} 40 30 20 - Add Service KPI host_16 service_304 ${id_ba__sid[0]} 40 30 20 + ${id_ba__sid} Ctn Create Ba test ratio_number 2 1 + Ctn Add Service Kpi host_16 service_302 ${id_ba__sid[0]} 40 30 20 + Ctn Add Service Kpi host_16 service_303 ${id_ba__sid[0]} 40 30 20 + Ctn Add Service Kpi host_16 service_304 ${id_ba__sid[0]} 40 30 20 + Ctn Add Service Kpi host_16 service_304 ${id_ba__sid[0]} 40 30 20 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # all serv ok => ba ok - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected # one serv critical => ba warning - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - ${result} Check Service Status With Timeout host_16 service_302 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 1 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 1 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not WARNING as expected # two services critical => ba ok - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_303 ... 2 ... output critical for service_303 - ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected # all serv ok => ba ok - Process Service Check Result host_16 service_302 0 output ok for service_302 - ${result} Check Service Status With Timeout host_16 service_302 0 30 HARD + Ctn Process Service Check Result host_16 service_302 0 output ok for service_302 + ${result} Ctn Check Service Status With Timeout host_16 service_302 0 30 HARD Should Be True ${result} The service (host_16,service_302) is not OK as expected - Process Service Check Result host_16 service_303 0 output ok for service_303 - ${result} Check Service Status With Timeout host_16 service_303 0 30 HARD + Ctn Process Service Check Result host_16 service_303 0 output ok for service_303 + ${result} Ctn Check Service Status With Timeout host_16 service_303 0 30 HARD Should Be True ${result} The service (host_16,service_303) is not OK as expected - ${result} Check Ba Status With Timeout test 0 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BA_RATIO_PERCENT_BA_4_SERVICE [Documentation] With bbdo version 3.0.1, a BA of type 'ratio number' with 4 serv [Tags] broker engine bam - BAM Init + Ctn BAM Init - ${id_ba__sid} Create Ba test ratio_percent 50 25 - Add Service KPI host_16 service_302 ${id_ba__sid[0]} 40 30 20 - Add Service KPI host_16 service_303 ${id_ba__sid[0]} 40 30 20 - Add Service KPI host_16 service_304 ${id_ba__sid[0]} 40 30 20 - Add Service KPI host_16 service_305 ${id_ba__sid[0]} 40 30 20 + ${id_ba__sid} Ctn Create Ba test ratio_percent 50 25 + Ctn Add Service Kpi host_16 service_302 ${id_ba__sid[0]} 40 30 20 + Ctn Add Service Kpi host_16 service_303 ${id_ba__sid[0]} 40 30 20 + Ctn Add Service Kpi host_16 service_304 ${id_ba__sid[0]} 40 30 20 + Ctn Add Service Kpi host_16 service_305 ${id_ba__sid[0]} 40 30 20 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # all serv ok => ba ok - ${result} Check Ba Status With Timeout test 0 60 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 60 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected # one serv critical => ba warning - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - ${result} Check Service Status With Timeout host_16 service_302 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 1 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 1 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not WARNING as expected # two services critical => ba ok - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_303 ... 2 ... output critical for service_303 - ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected - ${result} Check Ba Status With Timeout test 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected # all serv ok => ba ok - Process Service Check Result host_16 service_302 0 output ok for service_302 - ${result} Check Service Status With Timeout host_16 service_302 0 30 HARD + Ctn Process Service Check Result host_16 service_302 0 output ok for service_302 + ${result} Ctn Check Service Status With Timeout host_16 service_302 0 30 HARD Should Be True ${result} The service (host_16,service_302) is not OK as expected - Process Service Check Result host_16 service_303 0 output ok for service_303 - ${result} Check Service Status With Timeout host_16 service_303 0 30 HARD + Ctn Process Service Check Result host_16 service_303 0 output ok for service_303 + ${result} Ctn Check Service Status With Timeout host_16 service_303 0 30 HARD Should Be True ${result} The service (host_16,service_303) is not OK as expected - ${result} Check Ba Status With Timeout test 0 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout test 0 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker *** Keywords *** -BAM Setup - Stop Processes +Ctn BAM Setup + Ctn Stop Processes Connect To Database pymysql ${DBName} ${DBUserRoot} ${DBPassRoot} ${DBHost} ${DBPort} Execute SQL String SET GLOBAL FOREIGN_KEY_CHECKS=0 Execute SQL String DELETE FROM mod_bam_reporting_kpi @@ -1137,23 +1137,23 @@ BAM Setup Execute SQL String ALTER TABLE mod_bam_reporting_ba_events AUTO_INCREMENT = 1 Execute SQL String SET GLOBAL FOREIGN_KEY_CHECKS=1 -BAM Init - Clear Commands Status - Clear Retention - Clear Db Conf mod_bam - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Broker Config Log central sql trace - Broker Config Log central config trace - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} +Ctn BAM Init + Ctn Clear Commands Status + Ctn Clear Retention + Ctn Clear Db Conf mod_bam + Ctn Config Broker module + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central config trace + Ctn Broker Config Source Log central 1 + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} # This is to avoid parasite status. - Set Services Passive ${0} service_30. + Ctn Set Services Passive ${0} service_30. - Config Broker Sql Output central unified_sql - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central diff --git a/tests/bam/boolean_rules.robot b/tests/bam/boolean_rules.robot index b407c8fdc87..fe6e834b791 100644 --- a/tests/bam/boolean_rules.robot +++ b/tests/bam/boolean_rules.robot @@ -3,521 +3,521 @@ Documentation Centreon Broker and BAM with bbdo version 3.0.1 on boolean r Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup BAM Setup -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn BAM Setup +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BABOO [Documentation] With bbdo version 3.0.1, a BA of type 'worst' with 2 child services and another BA of type impact with a boolean rule returning if one of its two services are critical are created. These two BA are built from the same services and should have a similar behavior [Tags] broker engine bam boolean_expression - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central core error - Broker Config Log central bam trace - Broker Config Log central sql error - Broker Config Flush Log central 0 - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central - Set Services Passive ${0} service_302 - Set Services Passive ${0} service_303 - - ${id_ba_worst__sid} Create Ba ba-worst worst 70 80 - Add Service KPI host_16 service_302 ${id_ba_worst__sid[0]} 40 30 20 - Add Service KPI host_16 service_303 ${id_ba_worst__sid[0]} 40 30 20 - - ${id_boolean_ba__sid} Create Ba boolean-ba impact 70 80 - Add Boolean Kpi + Ctn Clear Commands Status + Ctn Clear Retention + Ctn Config Broker module + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central core error + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Source Log central 1 + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central + Ctn Set Services Passive ${0} service_302 + Ctn Set Services Passive ${0} service_303 + + ${id_ba_worst__sid} Ctn Create Ba ba-worst worst 70 80 + Ctn Add Service Kpi host_16 service_302 ${id_ba_worst__sid[0]} 40 30 20 + Ctn Add Service Kpi host_16 service_303 ${id_ba_worst__sid[0]} 40 30 20 + + ${id_boolean_ba__sid} Ctn Create Ba boolean-ba impact 70 80 + Ctn Add Boolean Kpi ... ${id_boolean_ba__sid[0]} ... {host_16 service_302} {IS} {CRITICAL} {OR} {host_16 service_303} {IS} {CRITICAL} ... True ... 100 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # 393 is set to ok. - Process Service Check Result host_16 service_303 0 output ok for service_303 + Ctn Process Service Check Result host_16 service_303 0 output ok for service_303 FOR ${i} IN RANGE 10 Log To Console @@@@@@@@@@@@@@ Step ${i} @@@@@@@@@@@@@@ # 302 is set to critical => the two ba become critical - Process Service Result Hard host_16 service_302 2 output critical for service_302 + Ctn Process Service Result Hard host_16 service_302 2 output critical for service_302 - ${result} Check Service Resource Status With Timeout host_16 service_302 2 30 HARD + ${result} Ctn Check Service Resource Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16:service_302) should be CRITICAL. - ${result} Check Ba Status With Timeout ba-worst 2 30 - Dump Ba On Error ${result} ${id_ba_worst__sid[0]} + ${result} Ctn Check Ba Status With Timeout ba-worst 2 30 + Ctn Dump Ba On Error ${result} ${id_ba_worst__sid[0]} Should Be True ${result} The 'ba-worst' BA is not CRITICAL as expected - ${result} Check Ba Status With Timeout boolean-ba 2 30 - Dump Ba On Error ${result} ${id_boolean_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 + Ctn Dump Ba On Error ${result} ${id_boolean_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not CRITICAL as expected - Process Service Check Result host_16 service_302 0 output ok for service_302 - ${result} Check Ba Status With Timeout ba-worst 0 30 - Dump Ba On Error ${result} ${id_ba_worst__sid[0]} + Ctn Process Service Check Result host_16 service_302 0 output ok for service_302 + ${result} Ctn Check Ba Status With Timeout ba-worst 0 30 + Ctn Dump Ba On Error ${result} ${id_ba_worst__sid[0]} Should Be True ${result} The 'ba-worst' BA is not OK as expected - ${result} Check Service Resource Status With Timeout host_16 service_302 0 30 HARD + ${result} Ctn Check Service Resource Status With Timeout host_16 service_302 0 30 HARD Should Be True ${result} The service (host_16:service_302) should be OK. - ${result} Check Ba Status With Timeout boolean-ba 0 30 - Dump Ba On Error ${result} ${id_boolean_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 0 30 + Ctn Dump Ba On Error ${result} ${id_boolean_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not OK as expected END - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BABOOOR [Documentation] With bbdo version 3.0.1, a BA of type 'worst' with 2 child services and another BA of type impact with a boolean rule returning if one of its two services are critical are created. These two BA are built from the same services and should have a similar behavior [Tags] broker engine bam boolean_expression - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central core error - Broker Config Log central bam trace - Broker Config Log central sql error - Broker Config Flush Log central 0 - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central - Set Services Passive ${0} service_302 - Set Services Passive ${0} service_303 - - ${id_ba__sid} Create Ba boolean-ba impact 70 80 - Add Boolean Kpi + Ctn Clear Commands Status + Ctn Clear Retention + Ctn Config Broker module + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central core error + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Source Log central 1 + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central + Ctn Set Services Passive ${0} service_302 + Ctn Set Services Passive ${0} service_303 + + ${id_ba__sid} Ctn Create Ba boolean-ba impact 70 80 + Ctn Add Boolean Kpi ... ${id_ba__sid[0]} ... {host_16 service_302} {IS} {CRITICAL} {OR} {host_16 service_303} {IS} {CRITICAL} ... True ... 100 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # 303 is unknown but since the boolean operator is OR, if 302 result is true, we should have already a result. # 302 is set to critical => the two ba become critical - Process Service Result Hard host_16 service_302 2 output critical for service_302 + Ctn Process Service Result Hard host_16 service_302 2 output critical for service_302 - ${result} Check Ba Status With Timeout boolean-ba 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not CRITICAL as expected - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BABOOAND [Documentation] With bbdo version 3.0.1, a BA of type impact with a boolean rule returning if both of its two services are ok is created. When one condition is false, the and operator returns false as a result even if the other child is unknown. [Tags] broker engine bam boolean_expression - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central core error - Broker Config Log central bam trace - Broker Config Log central sql error - Broker Config Flush Log central 0 - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central - Set Services Passive ${0} service_302 - Set Services Passive ${0} service_303 - - ${id_ba__sid} Create Ba boolean-ba impact 70 80 - Add Boolean Kpi + Ctn Clear Commands Status + Ctn Clear Retention + Ctn Config Broker module + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central core error + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Source Log central 1 + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central + Ctn Set Services Passive ${0} service_302 + Ctn Set Services Passive ${0} service_303 + + ${id_ba__sid} Ctn Create Ba boolean-ba impact 70 80 + Ctn Add Boolean Kpi ... ${id_ba__sid[0]} ... {host_16 service_302} {IS} {OK} {AND} {host_16 service_303} {IS} {OK} ... False ... 100 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # 303 is unknown but since the boolean operator is AND, if 302 result is false, we should have already a result. # 302 is set to critical => the two ba become critical - Process Service Result Hard host_16 service_302 2 output critical for service_302 + Ctn Process Service Result Hard host_16 service_302 2 output critical for service_302 - ${result} Check Ba Status With Timeout boolean-ba 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not CRITICAL as expected - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BABOOORREL [Documentation] With bbdo version 3.0.1, a BA of type impact with a boolean rule returning if one of its two services is ok is created. One of the two underlying services must change of state to change the ba state. For this purpose, we change the service state and reload cbd. So the rule is something like "False OR True" which is equal to True. And to pass from True to False, we change the second service. [Tags] broker engine bam boolean_expression - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central core error - Broker Config Log central bam trace - Broker Config Log central sql error - Broker Config Flush Log central 0 - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central - Set Services Passive ${0} service_302 - Set Services Passive ${0} service_303 - Set Services Passive ${0} service_304 - - ${id_ba__sid} Create Ba boolean-ba impact 70 80 - ${id_bool} Add Boolean Kpi + Ctn Clear Commands Status + Ctn Clear Retention + Ctn Config Broker module + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central core error + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Source Log central 1 + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central + Ctn Set Services Passive ${0} service_302 + Ctn Set Services Passive ${0} service_303 + Ctn Set Services Passive ${0} service_304 + + ${id_ba__sid} Ctn Create Ba boolean-ba impact 70 80 + ${id_bool} Ctn Add Boolean Kpi ... ${id_ba__sid[0]} ... {host_16 service_302} {IS} {OK} {OR} {host_16 service_303} {IS} {OK} ... False ... 100 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # 302 is set to critical => {host_16 service_302} {IS} {OK} is then False - Process Service Result Hard host_16 service_302 2 output critical for service_302 - ${result} Check Service Status With Timeout host_16 service_302 2 30 HARD + Ctn Process Service Result Hard host_16 service_302 2 output critical for service_302 + ${result} Ctn Check Service Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL/HARD as expected # 303 is set to critical => {host_16 service_303} {IS} {OK} is then False - Process Service Result Hard host_16 service_303 2 output critical for service_303 - ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD + Ctn Process Service Result Hard host_16 service_303 2 output critical for service_303 + ${result} Ctn Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL/HARD as expected # 304 is set to ok => {host_16 service_304} {IS} {OK} is then True - Process Service Result Hard host_16 service_304 0 output ok for service_304 - ${result} Check Service Status With Timeout host_16 service_304 0 30 HARD + Ctn Process Service Result Hard host_16 service_304 0 output ok for service_304 + ${result} Ctn Check Service Status With Timeout host_16 service_304 0 30 HARD Should Be True ${result} The service (host_16,service_304) is not OK/HARD as expected - ${result} Check Ba Status With Timeout boolean-ba 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not CRITICAL as expected - Update Boolean Rule + Ctn Update Boolean Rule ... ${id_bool} ... {host_16 service_302} {IS} {OK} {OR} {host_16 service_304} {IS} {OK} - Reload Engine - Reload Broker + Ctn Reload Engine + Ctn Reload Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - Process Service Result Hard host_16 service_302 2 output ok for service_302 - Process Service Result Hard host_16 service_304 0 output ok for service_304 + Ctn Process Service Result Hard host_16 service_302 2 output ok for service_302 + Ctn Process Service Result Hard host_16 service_304 0 output ok for service_304 - ${result} Check Ba Status With Timeout boolean-ba 0 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 0 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not OK as expected - Update Boolean Rule + Ctn Update Boolean Rule ... ${id_bool} ... {host_16 service_302} {IS} {OK} {OR} {host_16 service_303} {IS} {OK} - Reload Engine - Reload Broker + Ctn Reload Engine + Ctn Reload Broker - Process Service Result Hard host_16 service_302 2 output critical for service_302 - Process Service Result Hard host_16 service_303 2 output critical for service_303 + Ctn Process Service Result Hard host_16 service_302 2 output critical for service_302 + Ctn Process Service Result Hard host_16 service_303 2 output critical for service_303 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Ba Status With Timeout boolean-ba 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not CRITICAL as expected - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BABOOCOMPL [Documentation] With bbdo version 3.0.1, a BA of type impact with a complex boolean rule is configured. We check its correct behaviour following service updates. [Tags] broker engine bam boolean_expression - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central core error - Broker Config Log central bam trace - Broker Config Log central sql error - Broker Config Flush Log central 0 - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central + Ctn Clear Commands Status + Ctn Clear Retention + Ctn Config Broker module + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central core error + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Source Log central 1 + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central # Services 1 to 21 are passive now. FOR ${i} IN RANGE ${1} ${21} - Set Services Passive ${0} service_${i} + Ctn Set Services Passive ${0} service_${i} END - ${id_ba__sid} Create Ba boolean-ba impact 70 80 - ${id_bool} Add Boolean Kpi + ${id_ba__sid} Ctn Create Ba boolean-ba impact 70 80 + ${id_bool} Ctn Add Boolean Kpi ... ${id_ba__sid[0]} ... ({host_1 service_1} {IS} {OK} {OR} {host_1 service_2} {IS} {OK}) {AND} ({host_1 service_3} {IS} {OK} {OR} {host_1 service_4} {IS} {OK}) {AND} ({host_1 service_5} {IS} {OK} {OR} {host_1 service_6} {IS} {OK}) {AND} ({host_1 service_7} {IS} {OK} {OR} {host_1 service_8} {IS} {OK}) {AND} ({host_1 service_9} {IS} {OK} {OR} {host_1 service_10} {IS} {OK}) {AND} ({host_1 service_11} {IS} {OK} {OR} {host_1 service_12} {IS} {OK}) {AND} ({host_1 service_13} {IS} {OK} {OR} {host_1 service_14} {IS} {OK}) {AND} ({host_1 service_15} {IS} {OK} {OR} {host_1 service_16} {IS} {OK}) {AND} ({host_1 service_17} {IS} {OK} {OR} {host_1 service_18} {IS} {OK}) {AND} ({host_1 service_19} {IS} {OK} {OR} {host_1 service_20} {IS} {OK}) ... False ... 100 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. FOR ${i} IN RANGE ${1} ${21} - Process Service Result Hard host_1 service_${i} 2 output critical for service_${i} + Ctn Process Service Result Hard host_1 service_${i} 2 output critical for service_${i} END FOR ${i} IN RANGE ${1} ${21} ${2} - ${result} Check Ba Status With Timeout boolean-ba 2 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} Step${i}: The 'boolean-ba' BA is not CRITICAL as expected - Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} + Ctn Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} END - ${result} Check Ba Status With Timeout boolean-ba 0 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 0 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not OK as expected - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BABOOCOMPL_RESTART [Documentation] With bbdo version 3.0.1, a BA of type impact with a complex boolean rule is configured. We check its correct behaviour following service updates. [Tags] broker engine bam boolean_expression MON-34246 - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central core error - Broker Config Log central bam trace - Broker Config Log central sql error - Broker Config Flush Log central 0 - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central + Ctn Clear Commands Status + Ctn Clear Retention + Ctn Config Broker module + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central core error + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Source Log central 1 + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central # Services 1 to 21 are passive now. FOR ${i} IN RANGE ${1} ${21} - Set Services Passive ${0} service_${i} + Ctn Set Services Passive ${0} service_${i} END - ${id_ba__sid} Create Ba boolean-ba impact 70 80 - ${id_bool} Add Boolean Kpi + ${id_ba__sid} Ctn Create Ba boolean-ba impact 70 80 + ${id_bool} Ctn Add Boolean Kpi ... ${id_ba__sid[0]} ... ({host_1 service_1} {IS} {OK} {OR} {host_1 service_2} {IS} {OK}) {AND} ({host_1 service_3} {IS} {OK} {OR} {host_1 service_4} {IS} {OK}) {AND} ({host_1 service_5} {IS} {OK} {OR} {host_1 service_6} {IS} {OK}) {AND} ({host_1 service_7} {IS} {OK} {OR} {host_1 service_8} {IS} {OK}) {AND} ({host_1 service_9} {IS} {OK} {OR} {host_1 service_10} {IS} {OK}) {AND} ({host_1 service_11} {IS} {OK} {OR} {host_1 service_12} {IS} {OK}) {AND} ({host_1 service_13} {IS} {OK} {OR} {host_1 service_14} {IS} {OK}) {AND} ({host_1 service_15} {IS} {OK} {OR} {host_1 service_16} {IS} {OK}) {AND} ({host_1 service_17} {IS} {OK} {OR} {host_1 service_18} {IS} {OK}) {AND} ({host_1 service_19} {IS} {OK} {OR} {host_1 service_20} {IS} {OK}) ... False ... 100 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. Log To Console Services from 1 to 20 are set to CRITICAL. FOR ${i} IN RANGE ${1} ${21} - Process Service Result Hard host_1 service_${i} 2 output critical for service_${i} + Ctn Process Service Result Hard host_1 service_${i} 2 output critical for service_${i} END Log To Console Check services from 1 to 20 are CRITICAL. FOR ${i} IN RANGE ${1} ${21} - ${result} Check Service Resource Status With Timeout host_1 service_${i} 2 30 HARD + ${result} Ctn Check Service Resource Status With Timeout host_1 service_${i} 2 30 HARD Should Be True ${result} The service (host_1:service_${i}) should be CRITICAL. END Log To Console Services from 1 to 14 by 2 are set to OK. FOR ${i} IN RANGE ${1} ${15} ${2} - Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} + Ctn Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} END Log To Console Check services from 1 to 14 by 2 are OK FOR ${i} IN RANGE ${1} ${15} ${2} - ${result} Check Service Resource Status With Timeout host_1 service_${i} 0 30 HARD + ${result} Ctn Check Service Resource Status With Timeout host_1 service_${i} 0 30 HARD Should Be True ${result} The service (host_1:service_${i}) should be OK. END Log To Console Check the BA is still CRITICAL. - ${result} Check Ba Status With Timeout boolean-ba 2 30 + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 Should Be True ${result} Step${i}: The 'boolean-ba' BA is not CRITICAL as expected Log To Console Services from 15 to 20 by 2 are set OK. The BA must stay critical. ... And in each step, Broker is restarted to check that the BA states ... did not change during the restart. FOR ${i} IN RANGE ${15} ${21} ${2} - Remove Files /tmp/ba${id_ba__sid[0]}_*.dot - ${result} Check Ba Status With Timeout boolean-ba 2 30 - Broker Get Ba 51001 ${id_ba__sid[0]} /tmp/ba${id_ba__sid[0]}_1.dot + Remove Files /tmp/ba${id_ba__sid[0]}_*.dot + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 + Ctn Broker Get Ba 51001 ${id_ba__sid[0]} /tmp/ba${id_ba__sid[0]}_1.dot Should Be True ${result} Step${i}: The 'boolean-ba' BA is not CRITICAL as expected ${start} Get Current Date - # A restart of cbd should not alter the boolean rules content. - Restart Broker - ${content} Create List Inherited downtimes and BA states restored - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} It seems that no cache has been restored into BAM. + # A restart of cbd should not alter the boolean rules content. + Ctn Restart Broker + ${content} Create List Inherited downtimes and BA states restored + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 + Should Be True ${result} It seems that no cache has been restored into BAM. - Broker Get Ba 51001 ${id_ba__sid[0]} /tmp/ba${id_ba__sid[0]}_2.dot + Ctn Broker Get Ba 51001 ${id_ba__sid[0]} /tmp/ba${id_ba__sid[0]}_2.dot - Wait Until Created /tmp/ba${id_ba__sid[0]}_2.dot - ${result} Compare Dot Files /tmp/ba${id_ba__sid[0]}_1.dot /tmp/ba${id_ba__sid[0]}_2.dot + Wait Until Created /tmp/ba${id_ba__sid[0]}_2.dot + ${result} Ctn Compare Dot Files /tmp/ba${id_ba__sid[0]}_1.dot /tmp/ba${id_ba__sid[0]}_2.dot Should Be True ${result} Known and values in files /tmp/ba${id_ba__sid[0]}_1.dot and /tmp/ba${id_ba__sid[0]}_2.dot should be the same. - Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} - ${result} Check Service Resource Status With Timeout host_1 service_${i} 0 30 HARD + Ctn Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} + ${result} Ctn Check Service Resource Status With Timeout host_1 service_${i} 0 30 HARD Should Be True ${result} The service (host_16:service_${i}) should be OK. END - ${result} Check Ba Status With Timeout boolean-ba 0 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 0 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not OK as expected - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker BABOOCOMPL_RELOAD [Documentation] With bbdo version 3.0.1, a BA of type impact with a complex boolean rule is configured. We check its correct behaviour following service updates. [Tags] broker engine bam boolean_expression MON-34246 - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central core error - Broker Config Log central bam trace - Broker Config Log central sql error - Broker Config Flush Log central 0 - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central + Ctn Clear Commands Status + Ctn Clear Retention + Ctn Config Broker module + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central core error + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Source Log central 1 + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central # Services 1 to 21 are passive now. FOR ${i} IN RANGE ${1} ${21} - Set Services Passive ${0} service_${i} + Ctn Set Services Passive ${0} service_${i} END - ${id_ba__sid} Create Ba boolean-ba impact 70 80 - ${id_bool} Add Boolean Kpi + ${id_ba__sid} Ctn Create Ba boolean-ba impact 70 80 + ${id_bool} Ctn Add Boolean Kpi ... ${id_ba__sid[0]} ... ({host_1 service_1} {IS} {OK} {OR} {host_1 service_2} {IS} {OK}) {AND} ({host_1 service_3} {IS} {OK} {OR} {host_1 service_4} {IS} {OK}) {AND} ({host_1 service_5} {IS} {OK} {OR} {host_1 service_6} {IS} {OK}) {AND} ({host_1 service_7} {IS} {OK} {OR} {host_1 service_8} {IS} {OK}) {AND} ({host_1 service_9} {IS} {OK} {OR} {host_1 service_10} {IS} {OK}) {AND} ({host_1 service_11} {IS} {OK} {OR} {host_1 service_12} {IS} {OK}) {AND} ({host_1 service_13} {IS} {OK} {OR} {host_1 service_14} {IS} {OK}) {AND} ({host_1 service_15} {IS} {OK} {OR} {host_1 service_16} {IS} {OK}) {AND} ({host_1 service_17} {IS} {OK} {OR} {host_1 service_18} {IS} {OK}) {AND} ({host_1 service_19} {IS} {OK} {OR} {host_1 service_20} {IS} {OK}) ... False ... 100 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. Log To Console Services from 1 to 20 are set to CRITICAL. FOR ${i} IN RANGE ${1} ${21} - Process Service Result Hard host_1 service_${i} 2 output critical for service_${i} + Ctn Process Service Result Hard host_1 service_${i} 2 output critical for service_${i} END Log To Console Check services from 1 to 20 are CRITICAL. FOR ${i} IN RANGE ${1} ${21} - ${result} Check Service Resource Status With Timeout host_1 service_${i} 2 30 HARD + ${result} Ctn Check Service Resource Status With Timeout host_1 service_${i} 2 30 HARD Should Be True ${result} The service (host_1:service_${i}) should be CRITICAL. END Log To Console Services from 1 to 14 by 2 are set to OK. FOR ${i} IN RANGE ${1} ${15} ${2} - Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} + Ctn Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} END Log To Console Check services from 1 to 14 by 2 are OK FOR ${i} IN RANGE ${1} ${15} ${2} - ${result} Check Service Resource Status With Timeout host_1 service_${i} 0 30 HARD + ${result} Ctn Check Service Resource Status With Timeout host_1 service_${i} 0 30 HARD Should Be True ${result} The service (host_1:service_${i}) should be OK. END Log To Console Check the BA is still CRITICAL. - ${result} Check Ba Status With Timeout boolean-ba 2 30 + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 Should Be True ${result} Step${i}: The 'boolean-ba' BA is not CRITICAL as expected Log To Console Services from 15 to 20 by 2 are set OK. The BA must stay critical. ... And in each step, Broker is restarted to check that the BA states ... did not change during the restart. FOR ${i} IN RANGE ${15} ${21} ${2} - Remove Files /tmp/ba${id_ba__sid[0]}_*.dot - ${result} Check Ba Status With Timeout boolean-ba 2 30 - Broker Get Ba 51001 ${id_ba__sid[0]} /tmp/ba${id_ba__sid[0]}_1.dot + Remove Files /tmp/ba${id_ba__sid[0]}_*.dot + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 + Ctn Broker Get Ba 51001 ${id_ba__sid[0]} /tmp/ba${id_ba__sid[0]}_1.dot Should Be True ${result} Step${i}: The 'boolean-ba' BA is not CRITICAL as expected ${start} Get Current Date - # A restart of cbd should not alter the boolean rules content. - Reload Broker - ${content} Create List Inherited downtimes and BA states restored - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} It seems that no cache has been restored into BAM. + # A restart of cbd should not alter the boolean rules content. + Ctn Reload Broker + ${content} Create List Inherited downtimes and BA states restored + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 + Should Be True ${result} It seems that no cache has been restored into BAM. - Broker Get Ba 51001 ${id_ba__sid[0]} /tmp/ba${id_ba__sid[0]}_2.dot + Ctn Broker Get Ba 51001 ${id_ba__sid[0]} /tmp/ba${id_ba__sid[0]}_2.dot - Wait Until Created /tmp/ba${id_ba__sid[0]}_2.dot - ${result} Compare Dot Files /tmp/ba${id_ba__sid[0]}_1.dot /tmp/ba${id_ba__sid[0]}_2.dot + Wait Until Created /tmp/ba${id_ba__sid[0]}_2.dot + ${result} Ctn Compare Dot Files /tmp/ba${id_ba__sid[0]}_1.dot /tmp/ba${id_ba__sid[0]}_2.dot Should Be True ${result} Known and values in files /tmp/ba${id_ba__sid[0]}_1.dot and /tmp/ba${id_ba__sid[0]}_2.dot should be the same. - Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} - ${result} Check Service Resource Status With Timeout host_1 service_${i} 0 30 HARD + Ctn Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} + ${result} Ctn Check Service Resource Status With Timeout host_1 service_${i} 0 30 HARD Should Be True ${result} The service (host_16:service_${i}) should be OK. END - ${result} Check Ba Status With Timeout boolean-ba 0 30 - Dump Ba On Error ${result} ${id_ba__sid[0]} + ${result} Ctn Check Ba Status With Timeout boolean-ba 0 30 + Ctn Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not OK as expected - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker *** Keywords *** -BAM Setup - Stop Processes +Ctn BAM Setup + Ctn Stop Processes Connect To Database pymysql ${DBName} ${DBUserRoot} ${DBPassRoot} ${DBHost} ${DBPort} Execute SQL String SET GLOBAL FOREIGN_KEY_CHECKS=0 Execute SQL String DELETE FROM mod_bam_reporting_kpi diff --git a/tests/bam/inherited_downtime.robot b/tests/bam/inherited_downtime.robot index 1f6b14d6fcb..f4d9886bf21 100644 --- a/tests/bam/inherited_downtime.robot +++ b/tests/bam/inherited_downtime.robot @@ -3,366 +3,366 @@ Documentation Centreon Broker and BAM Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup BAM Setup -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn BAM Setup +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BEBAMIDT1 [Documentation] A BA of type 'worst' with one service is configured. The BA is in critical state, because of its service. Then we set a downtime on this last one. An inherited downtime is set to the BA. The downtime is removed from the service, the inherited downtime is then deleted. [Tags] broker downtime engine bam - Clear Commands Status - Config Broker module - Config Broker central - Broker Config Log central bam trace - Config Broker rrd - Config Engine ${1} + Ctn Clear Commands Status + Ctn Config Broker module + Ctn Config Broker central + Ctn Broker Config Log central bam trace + Ctn Config Broker rrd + Ctn Config Engine ${1} - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} - Add Bam Config To Broker central + Ctn Create Ba With Services test worst ${svc} + Ctn Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1} Get Command Id 314 + ${cmd_1} Ctn Get Command Id 314 Log To Console service_314 has command id ${cmd_1} - Set Command Status ${cmd_1} 2 - Start Broker + Ctn Set Command Status ${cmd_1} 2 + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for Engine to be ready ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... A message about checking for external commands should have raised. # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for service_314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + Ctn Process Service Result Hard host_16 service_314 2 output critical for service_314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected # A downtime is put on service_314 - Schedule Service Downtime host_16 service_314 3600 - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Ctn Schedule Service Downtime host_16 service_314 3600 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 Should Be True ${result} The BA ba_1 is not in downtime as it should # The downtime is deleted - Delete Service Downtime host_16 service_314 - ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + Ctn Delete Service Downtime host_16 service_314 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 0 60 Should Be True ${result} The service (host_16, service_314) is in downtime and should not. - ${result} Check Downtimes With Timeout 0 60 + ${result} Ctn Check Downtimes With Timeout 0 60 Should Be True ${result} We should have no more running downtimes - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime as it should not - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEBAMIDT2 [Documentation] A BA of type 'worst' with one service is configured. The BA is in critical state, because of its service. Then we set a downtime on this last one. An inherited downtime is set to the BA. Engine is restarted. Broker is restarted. The two downtimes are still there with no duplicates. The downtime is removed from the service, the inherited downtime is then deleted. [Tags] broker downtime engine bam start stop - Clear Commands Status - Config Broker module - Config Broker central - Broker Config Log central bam trace - Config Broker rrd - Config Engine ${1} + Ctn Clear Commands Status + Ctn Config Broker module + Ctn Config Broker central + Ctn Broker Config Log central bam trace + Ctn Config Broker rrd + Ctn Config Engine ${1} - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} - Add Bam Config To Broker central + Ctn Create Ba With Services test worst ${svc} + Ctn Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1} Get Command Id 314 + ${cmd_1} Ctn Get Command Id 314 Log To Console service_314 has command id ${cmd_1} - Set Command Status ${cmd_1} 2 - Start Broker + Ctn Set Command Status ${cmd_1} 2 + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for Engine to be ready ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... A message about checking for external commands should have raised. # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for service_314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 + Ctn Process Service Result Hard host_16 service_314 2 output critical for service_314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected # A downtime is put on service_314 - Schedule Service Downtime host_16 service_314 3600 - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Ctn Schedule Service Downtime host_16 service_314 3600 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - ${result} Check Downtimes With Timeout 2 60 + ${result} Ctn Check Downtimes With Timeout 2 60 Should Be True ${result} We should have one running downtime - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 Should Be True ${result} The BA ba_1 is not in downtime as it should FOR ${i} IN RANGE 2 # Engine is restarted - Stop Engine + Ctn Stop engine ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for Engine to be ready ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... A message about checking for external commands should have raised. # Broker is restarted Log To Console Broker is stopped (step ${i}) - Kindly Stop Broker + Ctn Kindly Stop Broker Log To Console Broker is started - Start Broker + Ctn Start Broker END # There are still two downtimes: the one on the ba and the one on the kpi. - ${result} Check Downtimes With Timeout 2 60 + ${result} Ctn Check Downtimes With Timeout 2 60 Should Be True ${result} We should have two downtimes # The downtime is deleted - Delete Service Downtime host_16 service_314 - ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + Ctn Delete Service Downtime host_16 service_314 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 0 60 Should Be True ${result} The service (host_16, service_314) is in downtime but should not. - ${result} Check Downtimes With Timeout 0 60 + ${result} Ctn Check Downtimes With Timeout 0 60 Should Be True ${result} We should have no more downtime - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime as it should not Log To Console Broker is stopped (end of BEBAMIDT2) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEBAMIGNDT1 [Documentation] A BA of type 'worst' with two services is configured. The downtime policy on this ba is "Ignore the indicator in the calculation". The BA is in critical state, because of the second critical service. Then we apply two downtimes on this last one. The BA state is ok because of the policy on indicators. A first downtime is cancelled, the BA is still OK, but when the second downtime is cancelled, the BA should be CRITICAL. [Tags] broker downtime engine bam - Clear Commands Status - Config Broker module - Config Broker central - Broker Config Log central bam trace - Broker Config Log central sql trace - Broker Config Source Log central true - Broker Config Flush Log module0 0 - Broker Config Log module0 neb trace - Config Broker rrd - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_level_functions trace - Engine Config Set Value ${0} log_flush_period 0 True - - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Clear Commands Status + Ctn Config Broker module + Ctn Config Broker central + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Source Log central true + Ctn Broker Config Flush Log module0 0 + Ctn Broker Config Log module0 neb trace + Ctn Config Broker rrd + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_level_functions trace + Ctn Engine Config Set Value ${0} log_flush_period 0 True + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} ignore - Add Bam Config To Broker central + Ctn Create Ba With Services test worst ${svc} ignore + Ctn Add Bam Config To Broker central # Command of service_313 is set to ok - ${cmd_1} Get Command Id 313 + ${cmd_1} Ctn Get Command Id 313 Log To Console service_313 has command id ${cmd_1} - Set Command Status ${cmd_1} 0 + Ctn Set Command Status ${cmd_1} 0 # Command of service_314 is set to critical - ${cmd_2} Get Command Id 314 + ${cmd_2} Ctn Get Command Id 314 Log To Console service_314 has command id ${cmd_2} - Set Command Status ${cmd_2} 2 + Ctn Set Command Status ${cmd_2} 2 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok - Process Service Result Hard host_16 service_313 0 output critical for service_313 - ${result} Check Service Status With Timeout host_16 service_313 0 60 + Ctn Process Service Result Hard host_16 service_313 0 output critical for service_313 + ${result} Ctn Check Service Status With Timeout host_16 service_313 0 60 Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for service_314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 + Ctn Process Service Result Hard host_16 service_314 2 output critical for service_314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected Log To Console The BA is critical. # Two downtimes are applied on service_314 - Schedule Service Downtime host_16 service_314 3600 - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Ctn Schedule Service Downtime host_16 service_314 3600 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log To Console One downtime applied to service_314. - Schedule Service Downtime host_16 service_314 1800 - ${result} Check Service Downtime With Timeout host_16 service_314 2 60 + Ctn Schedule Service Downtime host_16 service_314 1800 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log To Console Two downtimes applied to service_314. - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime but should not Log To Console The BA is configured to ignore kpis in downtime - ${result} Check Ba Status With Timeout test 0 60 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. Log To Console The BA is OK, since the critical service is in downtime. # The first downtime is deleted - Delete Service Downtime host_16 service_314 + Ctn Delete Service Downtime host_16 service_314 - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should Log To Console Still one downtime applied to service_314. - ${result} Check Downtimes With Timeout 1 60 + ${result} Ctn Check Downtimes With Timeout 1 60 Should Be True ${result} We should have one downtime - ${result} Check Ba Status With Timeout test 0 60 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. Log To Console The BA is still OK # The second downtime is deleted - Delete Service Downtime host_16 service_314 + Ctn Delete Service Downtime host_16 service_314 - ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 0 60 Should Be True ${result} The service (host_16, service_314) does not contain 0 downtime as it should Log To Console No more downtime applied to service_314. - ${result} Check Downtimes With Timeout 0 60 + ${result} Ctn Check Downtimes With Timeout 0 60 Should Be True ${result} We should have no more running downtimes - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The critical service is no more in downtime, the BA should be critical. Log To Console The BA is now critical (no more downtime) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEBAMIGNDT2 [Documentation] A BA of type 'worst' with two services is configured. The downtime policy on this ba is "Ignore the indicator in the calculation". The BA is in critical state, because of the second critical service. Then we apply two downtimes on this last one. The BA state is ok because of the policy on indicators. The first downtime reaches its end, the BA is still OK, but when the second downtime reaches its end, the BA should be CRITICAL. [Tags] broker downtime engine bam - Clear Commands Status - Config Broker module - Config Broker central - Broker Config Log central core error - Broker Config Log central bam trace - Config Broker rrd - Config Engine ${1} + Ctn Clear Commands Status + Ctn Config Broker module + Ctn Config Broker central + Ctn Broker Config Log central core error + Ctn Broker Config Log central bam trace + Ctn Config Broker rrd + Ctn Config Engine ${1} - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} ignore - Add Bam Config To Broker central + Ctn Create Ba With Services test worst ${svc} ignore + Ctn Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1} Get Command Id 313 + ${cmd_1} Ctn Get Command Id 313 Log To Console service_314 has command id ${cmd_1} - Set Command Status ${cmd_1} 0 - ${cmd_2} Get Command Id 314 + Ctn Set Command Status ${cmd_1} 0 + ${cmd_2} Ctn Get Command Id 314 Log To Console service_314 has command id ${cmd_2} - Set Command Status ${cmd_2} 2 - Start Broker + Ctn Set Command Status ${cmd_2} 2 + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok - Process Service Result Hard host_16 service_313 0 output critical for service_313 - ${result} Check Service Status With Timeout host_16 service_313 0 60 + Ctn Process Service Result Hard host_16 service_313 0 output critical for service_313 + ${result} Ctn Check Service Status With Timeout host_16 service_313 0 60 Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected Log To Console The BA is critical. # Two downtimes are applied on service_314 - Schedule Service Downtime host_16 service_314 60 - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Ctn Schedule Service Downtime host_16 service_314 60 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log To Console One downtime applied to service_314. - Schedule Service Downtime host_16 service_314 30 - ${result} Check Service Downtime With Timeout host_16 service_314 2 60 + Ctn Schedule Service Downtime host_16 service_314 30 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log To Console Two downtimes applied to service_314. - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime but should not Log To Console The BA is configured to ignore kpis in downtime - ${result} Check Ba Status With Timeout test 0 60 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. Log To Console The BA is OK, since the critical service is in downtime. # The first downtime should reach its end Log To Console After 30s, the first downtime should be finished. - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should Log To Console Still one downtime applied to service_314. Log To Console After 30s, the second downtime should be finished. - ${result} Check Ba Status With Timeout test 0 60 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. Log To Console The BA is still OK - ${result} Check Downtimes With Timeout 0 60 + ${result} Ctn Check Downtimes With Timeout 0 60 Should Be True ${result} We should have no more running downtimes # The second downtime finishes - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The critical service is no more in downtime, the BA should be critical. Log To Console The BA is now critical (no more downtime) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker *** Keywords *** -BAM Setup - Stop Processes +Ctn BAM Setup + Ctn Stop Processes Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} ${date} Get Current Date result_format=epoch Log To Console date=${date} diff --git a/tests/bam/pb_inherited_downtime.robot b/tests/bam/pb_inherited_downtime.robot index c617308857c..fabc7b1d7c5 100644 --- a/tests/bam/pb_inherited_downtime.robot +++ b/tests/bam/pb_inherited_downtime.robot @@ -3,364 +3,364 @@ Documentation Centreon Broker and BAM with bbdo version 3.0.1 Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup BAM Setup -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn BAM Setup +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BEBAMIDTU1 [Documentation] With bbdo version 3.0.1, a BA of type 'worst' with one service is configured. The BA is in critical state, because of its service. Then we set a downtime on this last one. An inherited downtime is set to the BA. The downtime is removed from the service, the inherited downtime is then deleted. [Tags] broker downtime engine bam - Clear Commands Status - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Config BBDO3 ${1} - Config Engine ${1} + Ctn Clear Commands Status + Ctn Config Broker module + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central bam trace + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} - Add Bam Config To Broker central + Ctn Create Ba With Services test worst ${svc} + Ctn Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1} Get Command Id 314 + ${cmd_1} Ctn Get Command Id 314 Log To Console service_314 has command id ${cmd_1} - Set Command Status ${cmd_1} 2 - Start Broker + Ctn Set Command Status ${cmd_1} 2 + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected # A downtime is put on service_314 - Schedule Service Downtime host_16 service_314 3600 - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Ctn Schedule Service Downtime host_16 service_314 3600 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 Should Be True ${result} The BA ba_1 is not in downtime as it should # The downtime is deleted - Delete Service Downtime host_16 service_314 - ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + Ctn Delete Service Downtime host_16 service_314 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 0 60 Should Be True ${result} The service (host_16, service_314) is in downtime and should not. - ${result} Check Downtimes With Timeout 0 60 + ${result} Ctn Check Downtimes With Timeout 0 60 Should Be True ${result} No downtime should still be running. - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime as it should not - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEBAMIDTU2 [Documentation] With bbdo version 3.0.1, a BA of type 'worst' with one service is configured. The BA is in critical state, because of its service. Then we set a downtime on this last one. An inherited downtime is set to the BA. Engine is restarted. Broker is restarted. The two downtimes are still there with no duplicates. The downtime is removed from the service, the inherited downtime is then deleted. [Tags] broker downtime engine bam start stop - Clear Commands Status - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Clear Commands Status + Ctn Config Broker module + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central bam trace + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Config Engine ${1} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} - Add Bam Config To Broker central + Ctn Create Ba With Services test worst ${svc} + Ctn Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1} Get Command Id 314 + ${cmd_1} Ctn Get Command Id 314 Log To Console service_314 has command id ${cmd_1} - Set Command Status ${cmd_1} 2 - Start Broker + Ctn Set Command Status ${cmd_1} 2 + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected # A downtime is put on service_314 - Schedule Service Downtime host_16 service_314 3600 - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Ctn Schedule Service Downtime host_16 service_314 3600 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 Should Be True ${result} The BA ba_1 is not in downtime as it should FOR ${i} IN RANGE 2 # Engine is restarted - Stop Engine + Ctn Stop engine ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # Broker is restarted Log To Console Broker is stopped (step ${i}) - Kindly Stop Broker + Ctn Kindly Stop Broker Log To Console Broker is started - Start Broker + Ctn Start Broker END # There are still two downtimes: the one on the ba and the one on the kpi. - ${result} Number Of Downtimes Is 2 60 + ${result} Ctn Number Of Downtimes Is 2 60 Should Be True ${result} We should only have only two downtimes # The downtime is deleted - Delete Service Downtime host_16 service_314 - ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + Ctn Delete Service Downtime host_16 service_314 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 0 60 Should Be True ${result} The service (host_16, service_314) is in downtime and should not. - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime as it should not # We should have no more downtime - ${result} Number Of Downtimes Is 0 60 + ${result} Ctn Number Of Downtimes Is 0 60 Should Be True ${result} We should have no more downtime Log To Console Broker is stopped (end of BEBAMIDT2) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEBAMIGNDTU1 [Documentation] With bbdo version 3.0.1, a BA of type 'worst' with two services is configured. The downtime policy on this ba is "Ignore the indicator in the calculation". The BA is in critical state, because of the second critical service. Then we apply two downtimes on this last one. The BA state is ok because of the policy on indicators. A first downtime is cancelled, the BA is still OK, but when the second downtime is cancelled, the BA should be CRITICAL. [Tags] broker downtime engine bam - Clear Commands Status - Config Broker module - Config Broker central - Broker Config Log central bam trace - Broker Config Log central sql trace - Broker Config Flush Log module0 0 - Broker Config Log module0 neb trace - Config Broker rrd - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_level_functions trace - Engine Config Set Value ${0} log_flush_period 0 True - - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Clear Commands Status + Ctn Config Broker module + Ctn Config Broker central + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log module0 0 + Ctn Broker Config Log module0 neb trace + Ctn Config Broker rrd + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_level_functions trace + Ctn Engine Config Set Value ${0} log_flush_period 0 True + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} ignore - Add Bam Config To Broker central + Ctn Create Ba With Services test worst ${svc} ignore + Ctn Add Bam Config To Broker central # Command of service_313 is set to ok - ${cmd_1} Get Command Id 313 + ${cmd_1} Ctn Get Command Id 313 Log To Console service_313 has command id ${cmd_1} - Set Command Status ${cmd_1} 0 + Ctn Set Command Status ${cmd_1} 0 # Command of service_314 is set to critical - ${cmd_2} Get Command Id 314 + ${cmd_2} Ctn Get Command Id 314 Log To Console service_314 has command id ${cmd_2} - Set Command Status ${cmd_2} 2 + Ctn Set Command Status ${cmd_2} 2 - Start Broker + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok - Process Service Result Hard host_16 service_313 0 output critical for 313 - ${result} Check Service Status With Timeout host_16 service_313 0 60 + Ctn Process Service Result Hard host_16 service_313 0 output critical for 313 + ${result} Ctn Check Service Status With Timeout host_16 service_313 0 60 Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected Log To Console The BA is critical. # Two downtimes are applied on service_314 - Schedule Service Downtime host_16 service_314 3600 - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Ctn Schedule Service Downtime host_16 service_314 3600 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log To Console One downtime applied to service_314. - Schedule Service Downtime host_16 service_314 1800 - ${result} Check Service Downtime With Timeout host_16 service_314 2 60 + Ctn Schedule Service Downtime host_16 service_314 1800 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log To Console Two downtimes applied to service_314. - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime but should not Log To Console The BA is configured to ignore kpis in downtime - ${result} Check Ba Status With Timeout test 0 60 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. Log To Console The BA is OK, since the critical service is in downtime. # The first downtime is deleted - Delete Service Downtime host_16 service_314 + Ctn Delete Service Downtime host_16 service_314 - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should Log To Console Still one downtime applied to service_314. - ${result} Check Ba Status With Timeout test 0 60 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. Log To Console The BA is still OK - ${result} Check Downtimes With Timeout 1 60 + ${result} Ctn Check Downtimes With Timeout 1 60 Should Be True ${result} We should have one running downtime # The second downtime is deleted - Delete Service Downtime host_16 service_314 + Ctn Delete Service Downtime host_16 service_314 - ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 0 60 Should Be True ${result} The service (host_16, service_314) does not contain 0 downtime as it should Log To Console No more downtime applied to service_314. - ${result} Check Downtimes With Timeout 0 60 + ${result} Ctn Check Downtimes With Timeout 0 60 Should Be True ${result} We should have no more running downtimes - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The critical service is no more in downtime, the BA should be critical. Log To Console The BA is now critical (no more downtime) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEBAMIGNDTU2 [Documentation] With bbdo version 3.0.1, a BA of type 'worst' with two services is configured. The downtime policy on this ba is "Ignore the indicator in the calculation". The BA is in critical state, because of the second critical service. Then we apply two downtimes on this last one. The BA state is ok because of the policy on indicators. The first downtime reaches its end, the BA is still OK, but when the second downtime reaches its end, the BA should be CRITICAL. [Tags] broker downtime engine bam - Clear Commands Status - Config Broker module - Config Broker central - Broker Config Log central core error - Broker Config Log central bam trace - Config Broker rrd - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Clear Commands Status + Ctn Config Broker module + Ctn Config Broker central + Ctn Broker Config Log central core error + Ctn Broker Config Log central bam trace + Ctn Config Broker rrd + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Config Engine ${1} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} ignore - Add Bam Config To Broker central + Ctn Create Ba With Services test worst ${svc} ignore + Ctn Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1} Get Command Id 313 + ${cmd_1} Ctn Get Command Id 313 Log To Console service_314 has command id ${cmd_1} - Set Command Status ${cmd_1} 0 - ${cmd_2} Get Command Id 314 + Ctn Set Command Status ${cmd_1} 0 + ${cmd_2} Ctn Get Command Id 314 Log To Console service_314 has command id ${cmd_2} - Set Command Status ${cmd_2} 2 - Start Broker + Ctn Set Command Status ${cmd_2} 2 + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok - Process Service Result Hard host_16 service_313 0 output critical for 313 - ${result} Check Service Status With Timeout host_16 service_313 0 60 + Ctn Process Service Result Hard host_16 service_313 0 output critical for 313 + ${result} Ctn Check Service Status With Timeout host_16 service_313 0 60 Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected Log To Console The BA is critical. # Two downtimes are applied on service_314 - Schedule Service Downtime host_16 service_314 90 - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Ctn Schedule Service Downtime host_16 service_314 90 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log To Console One downtime applied to service_314. - Schedule Service Downtime host_16 service_314 30 - ${result} Check Service Downtime With Timeout host_16 service_314 2 60 + Ctn Schedule Service Downtime host_16 service_314 30 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log To Console Two downtimes applied to service_314. - ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + ${result} Ctn Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime but should not Log To Console The BA is configured to ignore kpis in downtime - ${result} Check Ba Status With Timeout test 0 60 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. Log To Console The BA is OK, since the critical service is in downtime. # The first downtime should reach its end Log To Console After 30s, the first downtime should be finished. - ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + ${result} Ctn Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should Log To Console Still one downtime applied to service_314. Log To Console After 30s, the second downtime should be finished. - ${result} Check Ba Status With Timeout test 0 60 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. Log To Console The BA is still OK # The second downtime finishes - ${result} Check Ba Status With Timeout test 2 90 + ${result} Ctn Check Ba Status With Timeout test 2 90 Should Be True ${result} The critical service is no more in downtime, the BA should be critical. Log To Console The BA is now critical (no more downtime) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker *** Keywords *** -BAM Setup - Stop Processes +Ctn BAM Setup + Ctn Stop Processes Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} ${date} Get Current Date result_format=epoch Log To Console Cleaning downtimes at date=${date} diff --git a/tests/broker-database/dedicated-connection.robot b/tests/broker-database/dedicated-connection.robot index 65667db6948..3ac3598045b 100644 --- a/tests/broker-database/dedicated-connection.robot +++ b/tests/broker-database/dedicated-connection.robot @@ -3,38 +3,38 @@ Documentation Centreon Broker data_bin and logs dedicated connections Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Stop Engine Broker And Save Logs only_central=True +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Stop Engine Broker And Save Logs only_central=True *** Test Cases *** DEDICATED_DB_CONNECTION_${nb_conn}_${store_in_data_bin} [Documentation] count database connection [Tags] broker database - Config Broker central - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql + Ctn Config Broker central + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1 - Broker Config Output Set central central-broker-unified-sql connections_count ${nb_conn} - Broker Config Output Set central central-broker-unified-sql store_in_data_bin ${store_in_data_bin} + Ctn Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1 + Ctn Broker Config Output Set central central-broker-unified-sql connections_count ${nb_conn} + Ctn Broker Config Output Set central central-broker-unified-sql store_in_data_bin ${store_in_data_bin} ${start} Get Current Date - Start Broker only_central=${True} + Ctn Start Broker only_central=${True} ${content} Create List unified sql: stream class instanciation - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No unified sql instanciation IF ${nb_conn} > 1 ${nb_dedicated} Evaluate ${nb_conn_expected} - 1 ${content} Create List use of ${nb_dedicated} dedicated connection for logs and data_bin tables - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 5 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 5 Should Be True ${result} No dedicated message END - ${connected} Wait For Connections 3306 ${nb_conn_expected} + ${connected} Ctn Wait For Connections 3306 ${nb_conn_expected} Should Be True ${connected} no ${nb_conn_expected} connections found Examples: nb_conn nb_conn_expected store_in_data_bin -- diff --git a/tests/broker-database/networkFailure.robot b/tests/broker-database/networkFailure.robot index 8212e0b7483..24109de8668 100644 --- a/tests/broker-database/networkFailure.robot +++ b/tests/broker-database/networkFailure.robot @@ -3,193 +3,193 @@ Documentation Centreon Broker database connection failure Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** NetworkDbFail1 [Documentation] network failure test between broker and database (shutting down connection for 100ms) [Tags] broker database network - Network Failure interval=100ms + Ctn Network Failure interval=100ms NetworkDbFail2 [Documentation] network failure test between broker and database (shutting down connection for 1s) [Tags] broker database network - Network Failure interval=1s + Ctn Network Failure interval=1s NetworkDbFail3 [Documentation] network failure test between broker and database (shutting down connection for 10s) [Tags] broker database network - Network Failure interval=10s + Ctn Network Failure interval=10s NetworkDbFail4 [Documentation] network failure test between broker and database (shutting down connection for 30s) [Tags] broker database network - Network Failure interval=30s + Ctn Network Failure interval=30s NetworkDbFail5 [Documentation] network failure test between broker and database (shutting down connection for 60s) [Tags] broker database network - Network Failure interval=1m + Ctn Network Failure interval=1m NetworkDBFail6 [Documentation] network failure test between broker and database: we wait for the connection to be established and then we shut down the connection for 60s [Tags] broker database network unstable - Config Engine ${1} - Config Broker central - Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1 - Broker Config Output Set central central-broker-master-sql connections_count 5 - Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1 - Broker Config Output Set central central-broker-master-perfdata connections_count 5 - Broker Config Log central sql trace - Config Broker rrd - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1 + Ctn Broker Config Output Set central central-broker-master-sql connections_count 5 + Ctn Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1 + Ctn Broker Config Output Set central central-broker-master-perfdata connections_count 5 + Ctn Broker Config Log central sql trace + Ctn Config Broker rrd + Ctn Config Broker module ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Broker and Engine are not connected ${content} Create List run query: SELECT - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40 Should Be True ${result} No SELECT done by broker in the DB - Disable Eth Connection On Port port=3306 + Ctn Disable Eth Connection On Port port=3306 Sleep 1m - Reset Eth Connection + Ctn Reset Eth Connection ${content} Create List 0 events acknowledged - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 - Stop Engine - Kindly Stop Broker + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40 + Ctn Stop engine + Ctn Kindly Stop Broker NetworkDBFailU6 [Documentation] network failure test between broker and database: we wait for the connection to be established and then we shut down the connection for 60s (with unified_sql) [Tags] broker database network unified_sql unstable - Reset Eth Connection - Config Engine ${1} - Config Broker central - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1 - Broker Config Output Set central central-broker-unified-sql connections_count 5 - Broker Config Log central sql trace - Config Broker rrd - Config Broker module + Ctn Reset Eth Connection + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1 + Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5 + Ctn Broker Config Log central sql trace + Ctn Config Broker rrd + Ctn Config Broker module ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Broker and Engine are not connected ${content} Create List run query: SELECT - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40 Should Be True ${result} No SELECT done by broker in the DB - Disable Eth Connection On Port port=3306 + Ctn Disable Eth Connection On Port port=3306 Log To Console Waiting for 1m while the connection to the DB is cut. Sleep 1m Log To Console Reestablishing the connection and test last steps. - Reset Eth Connection + Ctn Reset Eth Connection ${content} Create List 0 events acknowledged - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 - Stop Engine - Kindly Stop Broker + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40 + Ctn Stop engine + Ctn Kindly Stop Broker NetworkDBFail7 [Documentation] network failure test between broker and database: we wait for the connection to be established and then we shut down the connection for 60s [Tags] broker database network - Config Engine ${1} - Config Broker central - Reset Eth Connection - Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1 - Broker Config Output Set central central-broker-master-sql connections_count 5 - Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1 - Broker Config Output Set central central-broker-master-perfdata connections_count 5 - Broker Config Log central sql trace - Config Broker rrd - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Reset Eth Connection + Ctn Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1 + Ctn Broker Config Output Set central central-broker-master-sql connections_count 5 + Ctn Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1 + Ctn Broker Config Output Set central central-broker-master-perfdata connections_count 5 + Ctn Broker Config Log central sql trace + Ctn Config Broker rrd + Ctn Config Broker module ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Broker and Engine are not connected ${content} Create List run query: SELECT - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40 Should Be True ${result} No SELECT done by broker in the DB FOR ${i} IN 0 5 - Disable Eth Connection On Port port=3306 + Ctn Disable Eth Connection On Port port=3306 Sleep 10s - Reset Eth Connection + Ctn Reset Eth Connection Sleep 10s END ${content} Create List 0 events acknowledged - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} There are still events in the queue. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker NetworkDBFailU7 [Documentation] network failure test between broker and database: we wait for the connection to be established and then we shut down the connection for 60s (with unified_sql) [Tags] broker database network unified_sql - Reset Eth Connection - Config Engine ${1} - Config Broker central - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1 - Broker Config Output Set central central-broker-unified-sql connections_count 5 - Broker Config Log central sql trace - Config Broker rrd - Config Broker module + Ctn Reset Eth Connection + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1 + Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5 + Ctn Broker Config Log central sql trace + Ctn Config Broker rrd + Ctn Config Broker module ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Broker and Engine are not connected ${content} Create List run query: SELECT - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40 Should Be True ${result} No SELECT done by broker in the DB FOR ${i} IN 0 5 - Disable Eth Connection On Port port=3306 + Ctn Disable Eth Connection On Port port=3306 Sleep 10s - Reset Eth Connection + Ctn Reset Eth Connection Sleep 10s END ${content} Create List 0 events acknowledged - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} There are still events in the queue. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker *** Keywords *** -Disable Sleep Enable +Ctn Disable Sleep Enable [Arguments] ${interval} - Disable Eth Connection On Port port=3306 + Ctn Disable Eth Connection On Port port=3306 Sleep ${interval} - Reset Eth Connection + Ctn Reset Eth Connection -Network Failure +Ctn Network Failure [Arguments] ${interval} - Reset Eth Connection - Config Engine ${1} - Config Broker module - Config Broker rrd - Config Broker central - Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1 - Broker Config Output Set central central-broker-master-sql connections_count 10 - Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1 - Broker Config Output Set central central-broker-master-perfdata connections_count 10 - Broker Config Log central sql trace - Broker Config Source Log central true + Ctn Reset Eth Connection + Ctn Config Engine ${1} + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1 + Ctn Broker Config Output Set central central-broker-master-sql connections_count 10 + Ctn Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1 + Ctn Broker Config Output Set central central-broker-master-perfdata connections_count 10 + Ctn Broker Config Log central sql trace + Ctn Broker Config Source Log central true ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List SQL: performing mysql_ping - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 120 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 120 Should Be True ${result} We should have a call to mysql_ping every 30s on inactive connections. - Disable Sleep Enable ${interval} + Ctn Disable Sleep Enable ${interval} ${end} Get Current Date ${content} Create List mysql_connection 0x[0-9,a-f]+ : commit - ${result} Find Regex In Log With Timeout ${centralLog} ${end} ${content} 80 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${end} ${content} 80 Should Be True ... ${result[0]} ... timeout after network to be restablished (network failure duration : ${interval}) - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index f66170fa243..c085bb62b00 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -3,266 +3,266 @@ Documentation Centreon Broker and Engine progressively add services Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BEACK1 [Documentation] Engine has a critical service. An external command is sent to acknowledge it. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The service is newly set to OK. And the acknowledgement in database is deleted from engine but still open on the database. [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log module0 neb debug - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # Time to set the service to CRITICAL HARD. - Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT + Ctn Process Service Check Result host_1 service_1 2 (1;1) is critical + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT Should Be True ${result} Service (1;1) should be critical - Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical + Repeat Keyword 2 times Ctn Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 HARD Should Be True ${result} Service (1;1) should be critical HARD ${d} Get Current Date result_format=epoch exclude_millis=True - Acknowledge Service Problem host_1 service_1 - ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD + Ctn Acknowledge Service Problem host_1 service_1 + ${ack_id} Ctn Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set back to OK. - Process Service Result Hard host_1 service_1 0 (1;1) is OK - ${result} Check Service Status With Timeout host_1 service_1 ${0} 60 HARD + Ctn Process Service Result Hard host_1 service_1 0 (1;1) is OK + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${0} 60 HARD Should Be True ${result} Service (1;1) should be OK HARD # Acknowledgement is deleted but to see this we have to check in the comments table - ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 + ${result} Ctn Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK2 [Documentation] Configuration is made with BBDO3. Engine has a critical service. An external command is sent to acknowledge it. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The service is newly set to OK. And the acknowledgement in database is deleted. [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 ${1} - Broker Config Log module0 neb debug - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 ${1} + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # Time to set the service to CRITICAL HARD. - Process Service Check Result host_1 service_1 ${2} (1;1) is critical - ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT + Ctn Process Service Check Result host_1 service_1 ${2} (1;1) is critical + ${result} Ctn Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT Should Be True ${result} Service (1;1) should be critical - Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical + Repeat Keyword 2 times Ctn Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD + ${result} Ctn Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD Should Be True ${result} Service (1;1) should be critical HARD ${d} Get Current Date result_format=epoch exclude_millis=True - Acknowledge Service Problem host_1 service_1 - ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD + Ctn Acknowledge Service Problem host_1 service_1 + ${ack_id} Ctn Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set back to OK. - Process Service Result Hard host_1 service_1 0 (1;1) is OK - ${result} Check Service Resource Status With Timeout host_1 service_1 ${0} 60 HARD + Ctn Process Service Result Hard host_1 service_1 0 (1;1) is OK + ${result} Ctn Check Service Resource Status With Timeout host_1 service_1 ${0} 60 HARD Should Be True ${result} Service (1;1) should be OK HARD # Acknowledgement is deleted but to see this we have to check in the comments table - ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 + ${result} Ctn Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK3 [Documentation] Engine has a critical service. An external command is sent to acknowledge it. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The acknowledgement is removed and the comment in the comments table has its deletion_time column updated. [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log module0 neb debug - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # Time to set the service to CRITICAL HARD. - Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT + Ctn Process Service Check Result host_1 service_1 2 (1;1) is critical + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT Should Be True ${result} Service (1;1) should be critical - Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical + Repeat Keyword 2 times Ctn Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 HARD Should Be True ${result} Service (1;1) should be critical HARD ${d} Get Current Date result_format=epoch exclude_millis=True - Acknowledge Service Problem host_1 service_1 - ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD + Ctn Acknowledge Service Problem host_1 service_1 + ${ack_id} Ctn Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). - Remove Service Acknowledgement host_1 service_1 + Ctn Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH + ${result} Ctn Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK4 [Documentation] Configuration is made with BBDO3. Engine has a critical service. An external command is sent to acknowledge it. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The acknowledgement is removed and the comment in the comments table has its deletion_time column updated. [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 ${1} - Broker Config Log module0 neb debug - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 ${1} + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # Time to set the service to CRITICAL HARD. - Process Service Check Result host_1 service_1 ${2} (1;1) is critical - ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT + Ctn Process Service Check Result host_1 service_1 ${2} (1;1) is critical + ${result} Ctn Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT Should Be True ${result} Service (1;1) should be critical - Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical + Repeat Keyword 2 times Ctn Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD + ${result} Ctn Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD Should Be True ${result} Service (1;1) should be critical HARD ${d} Get Current Date result_format=epoch exclude_millis=True - Acknowledge Service Problem host_1 service_1 - ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD + Ctn Acknowledge Service Problem host_1 service_1 + ${ack_id} Ctn Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). - Remove Service Acknowledgement host_1 service_1 + Ctn Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH + ${result} Ctn Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK5 [Documentation] Engine has a critical service. An external command is sent to acknowledge it ; the acknowledgement is sticky. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The service is newly set to WARNING. And the acknowledgement in database is still there. [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log module0 neb trace - Broker Config Log central sql debug - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_level_external_command trace - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log module0 neb trace + Ctn Broker Config Log central sql debug + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_level_external_command trace + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # Time to set the service to CRITICAL HARD. - Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT + Ctn Process Service Check Result host_1 service_1 2 (1;1) is critical + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT Should Be True ${result} Service (1;1) should be critical - Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical + Repeat Keyword 2 times Ctn Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 HARD Should Be True ${result} Service (1;1) should be critical HARD ${d} Get Current Date result_format=epoch exclude_millis=True - Acknowledge Service Problem host_1 service_1 STICKY - ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD + Ctn Acknowledge Service Problem host_1 service_1 STICKY + ${ack_id} Ctn Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set to WARNING. - Process Service Result Hard host_1 service_1 1 (1;1) is WARNING - ${result} Check Service Status With Timeout host_1 service_1 ${1} 60 HARD + Ctn Process Service Result Hard host_1 service_1 1 (1;1) is WARNING + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${1} 60 HARD Should Be True ${result} Service (1;1) should be WARNING HARD # Acknowledgement is not deleted. - ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 10 + ${result} Ctn Check Acknowledgement Is Deleted With Timeout ${ack_id} 10 Should Be True ${result}==${False} Acknowledgement ${ack_id} should not be deleted. - Remove Service Acknowledgement host_1 service_1 + Ctn Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH + ${result} Ctn Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK6 [Documentation] Configuration is made with BBDO3. Engine has a critical service. An external command is sent to acknowledge it ; the acknowledgement is sticky. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The service is newly set to WARNING. And the acknowledgement in database is still there. [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 ${1} - Broker Config Log module0 neb debug - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 ${1} + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # Time to set the service to CRITICAL HARD. - Process Service Check Result host_1 service_1 ${2} (1;1) is critical - ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT + Ctn Process Service Check Result host_1 service_1 ${2} (1;1) is critical + ${result} Ctn Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT Should Be True ${result} Service (1;1) should be critical - Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical + Repeat Keyword 2 times Ctn Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD + ${result} Ctn Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD Should Be True ${result} Service (1;1) should be critical HARD ${d} Get Current Date result_format=epoch exclude_millis=True - Acknowledge Service Problem host_1 service_1 STICKY - ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD + Ctn Acknowledge Service Problem host_1 service_1 STICKY + ${ack_id} Ctn Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set to WARNING. - Process Service Result Hard host_1 service_1 1 (1;1) is WARNING - ${result} Check Service Status With Timeout host_1 service_1 ${1} 60 HARD + Ctn Process Service Result Hard host_1 service_1 1 (1;1) is WARNING + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${1} 60 HARD Should Be True ${result} Service (1;1) should be WARNING HARD # Acknowledgement is not deleted. - ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 10 + ${result} Ctn Check Acknowledgement Is Deleted With Timeout ${ack_id} 10 Should Be True ${result}==${False} Acknowledgement ${ack_id} should not be deleted. - Remove Service Acknowledgement host_1 service_1 + Ctn Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH + ${result} Ctn Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH Should Be True ${result} Acknowledgement ${ack_id} should be deleted. diff --git a/tests/broker-engine/anomaly-detection.robot b/tests/broker-engine/anomaly-detection.robot index 82cc2c8e825..b5ee3a4172f 100644 --- a/tests/broker-engine/anomaly-detection.robot +++ b/tests/broker-engine/anomaly-detection.robot @@ -3,39 +3,39 @@ Documentation Centreon Broker and Engine anomaly detection Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** ANO_NOFILE [Documentation] an anomaly detection without threshold file must be in unknown state [Tags] broker engine anomaly - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric Remove File /tmp/anomaly_threshold.json - Clear Retention - Clear Db services - Start Broker True - Start Engine - Process Service Check Result host_1 anomaly_${serv_id} 2 taratata - Check Service Status With Timeout host_1 anomaly_${serv_id} 3 30 - Stop Broker True - Stop Engine + Ctn Clear Retention + Ctn Clear Db services + Ctn Start Broker True + Ctn Start engine + Ctn Process Service Check Result host_1 anomaly_${serv_id} 2 taratata + Ctn Check Service Status With Timeout host_1 anomaly_${serv_id} 3 30 + Ctn Stop Broker True + Ctn Stop engine ANO_NOFILE_VERIF_CONFIG_NO_ERROR [Documentation] an anomaly detection without threshold file doesn't display error on config check [Tags] broker engine anomaly MON-20385 - Config Engine ${1} ${50} ${20} - Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + Ctn Create Anomaly Detection ${0} ${1} ${1} metric Remove File /tmp/anomaly_threshold.json - Clear Retention + Ctn Clear Retention Create Directory ${ENGINE_LOG}/config0 Start Process ... /usr/sbin/centengine @@ -52,156 +52,156 @@ ANO_NOFILE_VERIF_CONFIG_NO_ERROR ANO_TOO_OLD_FILE [Documentation] an anomaly detection with an oldest threshold file must be in unknown state [Tags] broker engine anomaly - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric ${predict_data} Evaluate [[0,0,2],[1648812678,0,3]] - Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} - Clear Retention - Clear Db services - Start Broker True - Start Engine - Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=70%;50;75 - Check Service Status With Timeout host_1 anomaly_${serv_id} 3 30 - Stop Broker True - Stop Engine + Ctn Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} + Ctn Clear Retention + Ctn Clear Db services + Ctn Start Broker True + Ctn Start engine + Ctn Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=70%;50;75 + Ctn Check Service Status With Timeout host_1 anomaly_${serv_id} 3 30 + Ctn Stop Broker True + Ctn Stop engine ANO_OUT_LOWER_THAN_LIMIT [Documentation] an anomaly detection with a perfdata lower than lower limit make a critical state [Tags] broker engine anomaly - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] - Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} - Clear Retention - Clear Db services - Start Broker True - Start Engine - Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=20%;50;75 - Check Service Status With Timeout host_1 anomaly_${serv_id} 2 30 - Stop Broker True - Stop Engine + Ctn Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} + Ctn Clear Retention + Ctn Clear Db services + Ctn Start Broker True + Ctn Start engine + Ctn Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=20%;50;75 + Ctn Check Service Status With Timeout host_1 anomaly_${serv_id} 2 30 + Ctn Stop Broker True + Ctn Stop engine ANO_OUT_UPPER_THAN_LIMIT [Documentation] an anomaly detection with a perfdata upper than upper limit make a critical state [Tags] broker engine anomaly - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] - Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} - Clear Retention - Clear Db services - Start Broker True - Start Engine - Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=80%;50;75 - Check Service Status With Timeout host_1 anomaly_${serv_id} 2 30 - Stop Broker True - Stop Engine + Ctn Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} + Ctn Clear Retention + Ctn Clear Db services + Ctn Start Broker True + Ctn Start engine + Ctn Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=80%;50;75 + Ctn Check Service Status With Timeout host_1 anomaly_${serv_id} 2 30 + Ctn Stop Broker True + Ctn Stop engine ANO_JSON_SENSITIVITY_NOT_SAVED [Documentation] json sensitivity not saved in retention [Tags] engine anomaly retention - Config Engine ${1} ${50} ${20} - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric ${predict_data} Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] - Create Anomaly Threshold File V2 + Ctn Create Anomaly Threshold File V2 ... /tmp/anomaly_threshold.json ... ${1} ... ${serv_id} ... metric ... 55.0 ... ${predict_data} - Clear Retention - Start Engine + Ctn Clear Retention + Ctn Start engine Sleep 5s - Stop Engine - ${retention_sensitivity} Grep Retention ${0} sensitivity=0.00 + Ctn Stop engine + ${retention_sensitivity} Ctn Grep Retention ${0} sensitivity=0.00 Should Be Equal As Strings ${retention_sensitivity} sensitivity=0.00 ANO_CFG_SENSITIVITY_SAVED [Documentation] cfg sensitivity saved in retention [Tags] engine anomaly retention - Config Engine ${1} ${50} ${20} - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric 4.00 + Ctn Config Engine ${1} ${50} ${20} + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric 4.00 ${predict_data} Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] - Create Anomaly Threshold File V2 + Ctn Create Anomaly Threshold File V2 ... /tmp/anomaly_threshold.json ... ${1} ... ${serv_id} ... metric ... 55.0 ... ${predict_data} - Clear Retention - Start Engine + Ctn Clear Retention + Ctn Start engine Sleep 5s - Stop Engine - ${retention_sensitivity} Grep Retention ${0} sensitivity=4.00 + Ctn Stop engine + ${retention_sensitivity} Ctn Grep Retention ${0} sensitivity=4.00 Should Be Equal As Strings ${retention_sensitivity} sensitivity=4.00 ANO_EXTCMD_SENSITIVITY_SAVED [Documentation] extcmd sensitivity saved in retention [Tags] engine anomaly retention extcmd FOR ${use_grpc} IN RANGE 1 2 - Config Engine ${1} ${50} ${20} - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric ${predict_data} Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] - Create Anomaly Threshold File V2 + Ctn Create Anomaly Threshold File V2 ... /tmp/anomaly_threshold.json ... ${1} ... ${serv_id} ... metric ... 55.0 ... ${predict_data} - Clear Retention - Start Engine + Ctn Clear Retention + Ctn Start engine Sleep 5s - Update Ano Sensitivity ${use_grpc} host_1 anomaly_1001 4.55 + Ctn Update Ano Sensitivity ${use_grpc} host_1 anomaly_1001 4.55 Sleep 1s - Stop Engine - ${retention_sensitivity} Grep Retention ${0} sensitivity=4.55 + Ctn Stop engine + ${retention_sensitivity} Ctn Grep Retention ${0} sensitivity=4.55 Should Be Equal As Strings ${retention_sensitivity} sensitivity=4.55 END AOUTLU1 [Documentation] an anomaly detection with a perfdata upper than upper limit make a critical state with bbdo 3 [Tags] broker engine anomaly bbdo - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker rrd - Config Broker module ${1} - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Config BBDO3 1 - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] - Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} - Clear Retention - Clear Db services - Start Broker + Ctn Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} + Ctn Clear Retention + Ctn Clear Db services + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=80%;50;75 - Check Service Status With Timeout host_1 anomaly_${serv_id} 2 30 - Stop Engine - Kindly Stop Broker + Ctn Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=80%;50;75 + Ctn Check Service Status With Timeout host_1 anomaly_${serv_id} 2 30 + Ctn Stop engine + Ctn Kindly Stop Broker ${lst} Create List 1 0 4 - ${result} Check Types In Resources ${lst} + ${result} Ctn Check Types In Resources ${lst} Should Be True ... ${result} ... The table 'resources' should contain rows of types SERVICE, HOST and ANOMALY_DETECTION. @@ -209,153 +209,153 @@ AOUTLU1 ANO_DT1 [Documentation] downtime on dependent service is inherited by ano [Tags] broker engine anomaly - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker rrd - Config Broker module ${1} - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Config BBDO3 1 - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] - Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} - Clear Retention - Clear Db services - Clear Db downtimes - Start Broker + Ctn Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} + Ctn Clear Retention + Ctn Clear Db services + Ctn Clear Db downtimes + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # create dependent service downtime - Schedule Service Fixed Downtime host_1 service_1 3600 + Ctn Schedule Service Fixed Downtime host_1 service_1 3600 - ${result} Check Service Downtime With Timeout host_1 service_1 1 60 + ${result} Ctn Check Service Downtime With Timeout host_1 service_1 1 60 Should Be True ${result} dependent service must be in downtime - ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 + ${result} Ctn Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 Should Be True ${result} anomaly service must be in downtime - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker ANO_DT2 [Documentation] delete downtime on dependent service delete one on ano serv [Tags] broker engine anomaly - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker rrd - Config Broker module ${1} - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Config BBDO3 1 - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] - Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} - Clear Retention - Clear Db services - Clear Db downtimes - Start Broker + Ctn Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} + Ctn Clear Retention + Ctn Clear Db services + Ctn Clear Db downtimes + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # create dependent service downtime - Schedule Service Fixed Downtime host_1 service_1 3600 + Ctn Schedule Service Fixed Downtime host_1 service_1 3600 - ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 + ${result} Ctn Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 Should Be True ${result} anomaly service must be in downtime - DELETE SERVICE DOWNTIME host_1 service_1 - ${result} Check Service Downtime With Timeout host_1 service_1 0 60 + Ctn Delete Service Downtime host_1 service_1 + ${result} Ctn Check Service Downtime With Timeout host_1 service_1 0 60 Should Be True ${result} dependent service must be in downtime - ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 0 60 + ${result} Ctn Check Service Downtime With Timeout host_1 anomaly_${serv_id} 0 60 Should Be True ${result} anomaly service must be in downtime - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker ANO_DT3 [Documentation] delete downtime on anomaly don t delete dependent service one [Tags] broker engine anomaly - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker rrd - Config Broker module ${1} - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Config BBDO3 1 - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] - Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} - Clear Retention - Clear Db services - Clear Db downtimes - Start Broker + Ctn Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} + Ctn Clear Retention + Ctn Clear Db services + Ctn Clear Db downtimes + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # create dependent service downtime - Schedule Service Fixed Downtime host_1 service_1 3600 + Ctn Schedule Service Fixed Downtime host_1 service_1 3600 - ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 + ${result} Ctn Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 Should Be True ${result} anomaly service must be in downtime - DELETE SERVICE DOWNTIME host_1 anomaly_${serv_id} - ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 0 60 + Ctn Delete Service Downtime host_1 anomaly_${serv_id} + ${result} Ctn Check Service Downtime With Timeout host_1 anomaly_${serv_id} 0 60 Should Be True ${result} anomaly service must be in downtime - ${result} Check Service Downtime With Timeout host_1 service_1 1 60 + ${result} Ctn Check Service Downtime With Timeout host_1 service_1 1 60 Should Be True ${result} dependent service must be in downtime - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker ANO_DT4 [Documentation] set dt on anomaly and on dependent service, delete last one don t delete first one [Tags] broker engine anomaly - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker rrd - Config Broker module ${1} - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Config BBDO3 1 - ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] - Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} - Clear Retention - Clear Db services - Clear Db downtimes - Start Broker + Ctn Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} + Ctn Clear Retention + Ctn Clear Db services + Ctn Clear Db downtimes + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # create dependent service downtime - Schedule Service Fixed Downtime host_1 service_1 3600 - Schedule Service Fixed Downtime host_1 anomaly_${serv_id} 3600 + Ctn Schedule Service Fixed Downtime host_1 service_1 3600 + Ctn Schedule Service Fixed Downtime host_1 anomaly_${serv_id} 3600 - ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 2 60 + ${result} Ctn Check Service Downtime With Timeout host_1 anomaly_${serv_id} 2 60 Should Be True ${result} anomaly service must be in double downtime - DELETE SERVICE DOWNTIME host_1 service_1 - ${result} Check Service Downtime With Timeout host_1 service_1 0 60 + Ctn Delete Service Downtime host_1 service_1 + ${result} Ctn Check Service Downtime With Timeout host_1 service_1 0 60 Should Be True ${result} dependent service mustn t be in downtime - ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 + ${result} Ctn Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 Should Be True ${result} anomaly service must be in simple downtime - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/bbdo-protobuf.robot b/tests/broker-engine/bbdo-protobuf.robot index 2d763d41b2c..ba018026760 100644 --- a/tests/broker-engine/bbdo-protobuf.robot +++ b/tests/broker-engine/bbdo-protobuf.robot @@ -3,140 +3,140 @@ Documentation Engine/Broker tests on bbdo_version 3.0.0 and protobuf bbdo Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BEPBBEE1 [Documentation] central-module configured with bbdo_version 3.0 but not others. Unable to establish connection. [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Log module0 bbdo debug - Broker Config Log central bbdo debug - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Log module0 bbdo debug + Ctn Broker Config Log central bbdo debug + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List BBDO: peer is using protocol version 3.0.0 whereas we're using protocol version 2.0.0 - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Message about not matching bbdo versions not available - [Teardown] Stop Engine Broker And Save Logs + [Teardown] Ctn Stop Engine Broker And Save Logs BEPBBEE2 [Documentation] bbdo_version 3 not compatible with sql/storage [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item central bbdo_version 3.0.0 - Broker Config Add Item rrd bbdo_version 3.0.0 - Broker Config Log central sql debug - Broker Config Flush Log central 0 - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item central bbdo_version 3.0.0 + Ctn Broker Config Add Item rrd bbdo_version 3.0.0 + Ctn Broker Config Log central sql debug + Ctn Broker Config Flush Log central 0 + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List ... Configuration check error: bbdo versions >= 3.0.0 need the unified_sql module to be configured. - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Message about a missing config of unified_sql not available. - Stop Engine + Ctn Stop engine BEPBBEE3 [Documentation] bbdo_version 3 generates new bbdo protobuf service status messages. [Tags] broker engine protobuf bbdo Remove File /tmp/pbservicestatus.log - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-pbservicestatus.lua - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-pbservicestatus.lua + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Wait Until Created /tmp/pbservicestatus.log 1m - [Teardown] Stop Engine Broker And Save Logs + [Teardown] Ctn Stop Engine Broker And Save Logs BEPBBEE4 [Documentation] bbdo_version 3 generates new bbdo protobuf host status messages. [Tags] broker engine protobuf bbdo Remove File /tmp/pbhoststatus.log - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-pbhoststatus.lua - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-pbhoststatus.lua + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Wait Until Created /tmp/pbhoststatus.log 1m - [Teardown] Stop Engine Broker And Save Logs + [Teardown] Ctn Stop Engine Broker And Save Logs BEPBBEE5 [Documentation] bbdo_version 3 generates new bbdo protobuf service messages. [Tags] broker engine protobuf bbdo Remove File /tmp/pbservice.log - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-pbservice.lua - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-pbservice.lua + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Wait Until Created /tmp/pbservice.log 1m - [Teardown] Stop Engine Broker And Save Logs + [Teardown] Ctn Stop Engine Broker And Save Logs BEPBRI1 [Documentation] bbdo_version 3 use pb_resource new bbdo protobuf ResponsiveInstance message. [Tags] broker engine protobuf bbdo Remove File /tmp/pbresponsiveinstance.log - Config Engine ${1} - Config Broker central - Config Broker module - Config BBDO3 1 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql read_timeout 2 - Broker Config Output Set central central-broker-unified-sql instance_timeout 2 + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql read_timeout 2 + Ctn Broker Config Output Set central central-broker-unified-sql instance_timeout 2 - Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-responsiveinstance.lua - Clear Retention + Ctn Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-responsiveinstance.lua + Ctn Clear Retention Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String DELETE FROM instances ${start} Get Current Date - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Wait Until Created /tmp/pbresponsiveinstance.log 30s ${grep_res} Grep File /tmp/pbresponsiveinstance.log "_type":65582, "category":1, "element":46, ${grep_res} Get Lines Containing String ${grep_res} "poller_id":1, "responsive":true Should Not Be Empty ${grep_res} "responsive":true not found - Stop Engine + Ctn Stop engine FOR ${index} IN RANGE 60 Sleep 1s ${grep_res} Grep File /tmp/pbresponsiveinstance.log "_type":65582, "category":1, "element":46, @@ -145,22 +145,22 @@ BEPBRI1 END Should Not Be Empty ${grep_res} "responsive":false not found - Kindly Stop Broker True + Ctn Kindly Stop Broker True BEPBCVS [Documentation] bbdo_version 3 communication of custom variables. [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Broker central - Config BBDO3 ${1} - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention ${start} Get Current Date - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -173,50 +173,50 @@ BEPBCVS END Should Be Equal As Strings ${output} (('VAL1',), ('VAL_SERV1',)) - [Teardown] Stop Engine Broker And Save Logs True + [Teardown] Ctn Stop Engine Broker And Save Logs True BEPB_HOST_DEPENDENCY [Documentation] BBDO 3 communication of host dependencies. [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Engine Add Cfg File 0 dependencies.cfg - Add Host Dependency 0 host_1 host_2 - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} + Ctn Config Engine Add Cfg File 0 dependencies.cfg + Ctn Add Host Dependency 0 host_1 host_2 + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention ${start} Get Current Date - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine - ${result} Common.Check Host Dependencies 2 1 24x7 1 ou dp 30 + ${result} Common.Ctn Check Host Dependencies 2 1 24x7 1 ou dp 30 Should Be True ${result} No notification dependency from 2 to 1 with timeperiod 24x7 on 'ou' - Config Engine ${1} - Reload Engine + Ctn Config Engine ${1} + Ctn Reload Engine - ${result} Common.Check No Host Dependencies 30 + ${result} Common.Ctn Check No Host Dependencies 30 Should Be True ${result} No host dependency should be defined - [Teardown] Stop Engine Broker And Save Logs True + [Teardown] Ctn Stop Engine Broker And Save Logs True BEPB_SERVICE_DEPENDENCY [Documentation] bbdo_version 3 communication of host dependencies. [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Engine Add Cfg File 0 dependencies.cfg - Add Service Dependency 0 host_1 host_2 service_1 service_21 - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} + Ctn Config Engine Add Cfg File 0 dependencies.cfg + Ctn Add Service Dependency 0 host_1 host_2 service_1 service_21 + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention ${start} Get Current Date - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -233,8 +233,8 @@ BEPB_SERVICE_DEPENDENCY ... ((2, 21, 1, 1, '24x7', 1, 'c'),) ... host dependency not found in database - Config Engine ${1} - Reload Engine + Ctn Config Engine ${1} + Ctn Reload Engine FOR ${index} IN RANGE 30 ${output} Query @@ -245,21 +245,21 @@ BEPB_SERVICE_DEPENDENCY END Should Be Equal As Strings ${output} () host dependency not deleted from database - [Teardown] Stop Engine Broker And Save Logs True + [Teardown] Ctn Stop Engine Broker And Save Logs True BEPBHostParent [Documentation] bbdo_version 3 communication of host parent relations [Tags] broker engine protobuf bbdo - Config Engine ${1} - Add Parent To Host 0 host_1 host_2 - Config Broker central - Config BBDO3 ${1} - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} + Ctn Add Parent To Host 0 host_1 host_2 + Ctn Config Broker central + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention ${start} Get Current Date - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 @@ -272,9 +272,9 @@ BEPBHostParent Should Be Equal As Strings ${output} ((1, 2),) host parent not inserted # remove host - Config Engine ${1} - Reload Broker True - Reload Engine + Ctn Config Engine ${1} + Ctn Reload Broker True + Ctn Reload Engine FOR ${index} IN RANGE 30 ${output} Query @@ -285,4 +285,4 @@ BEPBHostParent END Should Be Equal As Strings ${output} () host parent not deleted - [Teardown] Stop Engine Broker And Save Logs True + [Teardown] Ctn Stop Engine Broker And Save Logs True diff --git a/tests/broker-engine/bench.robot b/tests/broker-engine/bench.robot index f5bf1c007a0..9f22a6c13be 100644 --- a/tests/broker-engine/bench.robot +++ b/tests/broker-engine/bench.robot @@ -3,10 +3,10 @@ Documentation Centreon Broker and Engine benchmark Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Stop Engine Broker And Save Logs +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Stop Engine Broker And Save Logs *** Variables *** @@ -17,37 +17,37 @@ Test Teardown Stop Engine Broker And Save Logs BENCH_${nb_check}STATUS [Documentation] external command CHECK_SERVICE_RESULT 1000 times [Tags] broker engine bench - Config Engine ${1} ${50} ${20} + Ctn Config Engine ${1} ${50} ${20} # We want all the services to be passive to avoid parasite checks during our test. - Set Services Passive ${0} service_.* - Config Broker central - Config Broker rrd - Config Broker module ${1} - Broker Config Log central sql trace - Broker Config Log central core info - Broker Config Log central processing error - Config BBDO3 1 - Config Broker Sql Output central unified_sql + Ctn Set Services Passive ${0} service_.* + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central core info + Ctn Broker Config Log central processing error + Ctn Config BBDO3 1 + Ctn Config Broker Sql Output central unified_sql ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ${broker_stat_before} Get Broker Process Stat 51001 - ${engine_stat_before} Get Engine Process Stat 50001 - Process Service Check Result host_1 service_1 1 warning config0 0 ${nb_check} - Send Bench 1 50001 - ${bench_data} Get Last Bench Result With Timeout ${rrdLog} 1 central-rrd-master-output 60 - ${broker_stat_after} Get Broker Process Stat 51001 - ${engine_stat_after} Get Engine Process Stat 50001 - ${diff_broker} Diff Process Stat ${broker_stat_after} ${broker_stat_before} - ${diff_engine} Diff Process Stat ${engine_stat_after} ${engine_stat_before} + ${broker_stat_before} Ctn Get Broker Process Stat 51001 + ${engine_stat_before} Ctn Get Engine Process Stat 50001 + Ctn Process Service Check Result host_1 service_1 1 warning config0 0 ${nb_check} + Ctn Send Bench 1 50001 + ${bench_data} Ctn Get Last Bench Result With Timeout ${rrdLog} 1 central-rrd-master-output 60 + ${broker_stat_after} Ctn Get Broker Process Stat 51001 + ${engine_stat_after} Ctn Get Engine Process Stat 50001 + ${diff_broker} Ctn Diff Process Stat ${broker_stat_after} ${broker_stat_before} + ${diff_engine} Ctn Diff Process Stat ${engine_stat_after} ${engine_stat_before} - Download Database From S3 bench.unqlite + Ctn Download Database From S3 bench.unqlite - ${success} Store Result In Unqlite + ${success} Ctn Store Result In Unqlite ... bench.unqlite ... BENCH_${nb_check}STATUS ... broker @@ -60,7 +60,7 @@ BENCH_${nb_check}STATUS ... publish Should Be True ${success} fail to save broker bench to database - ${success} Store Result In Unqlite + ${success} Ctn Store Result In Unqlite ... bench.unqlite ... BENCH_${nb_check}STATUS ... engine @@ -73,7 +73,7 @@ BENCH_${nb_check}STATUS ... read Should Be True ${success} fail to save engine bench to database - Upload Database To S3 bench.unqlite + Ctn Upload Database To S3 bench.unqlite Examples: nb_check -- ... 1000 @@ -82,40 +82,40 @@ BENCH_${nb_check}STATUS BENCH_${nb_check}STATUS_TRACES [Documentation] external command CHECK_SERVICE_RESULT ${nb_check} times [Tags] broker engine bench - Config Engine ${1} ${50} ${20} + Ctn Config Engine ${1} ${50} ${20} # We want all the services to be passive to avoid parasite checks during our test. - Set Services Passive ${0} service_.* - Config Broker central - Config Broker rrd - Config Broker module ${1} + Ctn Set Services Passive ${0} service_.* + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} FOR ${name} IN @{CONFIG_NAME} - Broker Config Log central ${name} trace + Ctn Broker Config Log central ${name} trace END - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item central bbdo_version 3.0.0 - Broker Config Add Item rrd bbdo_version 3.0.0 - Config Broker Sql Output central unified_sql + Ctn Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item central bbdo_version 3.0.0 + Ctn Broker Config Add Item rrd bbdo_version 3.0.0 + Ctn Config Broker Sql Output central unified_sql ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ${broker_stat_before} Get Broker Process Stat 51001 - ${engine_stat_before} Get Engine Process Stat 50001 - Process Service Check Result host_1 service_1 1 warning config0 0 ${nb_check} - Send Bench 1 50001 - ${bench_data} Get Last Bench Result With Timeout ${rrdLog} 1 central-rrd-master-output 60 - ${broker_stat_after} Get Broker Process Stat 51001 - ${engine_stat_after} Get Engine Process Stat 50001 - ${diff_broker} Diff Process Stat ${broker_stat_after} ${broker_stat_before} - ${diff_engine} Diff Process Stat ${engine_stat_after} ${engine_stat_before} + ${broker_stat_before} Ctn Get Broker Process Stat 51001 + ${engine_stat_before} Ctn Get Engine Process Stat 50001 + Ctn Process Service Check Result host_1 service_1 1 warning config0 0 ${nb_check} + Ctn Send Bench 1 50001 + ${bench_data} Ctn Get Last Bench Result With Timeout ${rrdLog} 1 central-rrd-master-output 60 + ${broker_stat_after} Ctn Get Broker Process Stat 51001 + ${engine_stat_after} Ctn Get Engine Process Stat 50001 + ${diff_broker} Ctn Diff Process Stat ${broker_stat_after} ${broker_stat_before} + ${diff_engine} Ctn Diff Process Stat ${engine_stat_after} ${engine_stat_before} - Download Database From S3 bench.unqlite + Ctn Download Database From S3 bench.unqlite - ${success} Store Result In Unqlite + ${success} Ctn Store Result In Unqlite ... bench.unqlite ... BENCH_${nb_check}STATUS_TRACES ... broker @@ -128,7 +128,7 @@ BENCH_${nb_check}STATUS_TRACES ... publish Should Be True ${success} fail to save broker bench to database - ${success} Store Result In Unqlite + ${success} Ctn Store Result In Unqlite ... bench.unqlite ... BENCH_${nb_check}STATUS_TRACES ... engine @@ -141,7 +141,7 @@ BENCH_${nb_check}STATUS_TRACES ... read Should Be True ${success} fail to save engine bench to database - Upload Database To S3 bench.unqlite + Ctn Upload Database To S3 bench.unqlite Examples: nb_check -- ... 1000 @@ -150,32 +150,32 @@ BENCH_${nb_check}STATUS_TRACES BENCH_1000STATUS_100${suffixe} [Documentation] external command CHECK_SERVICE_RESULT 100 times with 100 pollers with 20 services [Tags] broker engine bench - Config Engine ${100} ${100} ${20} - Config Broker module ${100} - Config Broker central + Ctn Config Engine ${100} ${100} ${20} + Ctn Config Broker module ${100} + Ctn Config Broker central FOR ${poller_index} IN RANGE 100 # We want all the services to be passive to avoid parasite checks during our test. - Set Services Passive ${poller_index} service_.* + Ctn Set Services Passive ${poller_index} service_.* END - Config Broker rrd - Broker Config Log central sql trace - Broker Config Log central core info - Broker Config Log central processing error - Config BBDO3 ${100} - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql connections_count ${nb_conn} + Ctn Config Broker rrd + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central core info + Ctn Broker Config Log central processing error + Ctn Config BBDO3 ${100} + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql connections_count ${nb_conn} ${start} Get Current Date - Start Broker - Start Engine - ${connected} Wait For Connections 5669 100 + Ctn Start Broker + Ctn Start engine + ${connected} Ctn Wait For Connections 5669 100 Should Be True ${connected} 100 engines should be connected to broker - ${result} Wait For Listen On Range 50001 50100 centengine 60 + ${result} Ctn Wait For Listen On Range 50001 50100 centengine 60 ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${ENGINE_LOG}/config99/centengine.log ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${ENGINE_LOG}/config99/centengine.log ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ${broker_stat_before} Get Broker Process Stat 51001 - ${engine_stat_before} Get Engine Process Stat 50001 + ${broker_stat_before} Ctn Get Broker Process Stat 51001 + ${engine_stat_before} Ctn Get Engine Process Stat 50001 ${start_check} Get Current Date # one host per poller @@ -183,7 +183,7 @@ BENCH_1000STATUS_100${suffixe} ${host_id} Evaluate ${poller_index} + 1 FOR ${serv_index} IN RANGE 20 ${serv_id} Evaluate 1 + ${serv_index} + ${poller_index} * 20 - Process Service Check Result + Ctn Process Service Check Result ... host_${host_id} ... service_${serv_id} ... 1 @@ -191,27 +191,27 @@ BENCH_1000STATUS_100${suffixe} ... config${poller_index} ... 0 ... 100 - IF ${poller_index} == 1 Send Bench 1 50001 + IF ${poller_index} == 1 Ctn Send Bench 1 50001 END END - ${bench_data} Get Last Bench Result With Timeout ${rrdLog} 1 central-rrd-master-output 60 - ${broker_stat_after} Get Broker Process Stat 51001 - ${engine_stat_after} Get Engine Process Stat 50001 - ${diff_broker} Diff Process Stat ${broker_stat_after} ${broker_stat_before} - ${diff_engine} Diff Process Stat ${engine_stat_after} ${engine_stat_before} + ${bench_data} Ctn Get Last Bench Result With Timeout ${rrdLog} 1 central-rrd-master-output 60 + ${broker_stat_after} Ctn Get Broker Process Stat 51001 + ${engine_stat_after} Ctn Get Engine Process Stat 50001 + ${diff_broker} Ctn Diff Process Stat ${broker_stat_after} ${broker_stat_before} + ${diff_engine} Ctn Diff Process Stat ${engine_stat_after} ${engine_stat_before} ${content} Create List pb service (100, 2000) status 1 type 1 check result output: <> - ${result} Find In Log With Timeout With Line ${centralLog} ${start_check} ${content} 240 + ${result} Ctn Find In Log With Timeout With Line ${centralLog} ${start_check} ${content} 240 Should Be True ${result[0]} No check check result received. - ${date_last_check_received} Extract Date From Log ${result[1][0]} + ${date_last_check_received} Ctn Extract Date From Log ${result[1][0]} ${all_check_delay} Subtract Date From Date ${date_last_check_received} ${start_check} ${delay_last_result} Create Dictionary 200000_event_received ${all_check_delay} - Download Database From S3 bench.unqlite + Ctn Download Database From S3 bench.unqlite - ${success} Store Result In Unqlite + ${success} Ctn Store Result In Unqlite ... bench.unqlite ... BENCH_1000STATUS_100POLLER${suffixe} ... broker @@ -225,7 +225,7 @@ BENCH_1000STATUS_100${suffixe} ... ${delay_last_result} Should Be True ${success} "fail to save broker bench to database" - ${success} Store Result In Unqlite + ${success} Ctn Store Result In Unqlite ... bench.unqlite ... BENCH_1000STATUS_100POLLER${suffixe} ... engine @@ -239,7 +239,7 @@ BENCH_1000STATUS_100${suffixe} ... ${delay_last_result} Should Be True ${success} "fail to save engine bench to database" - Upload Database To S3 bench.unqlite + Ctn Upload Database To S3 bench.unqlite Examples: suffixe nb_conn -- ... ENGINE 1 diff --git a/tests/broker-engine/compression.robot b/tests/broker-engine/compression.robot index 6c089f7c6a9..bfa6a8bc1a7 100644 --- a/tests/broker-engine/compression.robot +++ b/tests/broker-engine/compression.robot @@ -3,10 +3,10 @@ Documentation Centreon Broker and Engine communication with or without com Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Variables *** @@ -18,24 +18,24 @@ Test Teardown Save Logs If Failed BECC1 [Documentation] Broker/Engine communication with compression between central and poller [Tags] broker engine compression tcp - Config Engine ${1} - Config Broker rrd + Ctn Config Engine ${1} + Ctn Config Broker rrd FOR ${comp1} IN @{choices} FOR ${comp2} IN @{choices} Log To Console Compression set to ${comp1} on central and to ${comp2} on module - Config Broker central - Config Broker module - Broker Config Input Set central central-broker-master-input compression ${comp1} - Broker Config Output Set module0 central-module-master-output compression ${comp2} - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Input Set central central-broker-master-input compression ${comp1} + Ctn Broker Config Output Set module0 central-module-master-output compression ${comp2} + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content1} Create List we have extensions '${ext["${comp1}"]}' and peer has '${ext["${comp2}"]}' ${content2} Create List we have extensions '${ext["${comp2}"]}' and peer has '${ext["${comp1}"]}' IF "${comp1}" == "yes" and "${comp2}" == "no" @@ -50,10 +50,10 @@ BECC1 ... extension 'COMPRESSION' is set to 'yes' in the configuration but cannot be activated because of peer configuration END ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result} Find In Log ${log} ${start} ${content1} + ${result} Ctn Find In Log ${log} ${start} ${content1} Should Be True ${result} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result} Find In Log ${log} ${start} ${content2} + ${result} Ctn Find In Log ${log} ${start} ${content2} Should Be True ${result} END END diff --git a/tests/broker-engine/delete-poller.robot b/tests/broker-engine/delete-poller.robot index 381b6f4ff4e..21008da4f2b 100644 --- a/tests/broker-engine/delete-poller.robot +++ b/tests/broker-engine/delete-poller.robot @@ -3,29 +3,29 @@ Documentation Creation of 4 pollers and then deletion of Poller3. Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** EBDP1 [Documentation] Four new pollers are started and then we remove Poller3. [Tags] broker engine grpc - Config Engine ${4} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${4} - Config BBDO3 ${4} - Broker Config Log central sql trace + Ctn Config Engine ${4} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${4} + Ctn Config BBDO3 ${4} + Ctn Broker Config Log central sql trace ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -36,24 +36,24 @@ EBDP1 END Should Be Equal As Strings ${output} ((4,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker # Poller3 is removed from the engine configuration but still there in centreon_storage DB - Config Engine ${3} ${50} ${20} + Ctn Config Engine ${3} ${50} ${20} ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the initial service states. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. - Remove Poller 51001 Poller3 + Ctn Remove Poller 51001 Poller3 Sleep 6s - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller3' @@ -65,20 +65,20 @@ EBDP1 EBDP2 [Documentation] Three new pollers are started, then they are killed. After a simple restart of broker, it is still possible to remove Poller2 if removed from the configuration. [Tags] broker engine grpc - Config Engine ${3} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${3} - Config BBDO3 ${3} - Broker Config Log central sql trace - Broker Config Log central processing info + Ctn Config Engine ${3} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + Ctn Config BBDO3 ${3} + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central processing info ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -99,27 +99,27 @@ EBDP2 Terminate Process e2 ${content} Create List feeder 'central-broker-master-input-\d', connection closed - ${result} Find Regex In Log With Timeout ${centralLog} ${start_remove} ${content} 60 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start_remove} ${content} 60 Should Be True ${result} connection closed not found. Log To Console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB - Config Engine ${2} ${50} ${20} + Ctn Config Engine ${2} ${50} ${20} ${start} Get Current Date - Kindly Stop Broker - Clear Engine Logs - Start Engine - Start Broker + Ctn Kindly Stop Broker + Ctn Clear Engine Logs + Ctn Start engine + Ctn Start Broker # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. - Remove Poller 51001 Poller2 + Ctn Remove Poller 51001 Poller2 - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' @@ -132,25 +132,25 @@ EBDP2 EBDP_GRPC2 [Documentation] Three new pollers are started, then they are killed. After a simple restart of broker, it is still possible to remove Poller2 if removed from the configuration. [Tags] broker engine grpc - Config Engine ${3} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${3} - Config BBDO3 ${3} - Config Broker BBDO Input central bbdo_server 5669 grpc - Config Broker BBDO Output module0 bbdo_client 5669 grpc localhost - Config Broker BBDO Output module1 bbdo_client 5669 grpc localhost - Config Broker BBDO Output module2 bbdo_client 5669 grpc localhost - Broker Config Log central sql trace - Broker Config Log central processing info - Broker Config Log central grpc info + Ctn Config Engine ${3} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + Ctn Config BBDO3 ${3} + Ctn Config Broker Bbdo Input central bbdo_server 5669 grpc + Ctn Config Broker Bbdo Output module0 bbdo_client 5669 grpc localhost + Ctn Config Broker Bbdo Output module1 bbdo_client 5669 grpc localhost + Ctn Config Broker Bbdo Output module2 bbdo_client 5669 grpc localhost + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central processing info + Ctn Broker Config Log central grpc info ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -172,27 +172,27 @@ EBDP_GRPC2 Terminate Process e2 ${content} Create List feeder 'central-broker-master-input-\d', connection closed - ${result} Find Regex In Log With Timeout ${centralLog} ${start_remove} ${content} 60 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start_remove} ${content} 60 Should Be True ${result} connection closed not found. Log To Console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB - Config Engine ${2} ${50} ${20} + Ctn Config Engine ${2} ${50} ${20} ${start} Get Current Date - Kindly Stop Broker - Clear Engine Logs - Start Engine - Start Broker + Ctn Kindly Stop Broker + Ctn Clear Engine Logs + Ctn Start engine + Ctn Start Broker # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. - Remove Poller 51001 Poller2 + Ctn Remove Poller 51001 Poller2 - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' @@ -205,19 +205,19 @@ EBDP_GRPC2 EBDP3 [Documentation] Three new pollers are started, then they are killed. It is still possible to remove Poller2 if removed from the configuration. [Tags] broker engine grpc - Config Engine ${3} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${3} - Config BBDO3 ${3} - Broker Config Log central sql trace + Ctn Config Engine ${3} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + Ctn Config BBDO3 ${3} + Ctn Broker Config Log central sql trace ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -239,20 +239,20 @@ EBDP3 Log To Console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB - Config Engine ${2} ${50} ${20} + Ctn Config Engine ${2} ${50} ${20} ${start} Get Current Date - Clear Engine Logs - Start Engine + Ctn Clear Engine Logs + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. - Remove Poller 51001 Poller2 + Ctn Remove Poller 51001 Poller2 - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' @@ -265,22 +265,22 @@ EBDP3 EBDP4 [Documentation] Four new pollers are started and then we remove Poller3 with its hosts and services. All service status/host status are then refused by broker. [Tags] broker engine grpc - Config Engine ${4} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${4} - Config BBDO3 ${4} - Broker Config Log central core error - Broker Config Log central sql trace - Broker Config Log module3 neb trace - Broker Config Flush Log central 0 + Ctn Config Engine ${4} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${4} + Ctn Config BBDO3 ${4} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql trace + Ctn Broker Config Log module3 neb trace + Ctn Broker Config Flush Log central 0 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -293,26 +293,26 @@ EBDP4 # Let's brutally kill the poller ${content} Create List processing poller event (id: 4, name: Poller3, running: - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} We want the poller 4 event before stopping broker - Kindly Stop Broker + Ctn Kindly Stop Broker Remove Files ${centralLog} ${rrdLog} # Generation of many service status but kept in memory on poller3. FOR ${i} IN RANGE 200 - Process Service Check Result host_40 service_781 2 service_781 should fail config3 - Process Service Check Result host_40 service_782 1 service_782 should fail config3 + Ctn Process Service Check Result host_40 service_781 2 service_781 should fail config3 + Ctn Process Service Check Result host_40 service_782 1 service_782 should fail config3 END ${content} Create List ... SERVICE ALERT: host_40;service_781;CRITICAL ... SERVICE ALERT: host_40;service_782;WARNING - ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} Service alerts about service 781 and 782 should be raised ${content} Create List callbacks: service (40, 781) has no perfdata service (40, 782) has no perfdata - ${result} Find In Log With Timeout ${moduleLog3} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${moduleLog3} ${start} ${content} 60 Should Be True ${result} pb service status on services (40, 781) and (40, 782) should be generated - Stop Engine + Ctn Stop engine # Because poller3 is going to be removed, we move its memory file to poller0, 1 and 2. Move File @@ -320,17 +320,17 @@ EBDP4 ... ${VarRoot}/lib/centreon-engine/central-module-master0.memory.central-module-master-output # Poller3 is removed from the engine configuration but still there in centreon_storage DB - Config Engine ${3} ${39} ${20} + Ctn Config Engine ${3} ${39} ${20} # Restart Broker - Start Broker + Ctn Start Broker # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. - Remove Poller 51001 Poller3 + Ctn Remove Poller 51001 Poller3 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller3' Sleep 1s @@ -338,35 +338,35 @@ EBDP4 END Should Be Equal As Strings ${output} () - Start Engine + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. ${content} Create List service status (40, 781) thrown away because host 40 is not known by any poller Log To Console date ${start} - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about these two wrong service status. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EBDP5 [Documentation] Four new pollers are started and then we remove Poller3. [Tags] broker engine grpc - Config Engine ${4} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${4} - Config BBDO3 ${4} - Broker Config Log central sql trace + Ctn Config Engine ${4} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${4} + Ctn Config BBDO3 ${4} + Ctn Broker Config Log central sql trace ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait until engine listens to external_commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -377,29 +377,29 @@ EBDP5 END Should Be Equal As Strings ${output} ((4,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker # Poller3 is removed from the engine configuration but still there in centreon_storage DB - Config Engine ${3} ${50} ${20} + Ctn Config Engine ${3} ${50} ${20} ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait until engine listens to external_commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date - Remove Poller By Id 51001 ${4} + Ctn Remove Poller By Id 51001 ${4} # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance - ${result} Find In Log With Timeout ${centralLog} ${remove_time} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${remove_time} ${content} 60 Should Be True ${result} central-broker-unified-sql read neb:Instance is missing - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller3' @@ -411,19 +411,19 @@ EBDP5 EBDP6 [Documentation] Three new pollers are started, then they are killed. After a simple restart of broker, it is still possible to remove Poller2 if removed from the configuration. [Tags] broker engine grpc - Config Engine ${3} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${3} - Config BBDO3 ${3} - Broker Config Log central sql trace + Ctn Config Engine ${3} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + Ctn Config BBDO3 ${3} + Ctn Broker Config Log central sql trace ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -445,28 +445,28 @@ EBDP6 Log To Console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB - Config Engine ${2} ${50} ${20} + Ctn Config Engine ${2} ${50} ${20} ${start} Get Current Date - Kindly Stop Broker - Clear Engine Logs - Start Engine - Start Broker + Ctn Kindly Stop Broker + Ctn Clear Engine Logs + Ctn Start engine + Ctn Start Broker # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date - Remove Poller By Id 51001 ${3} + Ctn Remove Poller By Id 51001 ${3} # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance - ${result} Find In Log With Timeout ${centralLog} ${remove_time} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${remove_time} ${content} 60 Should Be True ${result} central-broker-unified-sql read neb:Instance is missing - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' @@ -479,19 +479,19 @@ EBDP6 EBDP7 [Documentation] Three new pollers are started, then they are killed. It is still possible to remove Poller2 if removed from the configuration. [Tags] broker engine grpc - Config Engine ${3} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${3} - Config BBDO3 ${3} - Broker Config Log central sql trace + Ctn Config Engine ${3} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + Ctn Config BBDO3 ${3} + Ctn Broker Config Log central sql trace ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -513,26 +513,26 @@ EBDP7 Log To Console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB - Config Engine ${2} ${50} ${20} + Ctn Config Engine ${2} ${50} ${20} ${start} Get Current Date - Clear Engine Logs - Start Engine + Ctn Clear Engine Logs + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date - Remove Poller By Id 51001 ${3} + Ctn Remove Poller By Id 51001 ${3} # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance - ${result} Find In Log With Timeout ${centralLog} ${remove_time} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${remove_time} ${content} 60 Should Be True ${result} central-broker-unified-sql read neb:Instance is missing - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' @@ -545,22 +545,22 @@ EBDP7 EBDP8 [Documentation] Four new pollers are started and then we remove Poller3 with its hosts and services. All service status/host status are then refused by broker. [Tags] broker engine grpc - Config Engine ${4} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${4} - Config BBDO3 ${4} - Broker Config Log central core error - Broker Config Log central sql trace - Broker Config Log module3 neb trace - Broker Config Flush Log central 0 + Ctn Config Engine ${4} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${4} + Ctn Config BBDO3 ${4} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql trace + Ctn Broker Config Log module3 neb trace + Ctn Broker Config Flush Log central 0 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -573,26 +573,26 @@ EBDP8 # Let's brutally kill the poller ${content} Create List processing poller event (id: 4, name: Poller3, running: - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} We want the poller 4 event before stopping broker - Kindly Stop Broker + Ctn Kindly Stop Broker Remove Files ${centralLog} ${rrdLog} # Generation of many service status but kept in memory on poller3. FOR ${i} IN RANGE 200 - Process Service Check Result host_40 service_781 2 service_781 should fail config3 - Process Service Check Result host_40 service_782 1 service_782 should fail config3 + Ctn Process Service Check Result host_40 service_781 2 service_781 should fail config3 + Ctn Process Service Check Result host_40 service_782 1 service_782 should fail config3 END ${content} Create List ... SERVICE ALERT: host_40;service_781;CRITICAL ... SERVICE ALERT: host_40;service_782;WARNING - ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} Service alerts about service 781 and 782 should be raised ${content} Create List callbacks: service (40, 781) has no perfdata service (40, 782) has no perfdata - ${result} Find In Log With Timeout ${moduleLog3} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${moduleLog3} ${start} ${content} 60 Should Be True ${result} pb service status on services (40, 781) and (40, 782) should be generated - Stop Engine + Ctn Stop engine # Because poller3 is going to be removed, we move its memory file to poller0, 1 and 2. Move File @@ -600,11 +600,11 @@ EBDP8 ... ${VarRoot}/lib/centreon-engine/central-module-master0.memory.central-module-master-output # Poller3 is removed from the engine configuration but still there in centreon_storage DB - Config Engine ${3} ${39} ${20} + Ctn Config Engine ${3} ${39} ${20} # Restart Broker - Start Broker - Remove Poller By Id 51001 ${4} + Ctn Start Broker + Ctn Remove Poller By Id 51001 ${4} FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller3' Sleep 1s @@ -612,15 +612,15 @@ EBDP8 END Should Be Equal As Strings ${output} () - Start Engine + Ctn Start engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. ${content} Create List service status (40, 781) thrown away because host 40 is not known by any poller Log To Console date ${start} - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about these two wrong service status. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/downtimes.robot b/tests/broker-engine/downtimes.robot index d7426f06cfc..abb7f0bc0b2 100644 --- a/tests/broker-engine/downtimes.robot +++ b/tests/broker-engine/downtimes.robot @@ -3,212 +3,212 @@ Documentation Centreon Broker and Engine progressively add services Resource ../resources/import.resource -Suite Setup Clean Downtimes Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Downtimes Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BEDTMASS1 [Documentation] New services with several pollers are created. Then downtimes are set on all configured hosts. This action results on 1050 downtimes if we also count impacted services. Then all these downtimes are removed. This test is done with BBDO 3.0.0 [Tags] broker engine services protobuf - Config Engine ${3} ${50} ${20} - Engine Config Set Value ${0} log_level_functions trace - Engine Config Set Value ${1} log_level_functions trace - Engine Config Set Value ${2} log_level_functions trace - Config Broker rrd - Config Broker central - Config Broker module ${3} - Broker Config Log central sql debug - Broker Config Log module0 neb debug - Broker Config Log module1 neb debug - Broker Config Log module2 neb debug - - Config BBDO3 3 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${3} ${50} ${20} + Ctn Engine Config Set Value ${0} log_level_functions trace + Ctn Engine Config Set Value ${1} log_level_functions trace + Ctn Engine Config Set Value ${2} log_level_functions trace + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log module1 neb debug + Ctn Broker Config Log module2 neb debug + + Ctn Config BBDO3 3 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # It's time to schedule downtimes FOR ${i} IN RANGE ${17} - Schedule Host Downtime ${0} host_${i + 1} ${3600} - Schedule Host Downtime ${1} host_${i + 18} ${3600} - Schedule Host Downtime ${2} host_${i + 35} ${3600} + Ctn Schedule Host Downtime ${0} host_${i + 1} ${3600} + Ctn Schedule Host Downtime ${1} host_${i + 18} ${3600} + Ctn Schedule Host Downtime ${2} host_${i + 35} ${3600} END - ${result} Check Number Of Downtimes ${1050} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${1050} ${start} ${60} Should Be True ${result} We should have 1050 downtimes enabled. # It's time to delete downtimes FOR ${i} IN RANGE ${17} - Delete Host Downtimes ${0} host_${i + 1} - Delete Host Downtimes ${1} host_${i + 18} - Delete Host Downtimes ${2} host_${i + 35} + Ctn Delete Host Downtimes ${0} host_${i + 1} + Ctn Delete Host Downtimes ${1} host_${i + 18} + Ctn Delete Host Downtimes ${2} host_${i + 35} END - ${result} Check Number Of Downtimes ${0} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} We should have no downtime enabled. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEDTMASS2 [Documentation] New services with several pollers are created. Then downtimes are set on all configured hosts. This action results on 1050 downtimes if we also count impacted services. Then all these downtimes are removed. This test is done with BBDO 2.0 [Tags] broker engine services protobuf - Config Engine ${3} ${50} ${20} - Engine Config Set Value ${0} log_level_functions trace - Engine Config Set Value ${1} log_level_functions trace - Engine Config Set Value ${2} log_level_functions trace - Config Broker rrd - Config Broker central - Config Broker module ${3} - Broker Config Log central sql debug - Broker Config Log module0 neb debug - Broker Config Log module1 neb debug - Broker Config Log module2 neb debug - - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${3} ${50} ${20} + Ctn Engine Config Set Value ${0} log_level_functions trace + Ctn Engine Config Set Value ${1} log_level_functions trace + Ctn Engine Config Set Value ${2} log_level_functions trace + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log module1 neb debug + Ctn Broker Config Log module2 neb debug + + Ctn Broker Config Log central sql debug + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # It's time to schedule downtimes FOR ${i} IN RANGE ${17} - Schedule Host Downtime ${0} host_${i + 1} ${3600} - Schedule Host Downtime ${1} host_${i + 18} ${3600} - Schedule Host Downtime ${2} host_${i + 35} ${3600} + Ctn Schedule Host Downtime ${0} host_${i + 1} ${3600} + Ctn Schedule Host Downtime ${1} host_${i + 18} ${3600} + Ctn Schedule Host Downtime ${2} host_${i + 35} ${3600} END - ${result} Check Number Of Downtimes ${1050} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${1050} ${start} ${60} Should Be True ${result} We should have 1050 downtimes enabled. # It's time to delete downtimes FOR ${i} IN RANGE ${17} - Delete Host Downtimes ${0} host_${i + 1} - Delete Host Downtimes ${1} host_${i + 18} - Delete Host Downtimes ${2} host_${i + 35} + Ctn Delete Host Downtimes ${0} host_${i + 1} + Ctn Delete Host Downtimes ${1} host_${i + 18} + Ctn Delete Host Downtimes ${2} host_${i + 35} END - ${result} Check Number Of Downtimes ${0} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} We should have no downtime enabled. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEDTSVCREN1 [Documentation] A downtime is set on a service then the service is renamed. The downtime is still active on the renamed service. The downtime is removed from the renamed service and it is well removed. [Tags] broker engine services downtime - Config Engine ${1} - Engine Config Set Value ${0} log_level_functions trace - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central sql debug - Broker Config Log module0 neb debug - - Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_level_functions trace + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb debug + + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule a downtime - Schedule Service Downtime host_1 service_1 ${3600} + Ctn Schedule Service Downtime host_1 service_1 ${3600} - ${result} Check Number Of Downtimes ${1} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${1} ${start} ${60} Should Be True ${result} We should have 1 downtime enabled. # Let's rename the service service_1 - Rename Service ${0} host_1 service_1 toto_1 + Ctn Rename Service ${0} host_1 service_1 toto_1 - Reload Engine + Ctn Reload Engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - Delete Service Downtime Full ${0} host_1 toto_1 + Ctn Delete Service Downtime Full ${0} host_1 toto_1 - ${result} Check Number Of Downtimes ${0} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} We should have no downtime enabled. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEDTSVCFIXED [Documentation] A downtime is set on a service, the total number of downtimes is really 1 then we delete this downtime and the number of downtime is 0. [Tags] broker engine downtime - Config Engine ${1} - Engine Config Set Value ${0} log_level_functions trace - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central sql debug - Broker Config Log module0 neb debug - - Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_level_functions trace + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb debug + + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule a downtime - Schedule Service Downtime host_1 service_1 ${3600} + Ctn Schedule Service Downtime host_1 service_1 ${3600} - ${result} Check Number Of Downtimes ${1} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${1} ${start} ${60} Should Be True ${result} We should have 1 downtime enabled. - Delete Service Downtime Full ${0} host_1 service_1 + Ctn Delete Service Downtime Full ${0} host_1 service_1 - ${result} Check Number Of Downtimes ${0} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} We should have no downtime enabled. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEDTHOSTFIXED [Documentation] A downtime is set on a host, the total number of downtimes is really 21 (1 for the host and 20 for its 20 services) then we delete this downtime and the number is 0. [Tags] broker engine downtime - Config Engine ${1} - Engine Config Set Value ${0} log_level_functions trace - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central sql debug - Broker Config Log module0 neb debug - Config Broker Sql Output central unified_sql - - Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_level_functions trace + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb debug + Ctn Config Broker Sql Output central unified_sql + + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. log to console step1 # It's time to schedule downtimes - Schedule Host Fixed Downtime ${0} host_1 ${3600} + Ctn Schedule Host Fixed Downtime ${0} host_1 ${3600} log to console step2 ${content} Create List HOST DOWNTIME ALERT: host_1;STARTED; Host has entered a period of scheduled downtime ... SERVICE DOWNTIME ALERT: host_1;service_1;STARTED; Service has entered a period of scheduled downtime @@ -231,16 +231,16 @@ BEDTHOSTFIXED ... SERVICE DOWNTIME ALERT: host_1;service_18;STARTED; Service has entered a period of scheduled downtime ... SERVICE DOWNTIME ALERT: host_1;service_19;STARTED; Service has entered a period of scheduled downtime ... SERVICE DOWNTIME ALERT: host_1;service_20;STARTED; Service has entered a period of scheduled downtime - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} We should have 1 host downtime and 20 service downtimes on engine side. - ${result} Check Number Of Downtimes ${21} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${21} ${start} ${60} log to console step3 Should Be True ${result} We should have 21 downtimes (1 host + 20 services) enabled. log to console step4 # It's time to delete downtimes - Delete Host Downtimes ${0} host_1 + Ctn Delete Host Downtimes ${0} host_1 ${content} Create List HOST DOWNTIME ALERT: host_1;CANCELLED; Scheduled downtime for host has been cancelled. ... SERVICE DOWNTIME ALERT: host_1;service_1;CANCELLED; Scheduled downtime for service has been cancelled. ... SERVICE DOWNTIME ALERT: host_1;service_2;CANCELLED; Scheduled downtime for service has been cancelled. @@ -262,77 +262,77 @@ BEDTHOSTFIXED ... SERVICE DOWNTIME ALERT: host_1;service_18;CANCELLED; Scheduled downtime for service has been cancelled. ... SERVICE DOWNTIME ALERT: host_1;service_19;CANCELLED; Scheduled downtime for service has been cancelled. ... SERVICE DOWNTIME ALERT: host_1;service_20;CANCELLED; Scheduled downtime for service has been cancelled. - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} We should have 1 host downtime and 20 service downtimes on engine side. - ${result} Check Number Of Downtimes ${0} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} We should have no downtime enabled. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker DTIM [Documentation] New services with several pollers are created. Then downtimes are set on all configured hosts. This action results on 5250 downtimes if we also count impacted services. Then all these downtimes are removed. This test is done with BBDO 3.0.1 [Tags] broker engine services host downtimes MON-19339 - Config Engine ${5} ${250} ${20} - Engine Config Set Value ${0} log_level_functions trace - Engine Config Set Value ${1} log_level_functions trace - Engine Config Set Value ${2} log_level_functions trace - Engine Config Set Value ${3} log_level_functions trace - Engine Config Set Value ${4} log_level_functions trace - Config Broker rrd - Config Broker central - Config Broker module ${5} - Broker Config Add Item module0 bbdo_version 3.0.1 - Broker Config Add Item module1 bbdo_version 3.0.1 - Broker Config Add Item module2 bbdo_version 3.0.1 - Broker Config Add Item module3 bbdo_version 3.0.1 - Broker Config Add Item module4 bbdo_version 3.0.1 - Broker Config Add Item central bbdo_version 3.0.1 - Broker Config Add Item rrd bbdo_version 3.0.1 - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${5} ${250} ${20} + Ctn Engine Config Set Value ${0} log_level_functions trace + Ctn Engine Config Set Value ${1} log_level_functions trace + Ctn Engine Config Set Value ${2} log_level_functions trace + Ctn Engine Config Set Value ${3} log_level_functions trace + Ctn Engine Config Set Value ${4} log_level_functions trace + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${5} + Ctn Broker Config Add Item module0 bbdo_version 3.0.1 + Ctn Broker Config Add Item module1 bbdo_version 3.0.1 + Ctn Broker Config Add Item module2 bbdo_version 3.0.1 + Ctn Broker Config Add Item module3 bbdo_version 3.0.1 + Ctn Broker Config Add Item module4 bbdo_version 3.0.1 + Ctn Broker Config Add Item central bbdo_version 3.0.1 + Ctn Broker Config Add Item rrd bbdo_version 3.0.1 + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog4} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog4} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # It's time to schedule downtimes FOR ${i} IN RANGE ${50} - Schedule Host Fixed Downtime ${0} host_${i + 1} ${3600} - Schedule Host Fixed Downtime ${1} host_${i + 51} ${3600} - Schedule Host Fixed Downtime ${2} host_${i + 101} ${3600} - Schedule Host Fixed Downtime ${3} host_${i + 151} ${3600} - Schedule Host Fixed Downtime ${4} host_${i + 201} ${3600} + Ctn Schedule Host Fixed Downtime ${0} host_${i + 1} ${3600} + Ctn Schedule Host Fixed Downtime ${1} host_${i + 51} ${3600} + Ctn Schedule Host Fixed Downtime ${2} host_${i + 101} ${3600} + Ctn Schedule Host Fixed Downtime ${3} host_${i + 151} ${3600} + Ctn Schedule Host Fixed Downtime ${4} host_${i + 201} ${3600} END - ${result} Check Number Of Downtimes ${5250} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${5250} ${start} ${60} Should be true ${result} We should have 5250 downtimes enabled. # It's time to delete downtimes FOR ${i} IN RANGE ${50} - Delete Host Downtimes ${0} host_${i + 1} - Delete Host Downtimes ${1} host_${i + 51} - Delete Host Downtimes ${2} host_${i + 101} - Delete Host Downtimes ${3} host_${i + 151} - Delete Host Downtimes ${4} host_${i + 201} + Ctn Delete Host Downtimes ${0} host_${i + 1} + Ctn Delete Host Downtimes ${1} host_${i + 51} + Ctn Delete Host Downtimes ${2} host_${i + 101} + Ctn Delete Host Downtimes ${3} host_${i + 151} + Ctn Delete Host Downtimes ${4} host_${i + 201} END - ${result} Check Number Of Downtimes ${0} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} There are still some downtimes enabled. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker *** Keywords *** -Clean Downtimes Before Suite - Clean Before Suite +Ctn Clean Downtimes Before Suite + Ctn Clean Before Suite Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} ${output} Execute SQL String DELETE FROM downtimes WHERE deletion_time IS NULL diff --git a/tests/broker-engine/external-commands.robot b/tests/broker-engine/external-commands.robot index f0b59ed2227..a4e6663d984 100644 --- a/tests/broker-engine/external-commands.robot +++ b/tests/broker-engine/external-commands.robot @@ -3,35 +3,35 @@ Documentation Centreon Broker and Engine progressively add services Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BEEXTCMD1 [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -45,30 +45,30 @@ BEEXTCMD1 IF "${output}" == "((10.0,),)" BREAK END Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD2 [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -82,34 +82,34 @@ BEEXTCMD2 IF "${output}" == "((15.0,),)" BREAK END Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD3 [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Host Check Interval ${use_grpc} host_1 10 + Ctn Change Normal Host Check Interval ${use_grpc} host_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -121,31 +121,31 @@ BEEXTCMD3 IF "${output}" == "((10.0,),)" BREAK END Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD4 [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Host Check Interval ${use_grpc} host_1 15 + Ctn Change Normal Host Check Interval ${use_grpc} host_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -157,32 +157,32 @@ BEEXTCMD4 IF "${output}" == "((15.0,),)" BREAK END Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD5 [Documentation] external command CHANGE_RETRY_SVC_CHECK_INTERVAL on bbdo3.0 [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_RETRY_SVC_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Retry Svc Check Interval ${use_grpc} host_1 service_1 15 + Ctn Change Retry Svc Check Interval ${use_grpc} host_1 service_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -196,30 +196,30 @@ BEEXTCMD5 IF "${output}" == "((15.0,),)" BREAK END Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD6 [Documentation] external command CHANGE_RETRY_SVC_CHECK_INTERVAL on bbdo2.0 [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_RETRY_SVC_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Retry Svc Check Interval ${use_grpc} host_1 service_1 10 + Ctn Change Retry Svc Check Interval ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -233,34 +233,34 @@ BEEXTCMD6 IF "${output}" == "((10.0,),)" BREAK END Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD7 [Documentation] external command CHANGE_RETRY_HOST_CHECK_INTERVAL on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_RETRY_HOST_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Retry Host Check Interval ${use_grpc} host_1 15 + Ctn Change Retry Host Check Interval ${use_grpc} host_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -272,31 +272,31 @@ BEEXTCMD7 IF "${output}" == "((15.0,),)" BREAK END Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD8 [Documentation] external command CHANGE_RETRY_HOST_CHECK_INTERVAL on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_RETRY_HOST_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Retry Host Check Interval ${use_grpc} host_1 10 + Ctn Change Retry Host Check Interval ${use_grpc} host_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -308,32 +308,32 @@ BEEXTCMD8 IF "${output}" == "((10.0,),)" BREAK END Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD9 [Documentation] external command CHANGE_MAX_SVC_CHECK_ATTEMPTS on bbdo3.0 [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_MAX_SVC_CHECK_ATTEMPTS on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Max Svc Check Attempts ${use_grpc} host_1 service_1 15 + Ctn Change Max Svc Check Attempts ${use_grpc} host_1 service_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -357,30 +357,30 @@ BEEXTCMD9 IF "${output}" == "((15,),)" BREAK END Should Be Equal As Strings ${output} ((15,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD10 [Documentation] external command CHANGE_MAX_SVC_CHECK_ATTEMPTS on bbdo2.0 [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_MAX_SVC_CHECK_ATTEMPTS on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Max Svc Check Attempts ${use_grpc} host_1 service_1 10 + Ctn Change Max Svc Check Attempts ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -394,34 +394,34 @@ BEEXTCMD10 IF "${output}" == "((10,),)" BREAK END Should Be Equal As Strings ${output} ((10,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD11 [Documentation] external command CHANGE_MAX_HOST_CHECK_ATTEMPTS on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_MAX_HOST_CHECK_ATTEMPTS on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Max Host Check Attempts ${use_grpc} host_1 15 + Ctn Change Max Host Check Attempts ${use_grpc} host_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -442,31 +442,31 @@ BEEXTCMD11 IF "${output}" == "((15,),)" BREAK END Should Be Equal As Strings ${output} ((15,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD12 [Documentation] external command CHANGE_MAX_HOST_CHECK_ATTEMPTS on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_MAX_HOST_CHECK_ATTEMPTS on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Max Host Check Attempts ${use_grpc} host_1 10 + Ctn Change Max Host Check Attempts ${use_grpc} host_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -479,34 +479,34 @@ BEEXTCMD12 END Should Be Equal As Strings ${output} ((10,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD13 [Documentation] external command CHANGE_HOST_CHECK_TIMEPERIOD on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_HOST_CHECK_TIMEPERIOD on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Host Check Timeperiod ${use_grpc} host_1 24x6 + Ctn Change Host Check Timeperiod ${use_grpc} host_1 24x6 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -519,31 +519,31 @@ BEEXTCMD13 END Should Be Equal As Strings ${output} (('24x6',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD14 [Documentation] external command CHANGE_HOST_CHECK_TIMEPERIOD on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_HOST_CHECK_TIMEPERIOD on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Host Check Timeperiod ${use_grpc} host_1 24x6 + Ctn Change Host Check Timeperiod ${use_grpc} host_1 24x6 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -556,34 +556,34 @@ BEEXTCMD14 END Should Be Equal As Strings ${output} (('24x6',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD15 [Documentation] external command CHANGE_HOST_NOTIFICATION_TIMEPERIOD on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_HOST_NOTIFICATION_TIMEPERIOD on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Host Notification Timeperiod ${use_grpc} host_1 24x7 + Ctn Change Host Notification Timeperiod ${use_grpc} host_1 24x7 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -596,31 +596,31 @@ BEEXTCMD15 END Should Be Equal As Strings ${output} (('24x7',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD16 [Documentation] external command CHANGE_HOST_NOTIFICATION_TIMEPERIOD on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_HOST_NOTIFICATION_TIMEPERIOD on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Host Notification Timeperiod ${use_grpc} host_1 24x6 + Ctn Change Host Notification Timeperiod ${use_grpc} host_1 24x6 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -633,34 +633,34 @@ BEEXTCMD16 END Should Be Equal As Strings ${output} (('24x6',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD17 [Documentation] external command CHANGE_SVC_CHECK_TIMEPERIOD on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_SVC_CHECK_TIMEPERIOD on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Svc Check Timeperiod ${use_grpc} host_1 service_1 24x6 + Ctn Change Svc Check Timeperiod ${use_grpc} host_1 service_1 24x6 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -675,31 +675,31 @@ BEEXTCMD17 END Should Be Equal As Strings ${output} (('24x6',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD18 [Documentation] external command CHANGE_SVC_CHECK_TIMEPERIOD on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_SVC_CHECK_TIMEPERIOD on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Svc Check Timeperiod ${use_grpc} host_1 service_1 24x7 + Ctn Change Svc Check Timeperiod ${use_grpc} host_1 service_1 24x7 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -714,34 +714,34 @@ BEEXTCMD18 END Should Be Equal As Strings ${output} (('24x7',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD19 [Documentation] external command CHANGE_SVC_NOTIFICATION_TIMEPERIOD on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_SVC_NOTIFICATION_TIMEPERIOD on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Svc Notification Timeperiod ${use_grpc} host_1 service_1 24x7 + Ctn Change Svc Notification Timeperiod ${use_grpc} host_1 service_1 24x7 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -756,31 +756,31 @@ BEEXTCMD19 END Should Be Equal As Strings ${output} (('24x7',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD20 [Documentation] external command CHANGE_SVC_NOTIFICATION_TIMEPERIOD on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_SVC_NOTIFICATION_TIMEPERIOD on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Svc Notification Timeperiod ${use_grpc} host_1 service_1 24x6 + Ctn Change Svc Notification Timeperiod ${use_grpc} host_1 service_1 24x6 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -795,35 +795,35 @@ BEEXTCMD20 END Should Be Equal As Strings ${output} (('24x6',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD21 [Documentation] external command DISABLE_HOST_AND_CHILD_NOTIFICATIONS and ENABLE_HOST_AND_CHILD_NOTIFICATIONS on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 2 Log To Console ... external command DISABLE_HOST_AND_CHILD_NOTIFICATIONS and ENABLE_HOST_AND_CHILD_NOTIFICATIONS on bbdo3.0 use_grpc=${use_grpc} ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host And Child Notifications ${use_grpc} host_1 + Ctn Disable Host And Child Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -845,7 +845,7 @@ BEEXTCMD21 END Should Be Equal As Strings ${output} ((0,),) - Enable Host And Child Notifications ${use_grpc} host_1 + Ctn Enable Host And Child Notifications ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' @@ -865,32 +865,32 @@ BEEXTCMD21 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD22 [Documentation] external command DISABLE_HOST_AND_CHILD_NOTIFICATIONS and ENABLE_HOST_AND_CHILD_NOTIFICATIONS on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 2 Log To Console ... external command DISABLE_HOST_AND_CHILD_NOTIFICATIONS and ENABLE_HOST_AND_CHILD_NOTIFICATIONS on bbdo2.0 use_grpc=${use_grpc} ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host And Child Notifications ${use_grpc} host_1 + Ctn Disable Host And Child Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -903,7 +903,7 @@ BEEXTCMD22 END Should Be Equal As Strings ${output} ((0,),) - Enable Host And Child Notifications ${use_grpc} host_1 + Ctn Enable Host And Child Notifications ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' @@ -914,33 +914,33 @@ BEEXTCMD22 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD23 [Documentation] external command DISABLE_HOST_CHECK and ENABLE_HOST_CHECK on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Check ${use_grpc} host_1 + Ctn Disable Host Check ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -971,7 +971,7 @@ BEEXTCMD23 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Check ${use_grpc} host_1 + Ctn Enable Host Check ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT active_checks FROM hosts WHERE name='host_1' @@ -999,30 +999,30 @@ BEEXTCMD23 IF "${output}" == "((1,),)" BREAK END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD24 [Documentation] external command DISABLE_HOST_CHECK and ENABLE_HOST_CHECK on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Check ${use_grpc} host_1 + Ctn Disable Host Check ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1044,7 +1044,7 @@ BEEXTCMD24 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Check ${use_grpc} host_1 + Ctn Enable Host Check ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT active_checks FROM hosts WHERE name='host_1' @@ -1064,33 +1064,33 @@ BEEXTCMD24 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD25 [Documentation] external command DISABLE_HOST_EVENT_HANDLER and ENABLE_HOST_EVENT_HANDLER on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 1 - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Event Handler ${use_grpc} host_1 + Ctn Disable Host Event Handler ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1103,7 +1103,7 @@ BEEXTCMD25 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Event Handler ${use_grpc} host_1 + Ctn Enable Host Event Handler ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT event_handler_enabled FROM hosts WHERE name='host_1' @@ -1114,30 +1114,30 @@ BEEXTCMD25 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD26 [Documentation] external command DISABLE_HOST_EVENT_HANDLER and ENABLE_HOST_EVENT_HANDLER on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Event Handler ${use_grpc} host_1 + Ctn Disable Host Event Handler ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1150,7 +1150,7 @@ BEEXTCMD26 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Event Handler ${use_grpc} host_1 + Ctn Enable Host Event Handler ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT event_handler_enabled FROM hosts WHERE name='host_1' @@ -1161,33 +1161,33 @@ BEEXTCMD26 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD27 [Documentation] external command DISABLE_HOST_FLAP_DETECTION and ENABLE_HOST_FLAP_DETECTION on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Flap Detection ${use_grpc} host_1 + Ctn Disable Host Flap Detection ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1200,7 +1200,7 @@ BEEXTCMD27 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Flap Detection ${use_grpc} host_1 + Ctn Enable Host Flap Detection ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT flap_detection FROM hosts WHERE name='host_1' @@ -1211,30 +1211,30 @@ BEEXTCMD27 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD28 [Documentation] external command DISABLE_HOST_FLAP_DETECTION and ENABLE_HOST_FLAP_DETECTION on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Flap Detection ${use_grpc} host_1 + Ctn Disable Host Flap Detection ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1247,7 +1247,7 @@ BEEXTCMD28 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Flap Detection ${use_grpc} host_1 + Ctn Enable Host Flap Detection ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT flap_detection FROM hosts WHERE name='host_1' @@ -1258,35 +1258,35 @@ BEEXTCMD28 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD29 [Documentation] external command DISABLE_HOST_NOTIFICATIONS and ENABLE_HOST_NOTIFICATIONS on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console ... external command DISABLE_HOST_NOTIFICATIONS and ENABLE_HOST_NOTIFICATIONS on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Notifications ${use_grpc} host_1 + Ctn Disable Host Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1308,7 +1308,7 @@ BEEXTCMD29 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Notifications ${use_grpc} host_1 + Ctn Enable Host Notifications ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' @@ -1328,6 +1328,6 @@ BEEXTCMD29 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END diff --git a/tests/broker-engine/external-commands2.robot b/tests/broker-engine/external-commands2.robot index df65979e9eb..27521daa38d 100644 --- a/tests/broker-engine/external-commands2.robot +++ b/tests/broker-engine/external-commands2.robot @@ -3,35 +3,35 @@ Documentation Centreon Broker and Engine progressively add services Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BEEXTCMD30 [Documentation] external command DISABLE_HOST_NOTIFICATIONS and ENABLE_HOST_NOTIFICATIONS on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console ... external command DISABLE_HOST_NOTIFICATIONS and ENABLE_HOST_NOTIFICATIONS on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Notifications ${use_grpc} host_1 + Ctn Disable Host Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -44,7 +44,7 @@ BEEXTCMD30 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Notifications ${use_grpc} host_1 + Ctn Enable Host Notifications ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' @@ -55,33 +55,33 @@ BEEXTCMD30 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD31 [Documentation] external command DISABLE_HOST_SVC_CHECKS and ENABLE_HOST_SVC_CHECKS on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Svc Checks ${use_grpc} host_1 + Ctn Disable Host Svc Checks ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -116,7 +116,7 @@ BEEXTCMD31 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Svc Checks ${use_grpc} host_1 + Ctn Enable Host Svc Checks ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console @@ -148,30 +148,30 @@ BEEXTCMD31 IF "${output}" == "((1,),)" BREAK END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD32 [Documentation] external command DISABLE_HOST_SVC_CHECKS and ENABLE_HOST_SVC_CHECKS on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Svc Checks ${use_grpc} host_1 + Ctn Disable Host Svc Checks ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -197,7 +197,7 @@ BEEXTCMD32 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Svc Checks ${use_grpc} host_1 + Ctn Enable Host Svc Checks ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console @@ -221,33 +221,33 @@ BEEXTCMD32 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD33 [Documentation] external command DISABLE_HOST_SVC_NOTIFICATIONS and ENABLE_HOST_SVC_NOTIFICATIONS on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Svc Notifications ${use_grpc} host_1 + Ctn Disable Host Svc Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -262,7 +262,7 @@ BEEXTCMD33 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Svc Notifications ${use_grpc} host_1 + Ctn Enable Host Svc Notifications ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console @@ -275,30 +275,30 @@ BEEXTCMD33 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD34 [Documentation] external command DISABLE_HOST_SVC_NOTIFICATIONS and ENABLE_HOST_SVC_NOTIFICATIONS on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Svc Notifications ${use_grpc} host_1 + Ctn Disable Host Svc Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -313,7 +313,7 @@ BEEXTCMD34 END Should Be Equal As Strings ${output} ((0,),) - Enable Host Svc Notifications ${use_grpc} host_1 + Ctn Enable Host Svc Notifications ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console @@ -326,33 +326,33 @@ BEEXTCMD34 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD35 [Documentation] external command DISABLE_PASSIVE_HOST_CHECKS and ENABLE_PASSIVE_HOST_CHECKS on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Passive Host Checks ${use_grpc} host_1 + Ctn Disable Passive Host Checks ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -374,7 +374,7 @@ BEEXTCMD35 END Should Be Equal As Strings ${output} ((0,),) - Enable Passive Host Checks ${use_grpc} host_1 + Ctn Enable Passive Host Checks ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT passive_checks FROM hosts WHERE name='host_1' @@ -394,30 +394,30 @@ BEEXTCMD35 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD36 [Documentation] external command DISABLE_PASSIVE_HOST_CHECKS and ENABLE_PASSIVE_HOST_CHECKS on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Passive Host Checks ${use_grpc} host_1 + Ctn Disable Passive Host Checks ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -430,7 +430,7 @@ BEEXTCMD36 END Should Be Equal As Strings ${output} ((0,),) - Enable Passive Host Checks ${use_grpc} host_1 + Ctn Enable Passive Host Checks ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT passive_checks FROM hosts WHERE name='host_1' @@ -441,33 +441,33 @@ BEEXTCMD36 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD37 [Documentation] external command DISABLE_PASSIVE_SVC_CHECKS and ENABLE_PASSIVE_SVC_CHECKS on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Passive Svc Checks ${use_grpc} host_1 service_1 + Ctn Disable Passive Svc Checks ${use_grpc} host_1 service_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -491,7 +491,7 @@ BEEXTCMD37 END Should Be Equal As Strings ${output} ((0,),) - Enable Passive Svc Checks ${use_grpc} host_1 service_1 + Ctn Enable Passive Svc Checks ${use_grpc} host_1 service_1 FOR ${index} IN RANGE 30 Log To Console @@ -513,30 +513,30 @@ BEEXTCMD37 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD38 [Documentation] external command DISABLE_PASSIVE_SVC_CHECKS and ENABLE_PASSIVE_SVC_CHECKS on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Passive Svc Checks ${use_grpc} host_1 service_1 + Ctn Disable Passive Svc Checks ${use_grpc} host_1 service_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -551,7 +551,7 @@ BEEXTCMD38 END Should Be Equal As Strings ${output} ((0,),) - Enable Passive Svc Checks ${use_grpc} host_1 service_1 + Ctn Enable Passive Svc Checks ${use_grpc} host_1 service_1 FOR ${index} IN RANGE 30 Log To Console @@ -564,33 +564,33 @@ BEEXTCMD38 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD39 [Documentation] external command START_OBSESSING_OVER_HOST and STOP_OBSESSING_OVER_HOST on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Stop Obsessing Over Host ${use_grpc} host_1 + Ctn Stop Obsessing Over Host ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -603,7 +603,7 @@ BEEXTCMD39 END Should Be Equal As Strings ${output} ((0,),) - Start Obsessing Over Host ${use_grpc} host_1 + Ctn Start Obsessing Over Host ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT obsess_over_host FROM hosts WHERE name='host_1' @@ -614,30 +614,30 @@ BEEXTCMD39 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD40 [Documentation] external command START_OBSESSING_OVER_HOST and STOP_OBSESSING_OVER_HOST on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Stop Obsessing Over Host ${use_grpc} host_1 + Ctn Stop Obsessing Over Host ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -650,7 +650,7 @@ BEEXTCMD40 END Should Be Equal As Strings ${output} ((0,),) - Start Obsessing Over Host ${use_grpc} host_1 + Ctn Start Obsessing Over Host ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT obsess_over_host FROM hosts WHERE name='host_1' @@ -661,33 +661,33 @@ BEEXTCMD40 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD41 [Documentation] external command START_OBSESSING_OVER_SVC and STOP_OBSESSING_OVER_SVC on bbdo3.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Stop Obsessing Over Svc ${use_grpc} host_1 service_1 + Ctn Stop Obsessing Over Svc ${use_grpc} host_1 service_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -702,7 +702,7 @@ BEEXTCMD41 END Should Be Equal As Strings ${output} ((0,),) - Start Obsessing Over Svc ${use_grpc} host_1 service_1 + Ctn Start Obsessing Over Svc ${use_grpc} host_1 service_1 FOR ${index} IN RANGE 30 Log To Console @@ -715,30 +715,30 @@ BEEXTCMD41 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD42 [Documentation] external command START_OBSESSING_OVER_SVC and STOP_OBSESSING_OVER_SVC on bbdo2.0 [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Clear Retention FOR ${use_grpc} IN RANGE 0 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Stop Obsessing Over Svc ${use_grpc} host_1 service_1 + Ctn Stop Obsessing Over Svc ${use_grpc} host_1 service_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -753,7 +753,7 @@ BEEXTCMD42 END Should Be Equal As Strings ${output} ((0,),) - Start Obsessing Over Svc ${use_grpc} host_1 service_1 + Ctn Start Obsessing Over Svc ${use_grpc} host_1 service_1 FOR ${index} IN RANGE 30 Log To Console @@ -766,34 +766,34 @@ BEEXTCMD42 END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD_GRPC1 [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 and grpc [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -807,32 +807,32 @@ BEEXTCMD_GRPC1 IF "${output}" == "((10.0,),)" BREAK END Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD_GRPC2 [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 and grpc [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -846,36 +846,36 @@ BEEXTCMD_GRPC2 IF "${output}" == "((15.0,),)" BREAK END Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD_GRPC3 [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 and grpc [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Host Check Interval ${use_grpc} host_1 10 + Ctn Change Normal Host Check Interval ${use_grpc} host_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -887,33 +887,33 @@ BEEXTCMD_GRPC3 IF "${output}" == "((10.0,),)" BREAK END Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD_GRPC4 [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 and grpc [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Host Check Interval ${use_grpc} host_1 15 + Ctn Change Normal Host Check Interval ${use_grpc} host_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -925,39 +925,39 @@ BEEXTCMD_GRPC4 IF "${output}" == "((15.0,),)" BREAK END Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD_REVERSE_GRPC1 [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 and reversed gRPC [Tags] broker engine services extcmd bbdo3 - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Broker Config Output Remove module0 central-module-master-output host - Broker Config Output Remove central centreon-broker-master-rrd host - Broker Config Input Set central central-broker-master-input host 127.0.0.1 - Broker Config Input Set rrd central-rrd-master-input host 127.0.0.1 - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Broker Config Output Remove module0 central-module-master-output host + Ctn Broker Config Output Remove central centreon-broker-master-rrd host + Ctn Broker Config Input Set central central-broker-master-input host 127.0.0.1 + Ctn Broker Config Input Set rrd central-rrd-master-input host 127.0.0.1 + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -971,36 +971,36 @@ BEEXTCMD_REVERSE_GRPC1 IF "${output}" == "((10.0,),)" BREAK END Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD_REVERSE_GRPC2 [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 and grpc reversed [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Broker Config Output Remove module0 central-module-master-output host - Broker Config Output Remove central centreon-broker-master-rrd host - Broker Config Input Set central central-broker-master-input host 127.0.0.1 - Broker Config Input Set rrd central-rrd-master-input host 127.0.0.1 - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Broker Config Output Remove module0 central-module-master-output host + Ctn Broker Config Output Remove central centreon-broker-master-rrd host + Ctn Broker Config Input Set central central-broker-master-input host 127.0.0.1 + Ctn Broker Config Input Set rrd central-rrd-master-input host 127.0.0.1 + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} reversed - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1014,40 +1014,40 @@ BEEXTCMD_REVERSE_GRPC2 IF "${output}" == "((15.0,),)" BREAK END Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD_REVERSE_GRPC3 [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 and grpc reversed [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Config BBDO3 1 - Broker Config Output Remove module0 central-module-master-output host - Broker Config Output Remove central centreon-broker-master-rrd host - Broker Config Input Set central central-broker-master-input host 127.0.0.1 - Broker Config Input Set rrd central-rrd-master-input host 127.0.0.1 - Broker Config Log central core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Config BBDO3 1 + Ctn Broker Config Output Remove module0 central-module-master-output host + Ctn Broker Config Output Remove central centreon-broker-master-rrd host + Ctn Broker Config Input Set central central-broker-master-input host 127.0.0.1 + Ctn Broker Config Input Set rrd central-rrd-master-input host 127.0.0.1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} reversed - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Host Check Interval ${use_grpc} host_1 10 + Ctn Change Normal Host Check Interval ${use_grpc} host_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1059,38 +1059,38 @@ BEEXTCMD_REVERSE_GRPC3 IF "${output}" == "((10.0,),)" BREAK END Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD_REVERSE_GRPC4 [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 and grpc reversed [Tags] broker engine host extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Broker Config Output Remove module0 central-module-master-output host - Broker Config Output Remove central centreon-broker-master-rrd host - Broker Config Input Set central central-broker-master-input host 127.0.0.1 - Broker Config Input Set rrd central-rrd-master-input host 127.0.0.1 - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Broker Config Output Remove module0 central-module-master-output host + Ctn Broker Config Output Remove central centreon-broker-master-rrd host + Ctn Broker Config Input Set central central-broker-master-input host 127.0.0.1 + Ctn Broker Config Input Set rrd central-rrd-master-input host 127.0.0.1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} reversed - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. Sleep 1s - Change Normal Host Check Interval ${use_grpc} host_1 15 + Ctn Change Normal Host Check Interval ${use_grpc} host_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1102,36 +1102,36 @@ BEEXTCMD_REVERSE_GRPC4 IF "${output}" == "((15.0,),)" BREAK END Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEEXTCMD_COMPRESS_GRPC1 [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 and compressed grpc [Tags] broker engine services extcmd - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Compression Output module0 central-module-master-output yes - Change Broker Compression Input central centreon-broker-master-input yes - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Compression Output module0 central-module-master-output yes + Ctn Change Broker Compression Input central centreon-broker-master-input yes + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1145,175 +1145,175 @@ BEEXTCMD_COMPRESS_GRPC1 IF "${output}" == "((10.0,),)" BREAK END Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker END BEATOI11 [Documentation] external command SEND_CUSTOM_HOST_NOTIFICATION with option_number=1 should work [Tags] broker engine host extcmd notification atoi - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - SEND CUSTOM HOST NOTIFICATION host_1 1 admin foobar + Ctn Send Custom Host Notification host_1 1 admin foobar ${content} Create List EXTERNAL COMMAND: SEND_CUSTOM_HOST_NOTIFICATION;host_1;1;admin;foobar - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument notification_option must be an integer between 0 and 7. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEATOI12 [Documentation] external command SEND_CUSTOM_HOST_NOTIFICATION with option_number>7 should fail [Tags] broker engine host extcmd notification atoi - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - SEND CUSTOM HOST NOTIFICATION host_1 8 admin foobar + Ctn Send Custom Host Notification host_1 8 admin foobar ${content} Create List ... Error: could not send custom host notification: '8' must be an integer between 0 and 7 - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument notification_option must be an integer between 0 and 7. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEATOI13 [Documentation] external command Schedule Service Downtime with duration<0 should fail [Tags] broker engine host extcmd atoi - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${date} Get Current Date result_format=epoch - Schedule Service Downtime host_1 service_1 -1 + Ctn Schedule Service Downtime host_1 service_1 -1 ${content} Create List Error: could not schedule downtime : duration - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument duration must be an integer >= 0. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEATOI21 [Documentation] external command ADD_HOST_COMMENT and DEL_HOST_COMMENT should work [Tags] broker engine host extcmd atoi - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug ${start} Get Current Date exclude_millis=True - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ADD HOST COMMENT host_1 1 user comment + Ctn Add Host Comment host_1 1 user comment ${content} Create List ADD_HOST_COMMENT - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} the comment with id:1 was not added. - ${com_id} Find Internal Id ${start} True 30 + ${com_id} Ctn Find Internal Id ${start} True 30 Should Be True ${com_id}>0 Comment id should be a positive integer. - DEL HOST COMMENT ${com_id} - ${result} Find Internal Id ${start} False 30 + Ctn Del Host Comment ${com_id} + ${result} Ctn Find Internal Id ${start} False 30 Should Be True ${result} the comment with id:${com_id} was not deleted. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEATOI22 [Documentation] external command DEL_HOST_COMMENT with comment_id<0 should fail [Tags] broker engine host extcmd atoi - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql debug + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql debug ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ADD HOST COMMENT host_1 1 user comment + Ctn Add Host Comment host_1 1 user comment ${content} Create List ADD_HOST_COMMENT - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} the comment with id:1 was not added. - ${com_id} Find Internal Id ${start} True 30 - DEL HOST COMMENT -1 + ${com_id} Ctn Find Internal Id ${start} True 30 + Ctn Del Host Comment -1 ${content} Create List Error: could not delete comment : comment_id - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} comment_id must be an unsigned integer. - ${result} Find Internal Id ${start} True 30 + ${result} Ctn Find Internal Id ${start} True 30 Should Be True ${result} comment with id:-1 was deleted. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEATOI23 [Documentation] external command ADD_SVC_COMMENT with persistent=0 should work [Tags] broker engine host extcmd atoi - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Log central core error - Broker Config Log central sql error + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central core error + Ctn Broker Config Log central sql error ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${date} Get Current Date result_format=epoch - ADD SVC COMMENT host_1 service_1 0 user comment + Ctn Add Svc Comment host_1 service_1 0 user comment ${content} Create List ADD_SVC_COMMENT - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument persistent_flag must be 0 or 1. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BECUSTOMHOSTVAR [Documentation] external command CHANGE_CUSTOM_HOST_VAR on SNMPVERSION [Tags] broker engine host extcmd atoi - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Broker Config Log central sql trace - Config BBDO3 1 - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Config BBDO3 1 + Ctn Config Broker Sql Output central unified_sql ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${date} Get Current Date result_format=epoch - CHANGE CUSTOM HOST VAR COMMAND host_1 SNMPVERSION 789456 + Ctn Change Custom Host Var Command host_1 SNMPVERSION 789456 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1328,26 +1328,26 @@ BECUSTOMHOSTVAR END Should Be Equal As Strings ${output} (('789456',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BECUSTOMSVCVAR [Documentation] external command CHANGE_CUSTOM_SVC_VAR on CRITICAL [Tags] broker engine host extcmd atoi - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Broker Config Log central sql trace - Config BBDO3 1 - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Config BBDO3 1 + Ctn Config Broker Sql Output central unified_sql ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${date} Get Current Date result_format=epoch - CHANGE CUSTOM SVC VAR COMMAND host_1 service_1 CRITICAL 456123 + Ctn Change Custom Svc Var Command host_1 service_1 CRITICAL 456123 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1362,29 +1362,29 @@ BECUSTOMSVCVAR END Should Be Equal As Strings ${output} (('456123',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BESERVCHECK [Documentation] external command CHECK_SERVICE_RESULT [Tags] broker engine host extcmd atoi - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Broker Config Log central sql trace - Config BBDO3 1 - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Config BBDO3 1 + Ctn Config Broker Sql Output central unified_sql ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String UPDATE services set command_line='toto', next_check=0 where service_id=1 and host_id=1 - Schedule Forced Svc Check host_1 service_1 - ${command_param} Get Command Service Param 1 - ${result} Check Service Check With Timeout + Ctn Schedule Forced Svc Check host_1 service_1 + ${command_param} Ctn Get Command Service Param 1 + ${result} Ctn Check Service Check With Timeout ... host_1 ... service_1 ... 30 @@ -1394,21 +1394,21 @@ BESERVCHECK BEHOSTCHECK [Documentation] external command CHECK_HOST_RESULT [Tags] broker engine host extcmd atoi - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Broker Config Log central sql trace - Config BBDO3 1 - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Config BBDO3 1 + Ctn Config Broker Sql Output central unified_sql ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String UPDATE hosts SET command_line='toto' WHERE name='host_1' - Schedule Forced Host Check host_1 - ${result} Check Host Check With Timeout host_1 30 ${VarRoot}/lib/centreon-engine/check.pl --id 0 + Ctn Schedule Forced Host Check host_1 + ${result} Ctn Check Host Check With Timeout host_1 30 ${VarRoot}/lib/centreon-engine/check.pl --id 0 Should Be True ${result} hosts table not updated diff --git a/tests/broker-engine/hostgroups.robot b/tests/broker-engine/hostgroups.robot index 1590319fad9..4ffda9ae44c 100644 --- a/tests/broker-engine/hostgroups.robot +++ b/tests/broker-engine/hostgroups.robot @@ -3,169 +3,169 @@ Documentation Centreon Broker and Engine add Hostgroup Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Stop Engine Broker And Save Logs +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Stop Engine Broker And Save Logs *** Test Cases *** EBNHG1 [Documentation] New host group with several pollers and connections to DB [Tags] broker engine hostgroup - Config Engine ${3} - Config Broker rrd - Config Broker central - Config Broker module ${3} - - Broker Config Log central sql info - Broker Config Output Set central central-broker-master-sql connections_count 5 - Broker Config Output Set central central-broker-master-perfdata connections_count 5 + Ctn Config Engine ${3} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + + Ctn Broker Config Log central sql info + Ctn Broker Config Output Set central central-broker-master-sql connections_count 5 + Ctn Broker Config Output Set central central-broker-master-perfdata connections_count 5 ${start} Get Current Date - Start Broker - Start Engine - Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] + Ctn Start Broker + Ctn Start engine + Ctn Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] Sleep 3s - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine ${content} Create List ... enabling membership of host 3 to host group 1 on instance 1 ... enabling membership of host 2 to host group 1 on instance 1 ... enabling membership of host 1 to host group 1 on instance 1 - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 45 Should Be True ${result} One of the new host groups not found in logs. EBNHGU1 [Documentation] New host group with several pollers and connections to DB with broker configured with unified_sql [Tags] broker engine hostgroup unified_sql - Config Engine ${3} - Config Broker rrd - Config Broker central - Config Broker module ${3} - - Broker Config Log central sql info - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql connections_count 5 + Ctn Config Engine ${3} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + + Ctn Broker Config Log central sql info + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5 ${start} Get Current Date - Start Broker - Start Engine - Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] + Ctn Start Broker + Ctn Start engine + Ctn Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] Sleep 3s - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine ${content} Create List ... enabling membership of host 3 to host group 1 on instance 1 ... enabling membership of host 2 to host group 1 on instance 1 ... enabling membership of host 1 to host group 1 on instance 1 - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 45 Should Be True ${result} One of the new host groups not found in logs. EBNHGU2 [Documentation] New host group with several pollers and connections to DB with broker configured with unified_sql [Tags] broker engine hostgroup unified_sql - Config Engine ${3} - Config Broker rrd - Config Broker central - Config Broker module ${3} - - Broker Config Log central sql info - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql connections_count 5 - Config BBDO3 3 + Ctn Config Engine ${3} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + + Ctn Broker Config Log central sql info + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5 + Ctn Config BBDO3 3 ${start} Get Current Date - Start Broker - Start Engine - Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] + Ctn Start Broker + Ctn Start engine + Ctn Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] Sleep 3s - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine ${content} Create List ... enabling membership of host 3 to host group 1 on instance 1 ... enabling membership of host 2 to host group 1 on instance 1 - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 45 Should Be True ${result} One of the new host groups not found in logs. EBNHGU3 [Documentation] New host group with several pollers and connections to DB with broker configured with unified_sql [Tags] broker engine hostgroup unified_sql - Config Engine ${4} - Config Broker rrd - Config Broker central - Config Broker module ${4} + Ctn Config Engine ${4} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${4} - Broker Config Log central sql info - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql connections_count 5 - Config BBDO3 4 - Broker Config Log central sql debug + Ctn Broker Config Log central sql info + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5 + Ctn Config BBDO3 4 + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - Start Engine - Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] - Add Host Group ${1} ${1} ["host_21", "host_22", "host_23"] - Add Host Group ${2} ${1} ["host_31", "host_32", "host_33"] - Add Host Group ${3} ${1} ["host_41", "host_42", "host_43"] + Ctn Start Broker + Ctn Start engine + Ctn Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] + Ctn Add Host Group ${1} ${1} ["host_21", "host_22", "host_23"] + Ctn Add Host Group ${2} ${1} ["host_31", "host_32", "host_33"] + Ctn Add Host Group ${3} ${1} ["host_41", "host_42", "host_43"] Sleep 3s - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine - ${result} Check Number Of Relations Between Hostgroup And Hosts 1 12 30 + ${result} Ctn Check Number Of Relations Between Hostgroup And Hosts 1 12 30 Should Be True ${result} We should have 12 hosts members of host 1. - Config Engine Remove Cfg File ${0} hostgroups.cfg + Ctn Config Engine Remove Cfg File ${0} hostgroups.cfg Sleep 3s - Reload Broker - Reload Engine - ${result} Check Number Of Relations Between Hostgroup And Hosts 1 9 30 + Ctn Reload Broker + Ctn Reload Engine + ${result} Ctn Check Number Of Relations Between Hostgroup And Hosts 1 9 30 Should Be True ${result} We should have 12 hosts members of host 1. EBNHG4 [Documentation] New host group with several pollers and connections to DB with broker and rename this hostgroup [Tags] broker engine hostgroup - Config Engine ${3} - Config Broker rrd - Config Broker central - Config Broker module ${3} - - Broker Config Log central sql info - Broker Config Output Set central central-broker-master-sql connections_count 5 - Broker Config Output Set central central-broker-master-perfdata connections_count 5 + Ctn Config Engine ${3} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + + Ctn Broker Config Log central sql info + Ctn Broker Config Output Set central central-broker-master-sql connections_count 5 + Ctn Broker Config Output Set central central-broker-master-perfdata connections_count 5 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s - Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] + Ctn Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine ${content} Create List ... enabling membership of host 3 to host group 1 on instance 1 ... enabling membership of host 2 to host group 1 - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 45 Should Be True ${result} One of the new host groups not found in logs. - Rename Host Group ${0} ${1} test ["host_1", "host_2", "host_3"] + Ctn Rename Host Group ${0} ${1} test ["host_1", "host_2", "host_3"] Sleep 10s ${start} Get Current Date Log To Console Step-1 - Reload Broker + Ctn Reload Broker Log To Console Step0 - Reload Engine + Ctn Reload Engine Log To Console Step1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -182,38 +182,38 @@ EBNHG4 EBNHGU4_${test_label} [Documentation] New host group with several pollers and connections to DB with broker and rename this hostgroup [Tags] broker engine hostgroup - Config Engine ${3} - Config Broker rrd - Config Broker central - Config Broker module ${3} - - Broker Config Log central sql trace - Broker Config Log central lua trace - Broker Config Source Log central 1 - Broker Config Source Log module0 1 - Config Broker Sql Output central unified_sql 5 - Broker Config Output Set central central-broker-unified-sql connections_count 5 - Broker Config Add Lua Output central test-cache ${SCRIPTS}test-dump-groups.lua - Clear Retention + Ctn Config Engine ${3} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central lua trace + Ctn Broker Config Source Log central 1 + Ctn Broker Config Source Log module0 1 + Ctn Config Broker Sql Output central unified_sql 5 + Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5 + Ctn Broker Config Add Lua Output central test-cache ${SCRIPTS}test-dump-groups.lua + Ctn Clear Retention Create File /tmp/lua-engine.log - IF ${Use_BBDO3} Config BBDO3 ${3} + IF ${Use_BBDO3} Ctn Config BBDO3 ${3} ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s - Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] + Ctn Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine ${content} Create List ... enabling membership of host 3 to host group 1 on instance 1 ... enabling membership of host 2 to host group 1 - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 45 Should Be True ${result} One of the new host groups not found in logs. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -240,11 +240,11 @@ EBNHGU4_${test_label} Should Be True len("""${grep_result}""") > 10 hostgroup_1 not found in /tmp/lua-engine.log - Rename Host Group ${0} ${1} test ["host_1", "host_2", "host_3"] + Ctn Rename Host Group ${0} ${1} test ["host_1", "host_2", "host_3"] Sleep 10s - Reload Engine - Reload Broker + Ctn Reload Engine + Ctn Reload Broker Log To Console hostgroup_1 renamed to hostgroup_test @@ -271,9 +271,9 @@ EBNHGU4_${test_label} Should Be True len("""${grep_result}""") > 10 hostgroup_1 not found in /tmp/lua-engine.log # remove hostgroup - Config Engine ${3} - Reload Engine - Reload Broker + Ctn Config Engine ${3} + Ctn Reload Engine + Ctn Reload Broker Log To Console remove hostgroup diff --git a/tests/broker-engine/hosts-with-notes-and-actions.robot b/tests/broker-engine/hosts-with-notes-and-actions.robot index 567125beeb7..e19d4517d24 100644 --- a/tests/broker-engine/hosts-with-notes-and-actions.robot +++ b/tests/broker-engine/hosts-with-notes-and-actions.robot @@ -3,28 +3,28 @@ Documentation Centreon Broker and Engine Creation of hosts with long actio Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** EBSNU1 [Documentation] New hosts with notes_url with more than 2000 characters [Tags] broker engine hosts protobuf - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql ${nu} Evaluate 2000*"X" - Engine Config Set Value In Hosts 0 host_1 notes_url ${nu} - Clear Retention - Start Broker - Start Engine + Ctn Engine Config Set Value In Hosts 0 host_1 notes_url ${nu} + Ctn Clear Retention + Ctn Start Broker + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -39,24 +39,24 @@ EBSNU1 IF "${output}" == "(('${nu}',),)" BREAK END Should Be Equal As Strings ${output} (('${nu}',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EBSAU2 [Documentation] New hosts with action_url with more than 2000 characters [Tags] broker engine hosts protobuf - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql ${au} Evaluate 2000*"Y" - Engine Config Set Value In Hosts 0 host_2 action_url ${au} - Clear Retention - Start Broker - Start Engine + Ctn Engine Config Set Value In Hosts 0 host_2 action_url ${au} + Ctn Clear Retention + Ctn Start Broker + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -71,24 +71,24 @@ EBSAU2 IF "${output}" == "(('${au}',),)" BREAK END Should Be Equal As Strings ${output} (('${au}',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EBSN3 [Documentation] New hosts with notes with more than 500 characters [Tags] broker engine hosts protobuf - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql ${n} Evaluate 500*"Z" - Engine Config Set Value In Hosts 0 host_3 notes ${n} - Clear Retention - Start Broker - Start Engine + Ctn Engine Config Set Value In Hosts 0 host_3 notes ${n} + Ctn Clear Retention + Ctn Start Broker + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -103,5 +103,5 @@ EBSN3 IF "${output}" == "(('${n}',),)" BREAK END Should Be Equal As Strings ${output} (('${n}',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/log-v2_engine.robot b/tests/broker-engine/log-v2_engine.robot index c76c655d24e..84a4037b99c 100644 --- a/tests/broker-engine/log-v2_engine.robot +++ b/tests/broker-engine/log-v2_engine.robot @@ -3,40 +3,40 @@ Documentation Centreon Broker and Engine log_v2 Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** LOGV2EB1 [Documentation] Checking broker sink when log-v2 is enabled and legacy logs are disabled. [Tags] broker engine log-v2 sink broker - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Flush Log module0 0 - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_level_config trace - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Flush Log module0 0 + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_level_config trace + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + ${result1} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 30 Should Be True ${result1} No message telling configuration loaded. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -51,39 +51,39 @@ LOGV2EB1 IF "${output}" == "((1,),)" BREAK END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker LOGV2EBU1 [Documentation] Checking broker sink when log-v2 is enabled and legacy logs are disabled with bbdo3. [Tags] broker engine log-v2 sink broker bbdo3 unified_sql - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Flush Log module0 0 - Broker Config Flush Log central 0 - Broker Config Log central sql trace - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_level_config trace - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Flush Log module0 0 + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Log central sql trace + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_level_config trace + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + ${result1} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 30 Should Be True ${result1} No message telling configuration loaded. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -98,38 +98,38 @@ LOGV2EBU1 IF "${output}" == "((1,),)" BREAK END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker LOGV2DB1 [Documentation] log-v2 disabled old log enabled check broker sink [Tags] broker engine log-v2 sink broker - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Flush Log module0 0 - Broker Config Log central sql trace - Engine Config Set Value ${0} log_legacy_enabled ${1} - Engine Config Set Value ${0} log_v2_enabled ${0} - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Flush Log module0 0 + Ctn Broker Config Log central sql trace + Ctn Engine Config Set Value ${0} log_legacy_enabled ${1} + Ctn Engine Config Set Value ${0} log_v2_enabled ${0} + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. ${content_old} Create List [${pid}] Configuration loaded, main loop starting. - ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 - ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_old} 15 + ${result1} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 + ${result2} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_old} 15 Should Not Be True ${result1} Should Be True ${result2} Old logs should be enabled. @@ -145,36 +145,36 @@ LOGV2DB1 IF "${output}" == "((1,),)" BREAK END Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker LOGV2DB2 [Documentation] log-v2 disabled old log disabled check broker sink [Tags] broker engine log-v2 sink broker - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Flush Log module0 0 - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${0} - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Flush Log module0 0 + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${0} + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. - ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 - ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 + ${result1} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 + ${result2} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 Should Not Be True ${result1} Should Not Be True ${result2} @@ -190,37 +190,37 @@ LOGV2DB2 IF "${output}" == "((0,),)" BREAK END Should Be Equal As Strings ${output} ((0,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker LOGV2EB2 [Documentation] log-v2 enabled old log enabled check broker sink [Tags] broker engine log-v2 sinkbroker - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Flush Log module0 0 - Engine Config Set Value ${0} log_legacy_enabled ${1} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Flush Log module0 0 + Ctn Engine Config Set Value ${0} log_legacy_enabled ${1} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. - ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 - ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 + ${result1} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 + ${result2} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 Should Be True ${result1} Should Be True ${result2} @@ -237,38 +237,38 @@ LOGV2EB2 END Should Be Equal As Strings ${output} ((2,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker LOGV2EBU2 [Documentation] Check Broker sink with log-v2 enabled and legacy log enabled with BBDO3. [Tags] broker engine log-v2 sinkbroker unified_sql bbdo3 - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Flush Log module0 0 - Config BBDO3 ${1} - Engine Config Set Value ${0} log_legacy_enabled ${1} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Flush Log module0 0 + Ctn Config BBDO3 ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${1} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. - ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 - ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 + ${result1} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 + ${result2} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 Should Be True ${result1} Should Be True ${result2} @@ -285,136 +285,136 @@ LOGV2EBU2 END Should Be Equal As Strings ${output} ((2,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker LOGV2EF1 [Documentation] log-v2 enabled old log disabled check logfile sink [Tags] broker engine log-v2 - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Flush Log module0 0 - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Flush Log module0 0 + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 + ${result1} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 Should Be True ${result1} - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker LOGV2DF1 [Documentation] log-v2 disabled old log enabled check logfile sink [Tags] broker engine log-v2 - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Flush Log module0 0 - Engine Config Set Value ${0} log_legacy_enabled ${1} - Engine Config Set Value ${0} log_v2_enabled ${0} - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Flush Log module0 0 + Ctn Engine Config Set Value ${0} log_legacy_enabled ${1} + Ctn Engine Config Set Value ${0} log_v2_enabled ${0} + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 - ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 + ${result1} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 + ${result2} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 Should Be True ${result1} Should Not Be True ${result2} - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker LOGV2DF2 [Documentation] log-v2 disabled old log disabled check logfile sink [Tags] broker engine log-v2 - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Flush Log module0 0 - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${0} - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Flush Log module0 0 + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${0} + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. - ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 - ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 15 + ${result1} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 + ${result2} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 15 Should Not Be True ${result1} Should Not Be True ${result2} - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker LOGV2EF2 [Documentation] log-v2 enabled old log enabled check logfile sink [Tags] broker engine log-v2 - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Flush Log module0 0 - Engine Config Set Value ${0} log_legacy_enabled ${1} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Flush Log module0 0 + Ctn Engine Config Set Value ${0} log_legacy_enabled ${1} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. - ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 - ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 15 + ${result1} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 + ${result2} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 15 Should Be True ${result1} Should Be True ${result2} - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker LOGV2FE2 [Documentation] log-v2 enabled old log enabled check logfile sink [Tags] broker engine log-v2 - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Flush Log module0 0 - Engine Config Set Value ${0} log_legacy_enabled ${1} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Flush Log module0 0 + Ctn Engine Config Set Value ${0} log_legacy_enabled ${1} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_flush_period 0 True - Clear Engine Logs + Ctn Clear Engine Logs ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${pid} Get Process Id e0 ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. @@ -422,7 +422,7 @@ LOGV2FE2 Sleep 2m - ${res} Check Engine Logs Are Duplicated ${engineLog0} ${start} + ${res} Ctn Check Engine Logs Are Duplicated ${engineLog0} ${start} Should Be True ${res} one or other log are not duplicate in logsfile - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/muxer_filter.robot b/tests/broker-engine/muxer_filter.robot index 332cd6163ad..c3f9f462120 100644 --- a/tests/broker-engine/muxer_filter.robot +++ b/tests/broker-engine/muxer_filter.robot @@ -3,54 +3,54 @@ Documentation Centreon Broker and Engine anomaly detection Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** STUPID_FILTER [Documentation] Unified SQL is configured with only the bbdo category as filter. An error is raised by broker and broker should run correctly. [Tags] broker engine filter - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Config Broker rrd - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Output Set Json central central-broker-unified-sql filters {"category": ["bbdo"]} + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config Broker rrd + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Output Set Json central central-broker-unified-sql filters {"category": ["bbdo"]} ${start} Get Current Date - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine ${content} Create List ... The configured write filters for the endpoint 'central-broker-unified-sql' are too restrictive and will be ignored. neb,bbdo,extcmd categories are mandatory. - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} A message telling bad filter should be available. - Stop Engine - Kindly Stop Broker True + Ctn Stop engine + Ctn Kindly Stop Broker True STORAGE_ON_LUA [Documentation] The category 'storage' is applied on the stream connector. Only events of this category should be sent to this stream. [Tags] broker engine filter Remove File /tmp/all_lua_event.log - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Config Broker rrd - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Add Lua Output central test-filter ${SCRIPTS}test-log-all-event.lua - Broker Config Output Set Json central test-filter filters {"category": [ "storage"]} + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config Broker rrd + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Add Lua Output central test-filter ${SCRIPTS}test-log-all-event.lua + Ctn Broker Config Output Set Json central test-filter filters {"category": [ "storage"]} - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Wait Until Created /tmp/all_lua_event.log FOR ${index} IN RANGE 30 @@ -61,35 +61,35 @@ STORAGE_ON_LUA ${grep_res} Grep File /tmp/all_lua_event.log "category":[^3] regexp=True Should Be Empty ${grep_res} Events of category different than 'storage' found. - Stop Engine - Kindly Stop Broker True + Ctn Stop engine + Ctn Kindly Stop Broker True FILTER_ON_LUA_EVENT [Documentation] stream connector with a bad configured filter generate a log error message [Tags] broker engine filter Remove File /tmp/all_lua_event.log - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Config Broker rrd - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Add Lua Output + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config Broker rrd + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Add Lua Output ... central ... test-filter ... ${SCRIPTS}test-log-all-event.lua # We use the possibility of broker to allow to filter by type and not only by category - Broker Config Output Set Json + Ctn Broker Config Output Set Json ... central ... test-filter ... filters ... {"category": [ "storage:pb_metric_mapping"]} - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Wait Until Created /tmp/all_lua_event.log FOR ${index} IN RANGE 30 @@ -107,47 +107,47 @@ FILTER_ON_LUA_EVENT ... All the lines in all_lua_event.log should contain "_type":196620 END - Stop Engine - Kindly Stop Broker True + Ctn Stop engine + Ctn Kindly Stop Broker True BAM_STREAM_FILTER [Documentation] With bbdo version 3.0.1, a BA of type 'worst' with one service is configured. The BA is in critical state, because of its service. we watch its events [Tags] broker engine bam filter - Clear Commands Status - Config Broker module ${1} - Config Broker central - Config Broker rrd - Broker Config Log central core trace - Broker Config Log central config trace - Config BBDO3 ${1} - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Clear Commands Status + Ctn Config Broker module ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central core trace + Ctn Broker Config Log central config trace + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} - Add Bam Config To Broker central + Ctn Create Ba With Services test worst ${svc} + Ctn Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1} Get Command Id 314 + ${cmd_1} Ctn Get Command Id 314 Log To Console service_314 has command id ${cmd_1} - Set Command Status ${cmd_1} 2 - Start Broker True + Ctn Set Command Status ${cmd_1} 2 + Ctn Start Broker True ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # KPI set to critical - Process Service Result Hard host_16 service_314 2 output critical for 314 + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result} Check Ba Status With Timeout test 2 60 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected # monitoring @@ -200,33 +200,33 @@ BAM_STREAM_FILTER ... centreon-bam-reporting event of type 1[0-9a-f]{4} rejected by write filter regexp=True Should Not Be Empty ${grep_res} no rejected neb event - Stop Engine - Kindly Stop Broker True + Ctn Stop engine + Ctn Kindly Stop Broker True UNIFIED_SQL_FILTER [Documentation] With bbdo version 3.0.1, we watch events written or rejected in unified_sql [Tags] broker engine bam filter - Clear Retention - Config Broker module ${1} - Config Broker central - Config Broker rrd - Broker Config Log central core trace - Config BBDO3 ${1} - Config Engine ${1} + Ctn Clear Retention + Ctn Config Broker module ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central core trace + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} ${start} Get Current Date - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # one service set to critical in order to have some events - Process Service Result Hard host_16 service_314 2 output critical for 314 + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # de_pb_service de_pb_service_status de_pb_host de_pb_custom_variable de_pb_log_entry de_pb_host_check @@ -236,53 +236,53 @@ UNIFIED_SQL_FILTER Should Not Be Empty ${grep_res} END - Stop Engine - Kindly Stop Broker True + Ctn Stop engine + Ctn Kindly Stop Broker True CBD_RELOAD_AND_FILTERS [Documentation] We start engine/broker with a classical configuration. All is up and running. Some filters are added to the rrd output and cbd is reloaded. All is still up and running but some events are rejected. Then all is newly set as filter and all events are sent to rrd broker. [Tags] broker engine filter - Clear Retention - Config Broker module ${1} - Config Broker central - Config Broker rrd - Broker Config Log central config trace - Broker Config Log rrd rrd debug - Config BBDO3 ${1} - Config Engine ${1} + Ctn Clear Retention + Ctn Config Broker module ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central config trace + Ctn Broker Config Log rrd rrd debug + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} Log To Console First configuration: all events are sent to rrd. ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. # New configuration - Broker Config Output Set Json central centreon-broker-master-rrd filters {"category": [ "storage"]} + Ctn Broker Config Output Set Json central centreon-broker-master-rrd filters {"category": [ "storage"]} Log To Console Second configuration: only storage events are sent. ${start} Get Current Date - Restart Engine - Reload Broker + Ctn Restart Engine + Ctn Reload Broker #wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No creating endpoint centreon-broker-master-rrd. ${start2} Get Current Date @@ -291,101 +291,101 @@ CBD_RELOAD_AND_FILTERS ... create endpoint TCP for endpoint 'centreon-broker-master-rrd' ... endpoint applier: filters ... storage for endpoint 'centreon-broker-master-rrd' applied. - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "storage" ${content} Create List rrd event of type .* rejected by write filter - ${result} Find Regex In Log With Timeout ${centralLog} ${start2} ${content} 120 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start2} ${content} 120 Should Be True ${result} No event rejected by the rrd output whereas only storage category is enabled. Log To Console Third configuration: all events are sent. # New configuration - Broker Config Output Remove central centreon-broker-master-rrd filters + Ctn Broker Config Output Remove central centreon-broker-master-rrd filters ${start} Get Current Date - Restart Engine - Reload Broker + Ctn Restart Engine + Ctn Reload Broker # wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No creating endpoint centreon-broker-master-rrd. ${start2} Get Current Date # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. ${start} Get Current Date # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd doesn't filter anything ${content} Create List rrd event of type .* rejected by write filter - ${result} Find Regex In Log With Timeout ${centralLog} ${start2} ${content} 30 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start2} ${content} 30 Should Be Equal As Strings ... ${result[0]} ... False ... Some events are rejected by the rrd output whereas all categories are enabled. - Stop Engine - Kindly Stop Broker True + Ctn Stop engine + Ctn Kindly Stop Broker True CBD_RELOAD_AND_FILTERS_WITH_OPR [Documentation] We start engine/broker with an almost classical configuration, just the connection between cbd central and cbd rrd is reversed with one peer retention. All is up and running. Some filters are added to the rrd output and cbd is reloaded. All is still up and running but some events are rejected. Then all is newly set as filter and all events are sent to rrd broker. [Tags] broker engine filter - Clear Retention - Config Broker module ${1} - Config Broker central - Config Broker rrd - Broker Config Output Remove central centreon-broker-master-rrd host - Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes - Broker Config Input Set rrd central-rrd-master-input host localhost - Broker Config Log central config trace - Broker Config Log rrd rrd debug - Config BBDO3 ${1} - Config Engine ${1} + Ctn Clear Retention + Ctn Config Broker module ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Output Remove central centreon-broker-master-rrd host + Ctn Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes + Ctn Broker Config Input Set rrd central-rrd-master-input host localhost + Ctn Broker Config Log central config trace + Ctn Broker Config Log rrd rrd debug + Ctn Config BBDO3 ${1} + Ctn Config Engine ${1} Log To Console First configuration: all events are sent to rrd. ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. # New configuration - Broker Config Output Set Json central centreon-broker-master-rrd filters {"category": [ "storage"]} + Ctn Broker Config Output Set Json central centreon-broker-master-rrd filters {"category": [ "storage"]} Log To Console Second configuration: only storage events are sent. ${start} Get Current Date - Restart Engine - Reload Broker + Ctn Restart Engine + Ctn Reload Broker #wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No creating endpoint centreon-broker-master-rrd. ${start2} Get Current Date @@ -394,52 +394,52 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR ... create endpoint TCP for endpoint 'centreon-broker-master-rrd' ... endpoint applier: filters ... storage for endpoint 'centreon-broker-master-rrd' applied. - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "storage" ${content} Create List rrd event of type .* rejected by write filter - ${result} Find Regex In Log With Timeout ${centralLog} ${start2} ${content} 120 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start2} ${content} 120 Should Be True ${result} No event rejected by the rrd output whereas only storage category is enabled. Log To Console Third configuration: all events are sent. # New configuration - Broker Config Output Remove central centreon-broker-master-rrd filters + Ctn Broker Config Output Remove central centreon-broker-master-rrd filters ${start} Get Current Date - Restart Engine - Reload Broker + Ctn Restart Engine + Ctn Reload Broker #wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No creating endpoint centreon-broker-master-rrd. ${start2} Get Current Date # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd doesn't filter anything ${content} Create List rrd event of type .* rejected by write filter - ${result} Find Regex In Log With Timeout ${centralLog} ${start2} ${content} 30 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start2} ${content} 30 Should Be Equal As Strings ... ${result[0]} ... False ... Some events are rejected by the rrd output whereas all categories are enabled. - Stop Engine - Kindly Stop Broker True + Ctn Stop engine + Ctn Kindly Stop Broker True SEVERAL_FILTERS_ON_LUA_EVENT [Documentation] Two stream connectors with different filters are configured. @@ -447,37 +447,37 @@ SEVERAL_FILTERS_ON_LUA_EVENT Remove File /tmp/all_lua_event.log Remove File /tmp/all_lua_event-bis.log - Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Config Broker rrd - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Add Lua Output + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config Broker rrd + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Add Lua Output ... central ... test-filter ... ${SCRIPTS}test-log-all-event.lua - Broker Config Add Lua Output + Ctn Broker Config Add Lua Output ... central ... test-filter-bis ... ${SCRIPTS}test-log-all-event-bis.lua # We use the possibility of broker to allow to filter by type and not only by category - Broker Config Output Set Json + Ctn Broker Config Output Set Json ... central ... test-filter ... filters ... {"category": [ "storage:pb_metric_mapping"]} - Broker Config Output Set Json + Ctn Broker Config Output Set Json ... central ... test-filter-bis ... filters ... {"category": [ "neb:ServiceStatus"]} - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine Wait Until Created /tmp/all_lua_event.log FOR ${index} IN RANGE 30 @@ -510,5 +510,5 @@ SEVERAL_FILTERS_ON_LUA_EVENT ... "_type":65565 ... All the lines in all_lua_event-bis.log should contain "_type":65565 END - Stop Engine - Kindly Stop Broker True + Ctn Stop engine + Ctn Kindly Stop Broker True diff --git a/tests/broker-engine/notification-unstable.robot b/tests/broker-engine/notification-unstable.robot index ab91042be43..7cc373e462b 100644 --- a/tests/broker-engine/notification-unstable.robot +++ b/tests/broker-engine/notification-unstable.robot @@ -3,347 +3,347 @@ Documentation Centreon notification Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** not1 [Documentation] This test case configures a single service and verifies that a notification is sent when the service is in a non-OK state. [Tags] broker engine services hosts notification - Config Engine ${1} ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 notification_options w,c,r - Engine Config Set Value In Services 0 service_1 notifications_enabled 1 - Engine Config Set Value In Services 0 service_1 notification_period 24x7 - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 notification_options w,c,r + Ctn Engine Config Set Value In Services 0 service_1 notifications_enabled 1 + Ctn Engine Config Set Value In Services 0 service_1 notification_period 24x7 + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 90 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 90 Should Be True ${result} check_for_external_commands() should be available. ## Time to set the service to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Service Check Result host_1 service_1 2 critical + Ctn Process Service Check Result host_1 service_1 2 critical Sleep 1s END - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 HARD Should Be True ${result} Service (host_1,service_1) should be CRITICAL HARD ${content} Create List SERVICE NOTIFICATION: John_Doe;host_1;service_1;CRITICAL;command_notif;critical - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The notification is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not2 [Documentation] This test case configures a single service and verifies that a recovery notification is sent after a service recovers from a non-OK state. [Tags] broker engine services hosts notification - Config Engine ${1} ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 notification_options w,c,r - Engine Config Set Value In Services 0 service_1 notifications_enabled 1 - Engine Config Set Value In Services 0 service_1 notification_period 24x7 - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 notification_options w,c,r + Ctn Engine Config Set Value In Services 0 service_1 notifications_enabled 1 + Ctn Engine Config Set Value In Services 0 service_1 notification_period 24x7 + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 90 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 90 Should Be True ${result} check_for_external_commands() should be available. ## Time to set the service to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Service Check Result host_1 service_1 2 critical + Ctn Process Service Check Result host_1 service_1 2 critical Sleep 1s END - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 HARD Should Be True ${result} Service (host_1,service_1) should be CRITICAL HARD ${content} Create List SERVICE NOTIFICATION: John_Doe;host_1;service_1;CRITICAL;command_notif;critical - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No notification has been sent concerning a critical service ## Time to set the service to UP hard FOR ${i} IN RANGE ${3} - Process Service Check Result host_1 service_1 0 ok + Ctn Process Service Check Result host_1 service_1 0 ok Sleep 1s END - ${result} Check Service Status With Timeout host_1 service_1 ${0} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${0} 60 HARD Should Be True ${result} Service (host_1,service_1) should be CRITICAL HARD ${content} Create List SERVICE NOTIFICATION: John_Doe;host_1;service_1;RECOVERY (OK);command_notif;ok - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The notification recovery is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not3 [Documentation] This test case configures a single service and verifies that a non-OK notification is sent after the service exits downtime. [Tags] broker engine services hosts notification - Config Engine ${1} ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 notification_options w,c,r - Engine Config Set Value In Services 0 service_1 notifications_enabled 1 - Engine Config Set Value In Services 0 service_1 notification_period 24x7 - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 notification_options w,c,r + Ctn Engine Config Set Value In Services 0 service_1 notifications_enabled 1 + Ctn Engine Config Set Value In Services 0 service_1 notification_period 24x7 + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands() should be available. # It's time to schedule a downtime - Schedule Service Downtime host_1 service_1 ${60} + Ctn Schedule Service Downtime host_1 service_1 ${60} - ${result} Check Number Of Downtimes ${1} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${1} ${start} ${60} Should Be True ${result} We should have 1 downtime enabled. ## Time to set the service to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Service Check Result host_1 service_1 2 critical + Ctn Process Service Check Result host_1 service_1 2 critical Sleep 10s END # Let's wait for the external command check start ${content} Create List SERVICE DOWNTIME ALERT: host_1;service_1;STOPPED; Service has exited from a period of scheduled downtime - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The downtime has not finished . - Process Service Check Result host_1 service_1 2 critical + Ctn Process Service Check Result host_1 service_1 2 critical ${content} Create List SERVICE NOTIFICATION: John_Doe;host_1;service_1;CRITICAL;command_notif;critical - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The critical notification is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not4 [Documentation] This test case configures a single service and verifies that a non-OK notification is sent when the acknowledgement is completed. [Tags] broker engine services hosts notification - Config Engine ${1} ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 notification_options w,c,r - Engine Config Set Value In Services 0 service_1 notifications_enabled 1 - Engine Config Set Value In Services 0 service_1 notification_period 24x7 - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 notification_options w,c,r + Ctn Engine Config Set Value In Services 0 service_1 notifications_enabled 1 + Ctn Engine Config Set Value In Services 0 service_1 notification_period 24x7 + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands() should be available. # Time to set the service to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Service Check Result host_1 service_1 2 critical + Ctn Process Service Check Result host_1 service_1 2 critical Sleep 1s END - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 HARD Should Be True ${result} Service (host_1,service_1) should be CRITICAL HARD # Acknowledge the service with critical status - Acknowledge Service Problem host_1 service_1 STICKY + Ctn Acknowledge Service Problem host_1 service_1 STICKY # Let's wait for the external command check start ${content} Create List ACKNOWLEDGE_SVC_PROBLEM;host_1;service_1;2;0;0;admin;Service (host_1,service_1) acknowledged - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands() should be available. - Process Service Check Result host_1 service_1 0 ok + Ctn Process Service Check Result host_1 service_1 0 ok - ${result} Check Service Status With Timeout host_1 service_1 ${0} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${0} 60 HARD Should Be True ${result} Service (host_1,service_1) should be CRITICAL HARD ${content} Create List SERVICE NOTIFICATION: John_Doe;host_1;service_1;RECOVERY (OK);command_notif;ok - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The recovery notification for service_1 is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not5 [Documentation] This test case configures two services with two different users being notified when the services transition to a critical state. [Tags] broker engine services hosts notification - Config Engine ${1} ${2} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 notification_options w,c,r - Engine Config Set Value In Services 0 service_1 notifications_enabled 1 - Engine Config Set Value In Services 0 service_1 notification_period 24x7 - Engine Config Set Value In Hosts 0 host_2 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_2 notification_options d,r - Engine Config Set Value In Hosts 0 host_2 contacts U2 - Engine Config Set Value In Services 0 service_2 contacts U2 - Engine Config Set Value In Services 0 service_2 notification_options w,c,r - Engine Config Set Value In Services 0 service_2 notifications_enabled 1 - Engine Config Set Value In Services 0 service_2 notification_period 24x7 - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif - Engine Config Set Value In Contacts 0 U2 host_notification_commands command_notif - Engine Config Set Value In Contacts 0 U2 service_notification_commands command_notif + Ctn Config Engine ${1} ${2} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 notification_options w,c,r + Ctn Engine Config Set Value In Services 0 service_1 notifications_enabled 1 + Ctn Engine Config Set Value In Services 0 service_1 notification_period 24x7 + Ctn Engine Config Set Value In Hosts 0 host_2 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_2 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_2 contacts U2 + Ctn Engine Config Set Value In Services 0 service_2 contacts U2 + Ctn Engine Config Set Value In Services 0 service_2 notification_options w,c,r + Ctn Engine Config Set Value In Services 0 service_2 notifications_enabled 1 + Ctn Engine Config Set Value In Services 0 service_2 notification_period 24x7 + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 U2 host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 U2 service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands() should be available. ## Time to set the service to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Service Check Result host_1 service_1 2 critical + Ctn Process Service Check Result host_1 service_1 2 critical Sleep 1s - Process Service Check Result host_2 service_2 2 critical + Ctn Process Service Check Result host_2 service_2 2 critical Sleep 1s END - ${result} Check Service Status With Timeout host_1 service_1 ${2} 70 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 70 HARD Should Be True ${result} Service (host_1,service_1) should be CRITICAL HARD - ${result} Check Service Status With Timeout host_2 service_2 ${2} 70 HARD + ${result} Ctn Check Service Status With Timeout host_2 service_2 ${2} 70 HARD Should Be True ${result} Service (host_2,service_2) should be CRITICAL HARD ${content} Create List SERVICE NOTIFICATION: John_Doe;host_1;service_1;CRITICAL;command_notif;critical - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The critical notification of service_1 is not sent ${content} Create List SERVICE NOTIFICATION: U2;host_2;service_2;CRITICAL;command_notif;critical - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The critical notification of service_2 is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not6 [Documentation] This test case validates the behavior when the notification time period is set to null. [Tags] broker engine services hosts notification - Config Engine ${1} ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 notification_options w,c,r - Engine Config Set Value In Services 0 service_1 notifications_enabled 1 - Engine Config Set Value In Services 0 service_1 notification_period 24x7 - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 notification_options w,c,r + Ctn Engine Config Set Value In Services 0 service_1 notifications_enabled 1 + Ctn Engine Config Set Value In Services 0 service_1 notification_period 24x7 + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands() should be available. ## Time to set the service to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Service Check Result host_1 service_1 2 critical + Ctn Process Service Check Result host_1 service_1 2 critical Sleep 1s END - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 HARD Should Be True ${result} Service (host_2,service_2) should be CRITICAL HARD ${content} Create List SERVICE NOTIFICATION: John_Doe;host_1;service_1;CRITICAL;command_notif;critical - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The critical notification of service_1 is not sent - Engine Config Replace Value In Services 0 service_1 notification_period none + Ctn Engine Config Replace Value In Services 0 service_1 notification_period none Sleep 5s ${start} Get Current Date - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine ## Time to set the service to UP hard FOR ${i} IN RANGE ${3} - Process Service Check Result host_1 service_1 0 ok + Ctn Process Service Check Result host_1 service_1 0 ok Sleep 1s END ${content} Create List This notifier shouldn't have notifications sent out at this time - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The timeperiod is not working - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not7 [Documentation] This test case simulates a host alert scenario. [Tags] broker engine host hosts notification - Config Engine ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 notification_period 24x7 - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 notification_period 24x7 + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -351,40 +351,40 @@ not7 ## Time to set the host to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Host Check Result host_1 1 host_1 DOWN + Ctn Process Host Check Result host_1 1 host_1 DOWN Sleep 1s END FOR ${i} IN RANGE ${4} - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END ${content} Create List HOST ALERT: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} the host alert is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not8 [Documentation] This test validates the critical host notification. [Tags] broker engine host notification - Config Engine ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 notification_period 24x7 - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 notification_period 24x7 + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -392,40 +392,40 @@ not8 ## Time to set the host to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Host Check Result host_1 1 host_1 DOWN + Ctn Process Host Check Result host_1 1 host_1 DOWN Sleep 1s END FOR ${i} IN RANGE ${4} - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END ${content} Create List HOST NOTIFICATION: John_Doe;host_1;DOWN;command_notif;host_1 DOWN; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The down notification of host_1 is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not9 [Documentation] This test case configures a single host and verifies that a recovery notification is sent after the host recovers from a non-OK state. [Tags] broker engine host notification - Config Engine ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 notification_period 24x7 - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 notification_period 24x7 + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -433,40 +433,40 @@ not9 ## Time to set the host to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Host Check Result host_1 1 host_1 DOWN + Ctn Process Host Check Result host_1 1 host_1 DOWN Sleep 1s END FOR ${i} IN RANGE ${4} - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END ${content} Create List HOST NOTIFICATION: John_Doe;host_1;RECOVERY (UP);command_notif;Host - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The recovery notification of host_1 is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not10 [Documentation] This test case involves scheduling downtime on a down host. After the downtime is finished and the host is still critical, we should receive a critical notification. [Tags] broker engine host notification - Config Engine ${1} ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 notification_period 24x7 - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 notification_period 24x7 + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -474,52 +474,52 @@ not10 ## Time to set the host to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Host Check Result host_1 0 host_1 UP + Ctn Process Host Check Result host_1 0 host_1 UP Sleep 1s END FOR ${i} IN RANGE ${4} - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END - Schedule Host Downtime ${0} host_1 ${3600} + Ctn Schedule Host Downtime ${0} host_1 ${3600} Sleep 10s FOR ${i} IN RANGE ${3} - Process Host Check Result host_1 1 host_1 DOWN + Ctn Process Host Check Result host_1 1 host_1 DOWN Sleep 1s END - Delete Host Downtimes ${0} host_1 + Ctn Delete Host Downtimes ${0} host_1 ${content} Create List HOST NOTIFICATION: John_Doe;host_1;DOWN;command_notif;host_1 DOWN; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The down notification of host_1 is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not11 [Documentation] This test case involves scheduling downtime on a down host that already had a critical notification. After putting it in the UP state when the downtime is finished and the host is UP, we should receive a recovery notification. [Tags] broker engine host notification - Config Engine ${1} ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 notification_period 24x7 - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 notification_period 24x7 + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -527,242 +527,242 @@ not11 ## Time to set the host to UP HARD. FOR ${i} IN RANGE ${3} - Process Host Check Result host_1 1 host_1 DOWN + Ctn Process Host Check Result host_1 1 host_1 DOWN Sleep 1s END FOR ${i} IN RANGE ${4} - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END - Schedule Host Downtime ${0} host_1 ${3600} + Ctn Schedule Host Downtime ${0} host_1 ${3600} Sleep 10s ## Time to set the host to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Host Check Result host_1 0 host_1 UP + Ctn Process Host Check Result host_1 0 host_1 UP Sleep 1s END FOR ${i} IN RANGE ${4} - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END - Delete Host Downtimes ${0} host_1 + Ctn Delete Host Downtimes ${0} host_1 ${content} Create List HOST NOTIFICATION: John_Doe;host_1;RECOVERY (UP);command_notif;Host - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The recovery notification of host_1 is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not12 [Documentation] This test case involves configuring one service and checking that three alerts are sent for it. [Tags] broker engine services hosts notification - Config Engine ${1} ${1} ${1} - Config Notifications - Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 - Engine Config Set Value In Hosts 0 host_1 notification_options d,r - Engine Config Set Value In Hosts 0 host_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 notification_options w,c,r - Engine Config Set Value In Services 0 service_1 notifications_enabled 1 - Engine Config Set Value In Services 0 service_1 notification_period 24x7 - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Config Engine ${1} ${1} ${1} + Ctn Config Notifications + Ctn Engine Config Set Value In Hosts 0 host_1 notifications_enabled 1 + Ctn Engine Config Set Value In Hosts 0 host_1 notification_options d,r + Ctn Engine Config Set Value In Hosts 0 host_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 notification_options w,c,r + Ctn Engine Config Set Value In Services 0 service_1 notifications_enabled 1 + Ctn Engine Config Set Value In Services 0 service_1 notification_period 24x7 + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands() is not available. ## Time to set the service to CRITICAL HARD. FOR ${i} IN RANGE ${3} - Process Service Check Result host_1 service_1 2 critical + Ctn Process Service Check Result host_1 service_1 2 critical Sleep 1s END - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 HARD Should Be True ${result} Service (host_1,service_1) should be CRITICAL HARD ${content} Create List SERVICE ALERT: host_1;service_1;CRITICAL;SOFT;1;critical - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The first service alert SOFT1 is not sent ${content} Create List SERVICE ALERT: host_1;service_1;CRITICAL;SOFT;2;critical - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The second service alert SOFT2 is not sent ${content} Create List SERVICE ALERT: host_1;service_1;CRITICAL;HARD;3;critical - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The third service alert hard is not sent - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker not13 [Documentation] Escalations [Tags] broker engine services hosts notification - Config Engine ${1} ${2} ${1} - Engine Config Set Value 0 interval_length 10 True - Config Engine Add Cfg File ${0} servicegroups.cfg - Add Service Group ${0} ${1} ["host_1","service_1", "host_2","service_2"] - Config Notifications - Config Escalations - - Add Contact Group ${0} ${1} ["U1"] - Add Contact Group ${0} ${2} ["U2","U3"] - Add Contact Group ${0} ${3} ["U4"] - - Create Escalations File 0 1 servicegroup_1 contactgroup_2 - Create Escalations File 0 2 servicegroup_1 contactgroup_3 - - Engine Config Set Value In Escalations 0 esc1 first_notification 2 - Engine Config Set Value In Escalations 0 esc1 last_notification 2 - Engine Config Set Value In Escalations 0 esc1 notification_interval 1 - Engine Config Set Value In Escalations 0 esc2 first_notification 3 - Engine Config Set Value In Escalations 0 esc2 last_notification 0 - Engine Config Set Value In Escalations 0 esc2 notification_interval 1 + Ctn Config Engine ${1} ${2} ${1} + Ctn Engine Config Set Value 0 interval_length 10 True + Ctn Config Engine Add Cfg File ${0} servicegroups.cfg + Ctn Add Service Group ${0} ${1} ["host_1","service_1", "host_2","service_2"] + Ctn Config Notifications + Ctn Config Escalations + + Ctn Add Contact Group ${0} ${1} ["U1"] + Ctn Add Contact Group ${0} ${2} ["U2","U3"] + Ctn Add Contact Group ${0} ${3} ["U4"] + + Ctn Create Escalations File 0 1 servicegroup_1 contactgroup_2 + Ctn Create Escalations File 0 2 servicegroup_1 contactgroup_3 + + Ctn Engine Config Set Value In Escalations 0 esc1 first_notification 2 + Ctn Engine Config Set Value In Escalations 0 esc1 last_notification 2 + Ctn Engine Config Set Value In Escalations 0 esc1 notification_interval 1 + Ctn Engine Config Set Value In Escalations 0 esc2 first_notification 3 + Ctn Engine Config Set Value In Escalations 0 esc2 last_notification 0 + Ctn Engine Config Set Value In Escalations 0 esc2 notification_interval 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands() is not available. - Service Check + Ctn Service Check # Let's wait for the first notification of the user U1 ${content} Create List SERVICE NOTIFICATION: U1;host_1;service_1;CRITICAL;command_notif;critical_0; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The first notification of U1 is not sent # Let's wait for the first notification of the contact group 1 ${content} Create List SERVICE NOTIFICATION: U1;host_2;service_2;CRITICAL;command_notif;critical_0; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} The first notification of contact group 1 is not sent - Service Check + Ctn Service Check # Let's wait for the first notification of the contact group 2 U3 ET U2 ${content} Create List SERVICE NOTIFICATION: U2;host_1;service_1;CRITICAL;command_notif;critical_0; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 90 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 90 Should Be True ${result} The first notification of U2 is not sent ${content} Create List SERVICE NOTIFICATION: U3;host_1;service_1;CRITICAL;command_notif;critical_0; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 90 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 90 Should Be True ${result} The first notification of U3 is not sent - Service Check + Ctn Service Check # Let's wait for the second notification of the contact group 2 U3 ET U2 ${content} Create List SERVICE NOTIFICATION: U2;host_2;service_2;CRITICAL;command_notif;critical_0; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 90 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 90 Should Be True ${result} The second notification of U2 is not sent ${content} Create List SERVICE NOTIFICATION: U3;host_2;service_2;CRITICAL;command_notif;critical_0; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 90 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 90 Should Be True ${result} The second notification of U3 is not sent - Service Check + Ctn Service Check # Let's wait for the first notification of the contact group 3 U4 ${content} Create List SERVICE NOTIFICATION: U4;host_1;service_1;CRITICAL;command_notif;critical_0; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 90 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 90 Should Be True ${result} The first notification of U4 is not sent ${content} Create List SERVICE NOTIFICATION: U4;host_2;service_2;CRITICAL;command_notif;critical_0; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 90 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 90 Should Be True ${result} The second notification of U4 is not sent *** Keywords *** -Config Notifications +Ctn Config Notifications [Documentation] Configuring engine notification settings. - Engine Config Set Value 0 enable_notifications 1 True - Engine Config Set Value 0 execute_host_checks 1 True - Engine Config Set Value 0 execute_service_checks 1 True - Engine Config Set Value 0 log_notifications 1 True - Engine Config Set Value 0 log_level_notifications trace True - Config Broker central - Config Broker rrd - Config Broker module ${1} - Broker Config Add Item module0 bbdo_version 3.0.1 - Broker Config Add Item rrd bbdo_version 3.0.1 - Broker Config Add Item central bbdo_version 3.0.1 - Broker Config Flush Log central 0 - Broker Config Log central core error - Broker Config Log central tcp error - Broker Config Log central sql error - Config Broker Sql Output central unified_sql - Config Broker Remove Rrd Output central - Clear Retention - Config Engine Add Cfg File ${0} contacts.cfg - Config Engine Add Cfg File ${0} contactgroups.cfg - Config Engine Add Cfg File ${0} escalations.cfg - Engine Config Add Command + Ctn Engine Config Set Value 0 enable_notifications 1 True + Ctn Engine Config Set Value 0 execute_host_checks 1 True + Ctn Engine Config Set Value 0 execute_service_checks 1 True + Ctn Engine Config Set Value 0 log_notifications 1 True + Ctn Engine Config Set Value 0 log_level_notifications trace True + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Broker Config Add Item module0 bbdo_version 3.0.1 + Ctn Broker Config Add Item rrd bbdo_version 3.0.1 + Ctn Broker Config Add Item central bbdo_version 3.0.1 + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Log central core error + Ctn Broker Config Log central tcp error + Ctn Broker Config Log central sql error + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker Remove Rrd Output central + Ctn Clear Retention + Ctn Config Engine Add Cfg File ${0} contacts.cfg + Ctn Config Engine Add Cfg File ${0} contactgroups.cfg + Ctn Config Engine Add Cfg File ${0} escalations.cfg + Ctn Engine Config Add Command ... 0 ... command_notif ... /usr/bin/true -Config Escalations +Ctn Config Escalations [Documentation] Configuring engine notification escalations settings. - Engine Config Set Value In Services 0 service_1 notification_options c - Engine Config Set Value In Services 0 service_1 notifications_enabled 1 - Engine Config Set Value In Services 0 service_1 first_notification_delay 0 - Engine Config Set Value In Services 0 service_1 notification_period 24x7 - Engine Config Set Value In Services 0 service_1 contact_groups contactgroup_1 - Engine Config Replace Value In Services 0 service_1 active_checks_enabled 0 - Engine Config Replace Value In Services 0 service_1 max_check_attempts 1 - Engine Config Replace Value In Services 0 service_1 retry_interval 1 - Engine Config Set Value In Services 0 service_1 notification_interval 1 - Engine Config Replace Value In Services 0 service_1 check_interval 1 - Engine Config Replace Value In Services 0 service_1 check_command command_4 - Engine Config Set Value In Services 0 service_2 contact_groups contactgroup_1 - Engine Config Replace Value In Services 0 service_2 max_check_attempts 1 - Engine Config Set Value In Services 0 service_2 notification_options c - Engine Config Set Value In Services 0 service_2 notifications_enabled 1 - Engine Config Set Value In Services 0 service_2 first_notification_delay 0 - Engine Config Set Value In Services 0 service_2 notification_period 24x7 - Engine Config Set Value In Services 0 service_2 notification_interval 1 - Engine Config Replace Value In Services 0 service_2 first_notification_delay 0 - Engine Config Replace Value In Services 0 service_2 check_interval 1 - Engine Config Replace Value In Services 0 service_2 active_checks_enabled 0 - Engine Config Replace Value In Services 0 service_2 retry_interval 1 - Engine Config Replace Value In Services 0 service_2 check_command command_4 - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif - -Service Check + Ctn Engine Config Set Value In Services 0 service_1 notification_options c + Ctn Engine Config Set Value In Services 0 service_1 notifications_enabled 1 + Ctn Engine Config Set Value In Services 0 service_1 first_notification_delay 0 + Ctn Engine Config Set Value In Services 0 service_1 notification_period 24x7 + Ctn Engine Config Set Value In Services 0 service_1 contact_groups contactgroup_1 + Ctn Engine Config Replace Value In Services 0 service_1 active_checks_enabled 0 + Ctn Engine Config Replace Value In Services 0 service_1 max_check_attempts 1 + Ctn Engine Config Replace Value In Services 0 service_1 retry_interval 1 + Ctn Engine Config Set Value In Services 0 service_1 notification_interval 1 + Ctn Engine Config Replace Value In Services 0 service_1 check_interval 1 + Ctn Engine Config Replace Value In Services 0 service_1 check_command command_4 + Ctn Engine Config Set Value In Services 0 service_2 contact_groups contactgroup_1 + Ctn Engine Config Replace Value In Services 0 service_2 max_check_attempts 1 + Ctn Engine Config Set Value In Services 0 service_2 notification_options c + Ctn Engine Config Set Value In Services 0 service_2 notifications_enabled 1 + Ctn Engine Config Set Value In Services 0 service_2 first_notification_delay 0 + Ctn Engine Config Set Value In Services 0 service_2 notification_period 24x7 + Ctn Engine Config Set Value In Services 0 service_2 notification_interval 1 + Ctn Engine Config Replace Value In Services 0 service_2 first_notification_delay 0 + Ctn Engine Config Replace Value In Services 0 service_2 check_interval 1 + Ctn Engine Config Replace Value In Services 0 service_2 active_checks_enabled 0 + Ctn Engine Config Replace Value In Services 0 service_2 retry_interval 1 + Ctn Engine Config Replace Value In Services 0 service_2 check_command command_4 + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + +Ctn Service Check FOR ${i} IN RANGE ${4} - Process Service Check Result host_1 service_1 2 critical + Ctn Process Service Check Result host_1 service_1 2 critical Sleep 1s END - ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + ${result} Ctn Check Service Status With Timeout host_1 service_1 ${2} 60 HARD Should Be True ${result} Service (host_1,service_1) should be CRITICAL HARD FOR ${i} IN RANGE ${4} - Process Service Check Result host_2 service_2 2 critical + Ctn Process Service Check Result host_2 service_2 2 critical Sleep 1s END - ${result} Check Service Status With Timeout host_2 service_2 ${2} 60 HARD + ${result} Ctn Check Service Status With Timeout host_2 service_2 ${2} 60 HARD Should Be True ${result} Service (host_2,service_2) should be CRITICAL HARD \ No newline at end of file diff --git a/tests/broker-engine/output-tables.robot b/tests/broker-engine/output-tables.robot index 69ddd51bca2..b62670b812a 100644 --- a/tests/broker-engine/output-tables.robot +++ b/tests/broker-engine/output-tables.robot @@ -3,61 +3,61 @@ Documentation Engine/Broker tests on bbdo_version 3.0.0 and protobuf bbdo Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BERES1 [Documentation] store_in_resources is enabled and store_in_hosts_services is not. Only writes into resources should be done (except hosts/services events that continue to be written in hosts/services tables) [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql store_in_resources yes - Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql store_in_resources yes + Ctn Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no + Ctn Clear Retention ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content_not_present} Create List ... processing host status event (host: ... UPDATE hosts SET checked=i ... processing service status event (host: ... UPDATE services SET checked= ${content_present} Create List UPDATE resources SET status= - ${result} Find In Log With Timeout ${centralLog} ${start} ${content_present} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content_present} 60 Should Be True ${result} no updates concerning resources available. FOR ${l} IN ${content_not_present} - ${result} Find In Log ${centralLog} ${start} ${content_not_present} + ${result} Ctn Find In Log ${centralLog} ${start} ${content_not_present} Should Not Be True ${result[0]} There are updates of hosts/services table(s). END - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEHS1 [Documentation] store_in_resources is enabled and store_in_hosts_services is not. Only writes into resources should be done (except hosts/services events that continue to be written in hosts/services tables) [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql store_in_resources no - Broker Config Output Set central central-broker-unified-sql store_in_hosts_services yes - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql store_in_resources no + Ctn Broker Config Output Set central central-broker-unified-sql store_in_hosts_services yes + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content_present} Create List UPDATE hosts SET checked= UPDATE services SET checked= ${content_not_present} Create List ... INSERT INTO resources @@ -66,108 +66,108 @@ BEHS1 ... INSERT INTO tags ... UPDATE severities ... INSERT INTO severities - ${result} Find In Log With Timeout ${centralLog} ${start} ${content_present} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content_present} 60 Should Be True ${result} no updates concerning hosts/services available. FOR ${l} IN ${content_not_present} - ${result} Find In Log ${centralLog} ${start} ${content_not_present} + ${result} Ctn Find In Log ${centralLog} ${start} ${content_not_present} Should Not Be True ${result[0]} There are updates of the resources table. END - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEINSTANCESTATUS [Documentation] Instance status to bdd [Tags] broker engine - Config Engine ${1} ${50} ${20} - Engine Config Set Value 0 enable_flap_detection 1 True - Engine Config Set Value 0 enable_notifications 0 True - Engine Config Set Value 0 execute_host_checks 0 True - Engine Config Set Value 0 execute_service_checks 0 True - Engine Config Set Value 0 global_host_event_handler command_1 True - Engine Config Set Value 0 global_service_event_handler command_2 True - Engine Config Set Value 0 instance_heartbeat_interval 1 True - Engine Config Set Value 0 obsess_over_hosts 1 True - Engine Config Set Value 0 obsess_over_services 1 True - Engine Config Set Value 0 accept_passive_host_checks 0 True - Engine Config Set Value 0 accept_passive_service_checks 0 True + Ctn Config Engine ${1} ${50} ${20} + Ctn Engine Config Set Value 0 enable_flap_detection 1 True + Ctn Engine Config Set Value 0 enable_notifications 0 True + Ctn Engine Config Set Value 0 execute_host_checks 0 True + Ctn Engine Config Set Value 0 execute_service_checks 0 True + Ctn Engine Config Set Value 0 global_host_event_handler command_1 True + Ctn Engine Config Set Value 0 global_service_event_handler command_2 True + Ctn Engine Config Set Value 0 instance_heartbeat_interval 1 True + Ctn Engine Config Set Value 0 obsess_over_hosts 1 True + Ctn Engine Config Set Value 0 obsess_over_services 1 True + Ctn Engine Config Set Value 0 accept_passive_host_checks 0 True + Ctn Engine Config Set Value 0 accept_passive_service_checks 0 True - Config Broker central - Config Broker module ${1} - Broker Config Log central sql trace - Config BBDO3 1 - Config Broker Sql Output central unified_sql + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Config BBDO3 1 + Ctn Config Broker Sql Output central unified_sql ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ${result} Check Field Db Value + ${result} Ctn Check Field Db Value ... SELECT global_host_event_handler FROM instances WHERE instance_id=1 ... command_1 ... 30 Should Be True ${result} global_host_event_handler not updated. - ${result} Check Field Db Value + ${result} Ctn Check Field Db Value ... SELECT global_service_event_handler FROM instances WHERE instance_id=1 ... command_2 ... 2 Should Be True ${result} global_service_event_handler not updated. - ${result} Check Field Db Value SELECT flap_detection FROM instances WHERE instance_id=1 ${1} 3 + ${result} Ctn Check Field Db Value SELECT flap_detection FROM instances WHERE instance_id=1 ${1} 3 Should Be True ${result} flap_detection not updated. - ${result} Check Field Db Value SELECT notifications FROM instances WHERE instance_id=1 ${0} 3 + ${result} Ctn Check Field Db Value SELECT notifications FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} notifications not updated. - ${result} Check Field Db Value SELECT active_host_checks FROM instances WHERE instance_id=1 ${0} 3 + ${result} Ctn Check Field Db Value SELECT active_host_checks FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} active_host_checks not updated. - ${result} Check Field Db Value SELECT active_service_checks FROM instances WHERE instance_id=1 ${0} 3 + ${result} Ctn Check Field Db Value SELECT active_service_checks FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} active_service_checks not updated. - ${result} Check Field Db Value SELECT check_hosts_freshness FROM instances WHERE instance_id=1 ${0} 3 + ${result} Ctn Check Field Db Value SELECT check_hosts_freshness FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} check_hosts_freshness not updated. - ${result} Check Field Db Value + ${result} Ctn Check Field Db Value ... SELECT check_services_freshness FROM instances WHERE instance_id=1 ... ${1} ... 3 Should Be True ${result} check_services_freshness not updated. - ${result} Check Field Db Value SELECT obsess_over_hosts FROM instances WHERE instance_id=1 ${1} 3 + ${result} Ctn Check Field Db Value SELECT obsess_over_hosts FROM instances WHERE instance_id=1 ${1} 3 Should Be True ${result} obsess_over_hosts not updated. - ${result} Check Field Db Value SELECT obsess_over_services FROM instances WHERE instance_id=1 ${1} 3 + ${result} Ctn Check Field Db Value SELECT obsess_over_services FROM instances WHERE instance_id=1 ${1} 3 Should Be True ${result} obsess_over_services not updated. - ${result} Check Field Db Value SELECT passive_host_checks FROM instances WHERE instance_id=1 ${0} 3 + ${result} Ctn Check Field Db Value SELECT passive_host_checks FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} passive_host_checks not updated. - ${result} Check Field Db Value SELECT passive_service_checks FROM instances WHERE instance_id=1 ${0} 3 + ${result} Ctn Check Field Db Value SELECT passive_service_checks FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} passive_service_checks not updated. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BEINSTANCE [Documentation] Instance to bdd [Tags] broker engine - Config Engine ${1} ${50} ${20} + Ctn Config Engine ${1} ${50} ${20} - Config Broker central - Config Broker module ${1} - Broker Config Log central sql trace - Config BBDO3 1 - Config Broker Sql Output central unified_sql + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Config BBDO3 1 + Ctn Config Broker Sql Output central unified_sql Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String DELETE FROM instances # as GetCurrent Date floor milliseconds to upper or lower integer, we substract 1s - ${start} Get Round Current Date - Start Broker - Start Engine - ${engine_pid} Get Engine Pid e0 - ${result} Check Field Db Value SELECT pid FROM instances WHERE instance_id=1 ${engine_pid} 30 + ${start} Ctn Get Round Current Date + Ctn Start Broker + Ctn Start engine + ${engine_pid} Ctn Get Engine Pid e0 + ${result} Ctn Check Field Db Value SELECT pid FROM instances WHERE instance_id=1 ${engine_pid} 30 Should Be True ${result} no correct engine pid in instances table. - ${result} Check Field Db Value SELECT engine FROM instances WHERE instance_id=1 Centreon Engine 3 + ${result} Ctn Check Field Db Value SELECT engine FROM instances WHERE instance_id=1 Centreon Engine 3 Should Be True ${result} no correct engine in instances table. - ${result} Check Field Db Value SELECT running FROM instances WHERE instance_id=1 ${1} 3 + ${result} Ctn Check Field Db Value SELECT running FROM instances WHERE instance_id=1 ${1} 3 Should Be True ${result} no correct running in instances table. - ${result} Check Field Db Value SELECT name FROM instances WHERE instance_id=1 Poller0 3 + ${result} Ctn Check Field Db Value SELECT name FROM instances WHERE instance_id=1 Poller0 3 Should Be True ${result} no correct name in instances table. - ${result} Check Field Db Value SELECT end_time FROM instances WHERE instance_id=1 ${0} 3 + ${result} Ctn Check Field Db Value SELECT end_time FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} no correct end_time in instances table. @{bdd_start_time} Query SELECT start_time FROM instances WHERE instance_id=1 - ${now} Get Round Current Date + ${now} Ctn Get Round Current Date Should Be True ... ${start} <= ${bdd_start_time[0][0]} and ${bdd_start_time[0][0]} <= ${now} ... sg=no correct start_time in instances table. @@ -175,30 +175,30 @@ BEINSTANCE BE_NOTIF_OVERFLOW [Documentation] bbdo 2.0 notification number =40000. make an overflow => notification_number null in db [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Broker central - Config Broker module - Broker Config Add Item module0 bbdo_version 2.0.0 - Broker Config Add Item central bbdo_version 2.0.0 - Config Broker Sql Output central unified_sql - Broker Config Log central sql trace - Broker Config Log central perfdata trace + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Add Item module0 bbdo_version 2.0.0 + Ctn Broker Config Add Item central bbdo_version 2.0.0 + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central perfdata trace - Clear Retention + Ctn Clear Retention - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${start} Get Current Date ${content} Create List INITIAL SERVICE STATE: host_16;service_314; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 30 Should Be True ... ${result} ... An Initial host state on host_16 should be raised before we can start our external commands. - Set Svc Notification Number host_16 service_314 40000 - Process Service Result Hard host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 30 + Ctn Set Svc Notification Number host_16 service_314 40000 + Ctn Process Service Result Hard host_16 service_314 2 output critical for 314 + ${result} Ctn Check Service Status With Timeout host_16 service_314 2 30 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -206,27 +206,27 @@ BE_NOTIF_OVERFLOW ... SELECT s.notification_number FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_16' AND s.description='service_314' Should Be True ${output[0][0]} == None notification_number is not null - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BE_TIME_NULL_SERVICE_RESOURCE [Documentation] With BBDO 3, notification_interval time must be set to NULL on 0 in services, hosts and resources tables. [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker Sql Output central unified_sql - Config BBDO3 1 + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String DELETE FROM services Execute SQL String DELETE FROM resources Execute SQL String DELETE FROM hosts - Clear Retention + Ctn Clear Retention - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine FOR ${index} IN RANGE 300 ${output} Query @@ -240,27 +240,27 @@ BE_TIME_NULL_SERVICE_RESOURCE Should Be Equal As Strings ... ${output} ... ((None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker BE_DEFAULT_NOTIFCATION_INTERVAL_IS_ZERO_SERVICE_RESOURCE [Documentation] default notification_interval must be set to NULL in services, hosts and resources tables. [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker Sql Output central unified_sql - Config BBDO3 1 + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String DELETE FROM services Execute SQL String DELETE FROM resources Execute SQL String DELETE FROM hosts - Clear Retention + Ctn Clear Retention - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine FOR ${index} IN RANGE 300 ${output} Query @@ -270,5 +270,5 @@ BE_DEFAULT_NOTIFCATION_INTERVAL_IS_ZERO_SERVICE_RESOURCE IF "${output}" == "((0.0, 0.0),)" BREAK END Should Be Equal As Strings ${output} ((0.0, 0.0),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/retention-duplicates.robot b/tests/broker-engine/retention-duplicates.robot index 32da0ad9aa6..456a465053e 100644 --- a/tests/broker-engine/retention-duplicates.robot +++ b/tests/broker-engine/retention-duplicates.robot @@ -3,437 +3,437 @@ Documentation Centreon Broker tests on dublicated data that could come fro Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BERD1 [Documentation] Starting/stopping Broker does not create duplicated events. [Tags] broker engine start-stop duplicate retention - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Config Broker central - Broker Config Clear Outputs Except central ["ipv4"] - Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua - Broker Config Log central lua debug - Broker Config Flush Log central 0 - Config Broker module - Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Log module0 lua debug - Config Broker rrd - Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Config Broker central + Ctn Broker Config Clear Outputs Except central ["ipv4"] + Ctn Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua + Ctn Broker Config Log central lua debug + Ctn Broker Config Flush Log central 0 + Ctn Config Broker module + Ctn Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua + Ctn Broker Config Log module0 lua debug + Ctn Config Broker rrd + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected. Sleep 5s - Kindly Stop Broker + Ctn Kindly Stop Broker Sleep 5s - Clear Cache - Start Broker + Ctn Clear Cache + Ctn Start Broker Sleep 25s - Stop Engine - Kindly Stop Broker - ${result} Files Contain Same Json /tmp/lua-engine.log /tmp/lua.log + Ctn Stop engine + Ctn Kindly Stop Broker + ${result} Ctn Files Contain Same Json /tmp/lua-engine.log /tmp/lua.log Should Be True ${result} Contents of /tmp/lua.log and /tmp/lua-engine.log do not match. - ${result} Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log + ${result} Ctn Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERD2 [Documentation] Starting/stopping Engine does not create duplicated events. [Tags] broker engine start-stop duplicate retention - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_level_runtime info - Config Broker central - Broker Config Clear Outputs Except central ["ipv4"] - Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua - Broker Config Log central lua debug - Broker Config Flush Log central 0 - Config Broker module - Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Log module0 lua debug - Broker Config Log module0 neb debug - Config Broker rrd - Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_level_runtime info + Ctn Config Broker central + Ctn Broker Config Clear Outputs Except central ["ipv4"] + Ctn Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua + Ctn Broker Config Log central lua debug + Ctn Broker Config Flush Log central 0 + Ctn Config Broker module + Ctn Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua + Ctn Broker Config Log module0 lua debug + Ctn Broker Config Log module0 neb debug + Ctn Config Broker rrd + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected. Sleep 15s - Stop Engine - Start Engine + Ctn Stop engine + Ctn Start engine Sleep 25s - Stop Engine - Kindly Stop Broker - ${result} Files Contain Same Json /tmp/lua-engine.log /tmp/lua.log + Ctn Stop engine + Ctn Kindly Stop Broker + ${result} Ctn Files Contain Same Json /tmp/lua-engine.log /tmp/lua.log Should Be True ${result} Contents of /tmp/lua.log and /tmp/lua-engine.log do not match. - ${result} Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log + ${result} Ctn Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUC1 [Documentation] Starting/stopping Broker does not create duplicated events in usual cases [Tags] broker engine start-stop duplicate retention - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Config Broker central - Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua - Broker Config Log central lua debug - Broker Config Log central perfdata debug - Broker Config Log central sql debug - Broker Config Flush Log central 0 - - Config Broker module - Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Log module0 lua debug - Broker Config Log module0 neb debug - Config Broker rrd - Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Config Broker central + Ctn Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua + Ctn Broker Config Log central lua debug + Ctn Broker Config Log central perfdata debug + Ctn Broker Config Log central sql debug + Ctn Broker Config Flush Log central 0 + + Ctn Config Broker module + Ctn Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua + Ctn Broker Config Log module0 lua debug + Ctn Broker Config Log module0 neb debug + Ctn Config Broker rrd + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected. Sleep 5s - Kindly Stop Broker + Ctn Kindly Stop Broker Sleep 5s - Clear Cache - Start Broker + Ctn Clear Cache + Ctn Start Broker Sleep 25s - Stop Engine - Kindly Stop Broker - ${result} Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log + Ctn Stop engine + Ctn Kindly Stop Broker + ${result} Ctn Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUCU1 [Documentation] Starting/stopping Broker does not create duplicated events in usual cases with unified_sql [Tags] broker engine start-stop duplicate retention - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Config Broker central - Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua - Broker Config Log central lua debug - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Log module0 lua debug - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Broker Config Flush Log module0 0 - Config Broker rrd - Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Config Broker central + Ctn Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua + Ctn Broker Config Log central lua debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua + Ctn Broker Config Log module0 lua debug + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Broker Config Flush Log module0 0 + Ctn Config Broker rrd + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine Sleep 5s - Kindly Stop Broker + Ctn Kindly Stop Broker Sleep 5s - Clear Cache - Start Broker + Ctn Clear Cache + Ctn Start Broker Sleep 25s - Stop Engine - Kindly Stop Broker - ${result} Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log + Ctn Stop engine + Ctn Kindly Stop Broker + ${result} Ctn Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUC2 [Documentation] Starting/stopping Engine does not create duplicated events in usual cases [Tags] broker engine start-stop duplicate retention - Clear Retention - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Config Broker central - Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua - Broker Config Log central lua debug - Config Broker module - Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Log module0 lua debug - Broker Config Flush Log central 0 - Broker Config Flush Log module0 0 - Config Broker rrd + Ctn Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Config Broker central + Ctn Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua + Ctn Broker Config Log central lua debug + Ctn Config Broker module + Ctn Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua + Ctn Broker Config Log module0 lua debug + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log module0 0 + Ctn Config Broker rrd ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected. Sleep 5s - Stop Engine + Ctn Stop engine Sleep 5s - Clear Cache - Start Engine + Ctn Clear Cache + Ctn Start engine Sleep 25s - Stop Engine - Kindly Stop Broker - ${result} Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log + Ctn Stop engine + Ctn Kindly Stop Broker + ${result} Ctn Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUCU2 [Documentation] Starting/stopping Engine does not create duplicated events in usual cases with unified_sql [Tags] broker engine start-stop duplicate retention - Clear Retention - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Config Broker central - Config Broker Sql Output central unified_sql - Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua - Broker Config Log central lua debug - Broker Config Log central sql trace - Config Broker module - Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Log module0 lua debug - Broker Config Flush Log central 0 - Broker Config Flush Log module0 0 - Config Broker rrd + Ctn Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua + Ctn Broker Config Log central lua debug + Ctn Broker Config Log central sql trace + Ctn Config Broker module + Ctn Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua + Ctn Broker Config Log module0 lua debug + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log module0 0 + Ctn Config Broker rrd ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected. Sleep 5s - Stop Engine + Ctn Stop engine Sleep 5s - Clear Cache - Start Engine + Ctn Clear Cache + Ctn Start engine Sleep 25s - Stop Engine - Kindly Stop Broker - ${result} Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log + Ctn Stop engine + Ctn Kindly Stop Broker + ${result} Ctn Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUC3U1 [Documentation] Starting/stopping Broker does not create duplicated events in usual cases with unified_sql and BBDO 3.0 [Tags] broker engine start-stop duplicate retention - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Config Broker central - Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua - Broker Config Log central lua debug - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Flush Log central 0 - Broker Config Flush Log module0 0 - Config Broker rrd - Config BBDO3 1 - Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Config Broker central + Ctn Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua + Ctn Broker Config Log central lua debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log module0 0 + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected. Sleep 5s - Kindly Stop Broker + Ctn Kindly Stop Broker Sleep 5s - Clear Cache - Start Broker + Ctn Clear Cache + Ctn Start Broker Sleep 25s - Stop Engine - Kindly Stop Broker - ${result} Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log + Ctn Stop engine + Ctn Kindly Stop Broker + ${result} Ctn Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUC3U2 [Documentation] Starting/stopping Engine does not create duplicated events in usual cases with unified_sql and BBDO 3.0 [Tags] broker engine start-stop duplicate retention - Clear Retention - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Config Broker central - Config Broker Sql Output central unified_sql - Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua - Broker Config Log central lua debug - Broker Config Log central sql trace - Config Broker module - Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Log module0 lua debug - Broker Config Flush Log central 0 - Broker Config Flush Log module0 0 - Config Broker rrd - Config BBDO3 1 + Ctn Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua + Ctn Broker Config Log central lua debug + Ctn Broker Config Log central sql trace + Ctn Config Broker module + Ctn Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua + Ctn Broker Config Log module0 lua debug + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log module0 0 + Ctn Config Broker rrd + Ctn Config BBDO3 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the lua to be correctly initialized ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine # Let's wait for all the services configuration. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 - ${start} Get Round Current Date + ${start} Ctn Get Round Current Date # Let's wait for a first service status. ${content} Create List SQL: pb service .* status .* type .* check result output - ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result[0]} We did not get any pb service status for 60s - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected. Sleep 5s - Stop Engine + Ctn Stop engine Sleep 5s - Clear Cache - Start Engine + Ctn Clear Cache + Ctn Start engine Sleep 25s - Stop Engine - Kindly Stop Broker - ${result} Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log + Ctn Stop engine + Ctn Kindly Stop Broker + ${result} Ctn Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUCA300 [Documentation] Starting/stopping Engine is stopped ; it should emit a stop event and receive an ack event with events to clean from broker. [Tags] broker engine start-stop duplicate retention unified_sql - Clear Retention - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Config Broker central - Config Broker Sql Output central unified_sql - Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua - Broker Config Log central config debug - Broker Config Log central bbdo trace - Broker Config Log central tcp trace - Config Broker module - Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Log module0 config debug - Broker Config Log module0 bbdo trace - Broker Config Flush Log central 0 - Broker Config Flush Log module0 0 - Config Broker rrd - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item central bbdo_version 3.0.0 - Broker Config Add Item rrd bbdo_version 3.0.0 + Ctn Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua + Ctn Broker Config Log central config debug + Ctn Broker Config Log central bbdo trace + Ctn Broker Config Log central tcp trace + Ctn Config Broker module + Ctn Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua + Ctn Broker Config Log module0 config debug + Ctn Broker Config Log module0 bbdo trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log module0 0 + Ctn Config Broker rrd + Ctn Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item central bbdo_version 3.0.0 + Ctn Broker Config Add Item rrd bbdo_version 3.0.0 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected. # Let's wait for all the services configuration. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 - Stop Engine + Ctn Stop engine ${content} Create List BBDO: sending pb stop packet to peer - ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Engine should send a pb stop message to cbd. ${content} Create List BBDO: received pb stop from peer - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Broker should receive a pb stop message from engine. ${content} Create List send acknowledgement for [0-9]+ events - ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result[0]} Broker should send an ack for handled events. ${content} Create List BBDO: received acknowledgement for [0-9]+ events before finishing - ${result} Find Regex In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find Regex In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result[0]} Engine should receive an ack for handled events from broker. - Kindly Stop Broker + Ctn Kindly Stop Broker BERDUCA301 [Documentation] Starting/stopping Engine is stopped ; it should emit a stop event and receive an ack event with events to clean from broker with bbdo 3.0.1. [Tags] broker engine start-stop duplicate retention unified_sql - Clear Retention - Config Engine ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Config Broker central - Config Broker Sql Output central unified_sql - Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua - Broker Config Log central config debug - Broker Config Log central bbdo trace - Broker Config Log central tcp trace - Config Broker module - Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Log module0 config debug - Broker Config Log module0 bbdo trace - Broker Config Flush Log central 0 - Broker Config Flush Log module0 0 - Config Broker rrd - - Config BBDO3 1 + Ctn Clear Retention + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Add Lua Output central test-doubles ${SCRIPTS}test-doubles-c.lua + Ctn Broker Config Log central config debug + Ctn Broker Config Log central bbdo trace + Ctn Broker Config Log central tcp trace + Ctn Config Broker module + Ctn Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua + Ctn Broker Config Log module0 config debug + Ctn Broker Config Log module0 bbdo trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log module0 0 + Ctn Config Broker rrd + + Ctn Config BBDO3 1 ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected. # Let's wait for all the services configuration. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 - Stop Engine + Ctn Stop engine ${content} Create List BBDO: sending pb stop packet to peer - ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Engine should send a pb stop message to cbd. ${content} Create List BBDO: received pb stop from peer - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Broker should receive a pb stop message from engine. ${content} Create List send pb acknowledgement for [0-9]+ events - ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result[0]} Broker should send an ack for handled events. ${content} Create List BBDO: received acknowledgement for [0-9]+ events before finishing - ${result} Find Regex In Log With Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Ctn Find Regex In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result[0]} Engine should receive an ack for handled events from broker. - Kindly Stop Broker + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/reverse-connection.robot b/tests/broker-engine/reverse-connection.robot index 8a5816ae354..36013d1773e 100644 --- a/tests/broker-engine/reverse-connection.robot +++ b/tests/broker-engine/reverse-connection.robot @@ -3,41 +3,41 @@ Documentation Centreon Broker and Engine communication with or without com Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BRGC1 [Documentation] Broker good reverse connection [Tags] broker map reverse connection - Config Engine ${1} - Config Broker rrd - Config Broker central_map - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central_map + Ctn Config Broker module Log To Console Compression set to - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - Run Reverse Bam ${50} ${0.2} + Ctn Run Reverse Bam ${50} ${0.2} - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content} Create List ... New incoming connection 'centreon-broker-master-map-2' ... file: end of file '${VarRoot}/lib/centreon-broker//central-broker-master.queue.centreon-broker-master-map-2' reached, erasing it ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result} Find In Log With Timeout ${log} ${start} ${content} 40 + ${result} Ctn Find In Log With Timeout ${log} ${start} ${content} 40 Should Be True ${result} Connection to map has failed. File Should Not Exist ... ${VarRoot}/lib/centreon-broker/central-broker-master.queue.centreon-broker-master-map* @@ -46,30 +46,30 @@ BRGC1 BRCTS1 [Documentation] Broker reverse connection too slow [Tags] broker map reverse connection - Config Engine ${1} - Config Broker rrd - Config Broker central_map - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central_map + Ctn Config Broker module - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - Run Reverse Bam ${150} ${10} + Ctn Run Reverse Bam ${150} ${10} - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content} Create List ... New incoming connection 'centreon-broker-master-map-2' ... file: end of file '${VarRoot}/lib/centreon-broker//central-broker-master.queue.centreon-broker-master-map-2' reached, erasing it ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result} Find In Log With Timeout ${log} ${start} ${content} 40 + ${result} Ctn Find In Log With Timeout ${log} ${start} ${content} 40 Should Be True ${result} Connection to map has failed @{files} List Files In Directory ${VarRoot}/lib/centreon-broker Log To Console ${files} @@ -80,28 +80,28 @@ BRCTS1 BRCS1 [Documentation] Broker reverse connection stopped [Tags] broker map reversed - Config Engine ${1} - Config Broker rrd - Config Broker central_map - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central_map + Ctn Config Broker module - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content} Create List ... New incoming connection 'centreon-broker-master-map-2' ... file: end of file '${VarRoot}/lib/centreon-broker//central-broker-master.queue.centreon-broker-master-map-2' reached, erasing it ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result} Find In Log With Timeout ${log} ${start} ${content} 40 + ${result} Ctn Find In Log With Timeout ${log} ${start} ${content} 40 Should Not Be True ${result} Connection to map has failed File Should Not Exist ... ${VarRoot}/lib/centreon-broker/central-broker-master.queue.centreon-broker-master-map-2 @@ -110,33 +110,33 @@ BRCS1 BRCTSMN [Documentation] Broker connected to map with neb filter [Tags] broker map reverse connection - Config Engine ${1} - Config Broker rrd - Config Broker central_map - Config Broker module - Config BBDO3 ${1} - - Broker Config Output Set Json central centreon-broker-master-map filters {"category": ["neb"]} - Broker Config Log central bbdo trace - Broker Config Log central core trace - Broker Config Log central processing trace - Broker Config Log module0 bbdo info - ${start} Get Round Current Date - Start Broker - Start Map + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central_map + Ctn Config Broker module + Ctn Config BBDO3 ${1} + + Ctn Broker Config Output Set Json central centreon-broker-master-map filters {"category": ["neb"]} + Ctn Broker Config Log central bbdo trace + Ctn Broker Config Log central core trace + Ctn Broker Config Log central processing trace + Ctn Broker Config Log module0 bbdo info + ${start} Ctn Get Round Current Date + Ctn Start Broker + Ctn Start Map Sleep 5s - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # pb_service pb_host pb_service_status pb_host_status ${expected_events} Create List 65563 65566 65565 65568 ${categories} Create List 1 - ${output} Check Map Output ${categories} ${expected_events} 120 - Kindly Stop Broker - Stop Map + ${output} Ctn Check Map Output ${categories} ${expected_events} 120 + Ctn Kindly Stop Broker + Ctn Stop Map Should Be True ${output} Filters badly applied in Broker # We should have exactly 1000 pb_service @@ -149,41 +149,41 @@ BRCTSMN ${ret} Get Line Count ${ret} Should Be True ${ret} >= 50 - Stop Engine + Ctn Stop engine BRCTSMNS [Documentation] Broker connected to map with neb and storage filters [Tags] broker map reverse connection - Clear Metrics - Config Engine ${1} - Config Broker rrd - Config Broker central_map - Config Broker module - Config BBDO3 ${1} - - Broker Config Output Set Json + Ctn Clear Metrics + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central_map + Ctn Config Broker module + Ctn Config BBDO3 ${1} + + Ctn Broker Config Output Set Json ... central ... centreon-broker-master-map ... filters ... {"category": ["neb", "storage"]} - Broker Config Log central bbdo trace - Broker Config Log central core trace - Broker Config Log central processing trace - Broker Config Log module0 bbdo info - ${start} Get Round Current Date - Start Broker - Start Map + Ctn Broker Config Log central bbdo trace + Ctn Broker Config Log central core trace + Ctn Broker Config Log central processing trace + Ctn Broker Config Log module0 bbdo info + ${start} Ctn Get Round Current Date + Ctn Start Broker + Ctn Start Map Sleep 5s - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message about check_for_external_commands() should be available. # pb_service pb_host pb_service_status pb_host_status pb_metric pb_status pb_index_mapping ${expected_events} Create List 65563 65566 65565 65568 196617 196618 196619 ${categories} Create List 1 3 - ${output} Check Map Output ${categories} ${expected_events} 120 + ${output} Ctn Check Map Output ${categories} ${expected_events} 120 Should Be True ${output} Filters badly applied in Broker # We should have 1000 pb_service with maybe some BAs @@ -201,16 +201,16 @@ BRCTSMNS Log To Console Second configuration with one more service per host # For each host, one service is added (20 -> 21) - Config Engine ${1} ${50} ${21} - Reload Engine - Reload Broker + Ctn Config Engine ${1} ${50} ${21} + Ctn Reload Engine + Ctn Reload Broker # pb_service we changed services 50 added and others moved... ${expected_events} Create List 65563 ${categories} Create List 1 3 - ${output} Check Map Output ${categories} ${expected_events} 120 + ${output} Ctn Check Map Output ${categories} ${expected_events} 120 Should Be True ${output} Filters badly applied in Broker - Kindly Stop Broker - Stop Map - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop Map + Ctn Stop engine diff --git a/tests/broker-engine/rrd-from-db.robot b/tests/broker-engine/rrd-from-db.robot index d7387f579de..0637cab583e 100644 --- a/tests/broker-engine/rrd-from-db.robot +++ b/tests/broker-engine/rrd-from-db.robot @@ -3,46 +3,46 @@ Documentation Centreon Broker RRD metric deletion from the legacy query ma Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Stop Engine Broker And Save Logs +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Stop Engine Broker And Save Logs *** Test Cases *** BRRDDMDB1 [Documentation] RRD metrics deletion from metric ids with a query in centreon_storage. [Tags] rrd metric deletion unified_sql mysql - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log central grpc error - Broker Config Log central sql info - Broker Config Log central core error - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log central grpc error + Ctn Broker Config Log central sql info + Ctn Broker Config Log central core error + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date exclude_millis=True - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We choose 3 metrics to remove. - ${metrics} Get Metrics To Delete 3 + ${metrics} Ctn Get Metrics To Delete 3 Log To Console Metrics to delete ${metrics} ${empty} Create List - Remove Graphs From Db ${empty} ${metrics} - Reload Broker + Ctn Remove Graphs From Db ${empty} ${metrics} + Ctn Reload Broker ${metrics_str} Catenate SEPARATOR=, @{metrics} ${content} Create List metrics ${metrics_str} erased from database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} Log To Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted @@ -52,39 +52,39 @@ BRRDDMDB1 BRRDDIDDB1 [Documentation] RRD metrics deletion from index ids with a query in centreon_storage. [Tags] rrd metric deletion unified_sql - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date Sleep 1s - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected Log To Console STEP1 - ${indexes} Get Indexes To Delete 2 + ${indexes} Ctn Get Indexes To Delete 2 Log To Console STEP2 - ${metrics} Get Metrics Matching Indexes ${indexes} + ${metrics} Ctn Get Metrics Matching Indexes ${indexes} Log To Console STEP3 Log To Console indexes ${indexes} to delete with their metrics ${empty} Create List - Remove Graphs From Db ${indexes} ${empty} - Reload Broker + Ctn Remove Graphs From Db ${indexes} ${empty} + Ctn Reload Broker ${indexes_str} Catenate SEPARATOR=, @{indexes} ${content} Create List indexes ${indexes_str} erased from database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} Log To Console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted @@ -98,45 +98,45 @@ BRRDDIDDB1 BRRDRBDB1 [Documentation] RRD metric rebuild with a query in centreon_storage and unified sql [Tags] rrd metric rebuild unified_sql - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log rrd rrd trace - Broker Config Log central sql trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs From Db ${index} + ${index} Ctn Get Indexes To Rebuild 3 + Ctn Rebuild Rrd Graphs From Db ${index} Log To Console Indexes to rebuild: ${index} - ${metrics} Get Metrics Matching Indexes ${index} + ${metrics} Ctn Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} - Reload Broker + Ctn Reload Broker ${content1} Create List RRD: Starting to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} ${value} Evaluate ${m} / 2 - ${result} Compare RRD Average Value ${m} ${value} + ${result} Ctn Compare Rrd Average Value ${m} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. @@ -145,45 +145,45 @@ BRRDRBDB1 BRRDRBUDB1 [Documentation] RRD metric rebuild with a query in centreon_storage and unified sql [Tags] rrd metric rebuild unified_sql grpc - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log rrd rrd trace - Broker Config Log central sql trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Config BBDO3 1 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Config BBDO3 1 + Ctn Create Metrics 3 ${start} Get Current Date exclude_millis=True - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs From Db ${index} - Reload Broker + ${index} Ctn Get Indexes To Rebuild 3 + Ctn Rebuild Rrd Graphs From Db ${index} + Ctn Reload Broker Log To Console Indexes to rebuild: ${index} - ${metrics} Get Metrics Matching Indexes ${index} + ${metrics} Ctn Get Metrics Matching Indexes ${index} ${content1} Create List RRD: Starting to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} ${value} Evaluate ${m} / 2 - ${result} Compare RRD Average Value ${m} ${value} + ${result} Ctn Compare Rrd Average Value ${m} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. @@ -192,43 +192,43 @@ BRRDRBUDB1 BRRDUPLICATE [Documentation] RRD metric rebuild with a query in centreon_storage and unified sql with duplicate rows in database [Tags] rrd metric rebuild unified_sql - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log rrd rrd trace - Broker Config Log central sql trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index} Get Indexes To Rebuild 3 2 - ${duplicates} Add Duplicate Metrics - Rebuild Rrd Graphs From Db ${index} + ${index} Ctn Get Indexes To Rebuild 3 2 + ${duplicates} Ctn Add Duplicate Metrics + Ctn Rebuild Rrd Graphs From Db ${index} Log To Console Indexes to rebuild: ${index} - ${metrics} Get Metrics Matching Indexes ${index} + ${metrics} Ctn Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} - Reload Broker + Ctn Reload Broker ${content1} Create List RRD: Starting to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 Should Be True ${result} RRD cbd did not receive metrics to rebuild END - ${result} Check For Nan Metric ${duplicates} + ${result} Ctn Check For Nan Metric ${duplicates} Should Be True ${result} at least one metric contains NaN value diff --git a/tests/broker-engine/rrd.robot b/tests/broker-engine/rrd.robot index a033f584692..b242a3ada0a 100644 --- a/tests/broker-engine/rrd.robot +++ b/tests/broker-engine/rrd.robot @@ -3,43 +3,43 @@ Documentation Centreon Broker RRD metric deletion Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Stop Engine Broker And Save Logs +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Stop Engine Broker And Save Logs *** Test Cases *** BRRDDM1 [Documentation] RRD metrics deletion from metric ids. [Tags] rrd metric deletion - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We choose 3 metrics to remove. - ${metrics} Get Metrics To Delete 3 + ${metrics} Ctn Get Metrics To Delete 3 Log To Console Metrics to delete ${metrics} ${empty} Create List - Remove Graphs 51001 ${empty} ${metrics} + Ctn Remove Graphs 51001 ${empty} ${metrics} ${metrics_str} Catenate SEPARATOR=, @{metrics} ${content} Create List metrics .* erased from database - ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result[0]} No log message telling about some metrics deletion. # We should have one line, but stored in an array. @@ -57,57 +57,57 @@ BRRDDM1 BRRDWM1 [Documentation] We are working with BBDO3. This test checks protobuf metrics and status are sent to cbd RRD. [Tags] rrd metric bbdo3 unified_sql - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central sql info - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${content} Create List RRD: new pb data for metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 120 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content} 120 Should Be True ${result} No protobuf metric sent to cbd RRD for 60s. BRRDDID1 [Documentation] RRD metrics deletion from index ids. [Tags] rrd metric deletion - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Create Metrics 3 ${start} Get Current Date Sleep 1s - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - ${indexes} Get Indexes To Delete 2 - ${metrics} Get Metrics Matching Indexes ${indexes} + ${indexes} Ctn Get Indexes To Delete 2 + ${metrics} Ctn Get Metrics Matching Indexes ${indexes} Log To Console indexes ${indexes} to delete with their metrics ${empty} Create List - Remove Graphs 51001 ${indexes} ${empty} + Ctn Remove Graphs 51001 ${indexes} ${empty} ${indexes_str} Catenate SEPARATOR=, @{indexes} ${content} Create List indexes .* erased from database - ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result[0]} No log message telling about indexes ${indexes_str} deletion. # We should have one line, but stored in an array. FOR ${l} IN @{result[1]} @@ -129,29 +129,29 @@ BRRDDID1 BRRDDMID1 [Documentation] RRD deletion of non existing metrics and indexes [Tags] rrd metric deletion - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - ${indexes} Get Not Existing Indexes 2 - ${metrics} Get Not Existing Metrics 2 + ${indexes} Ctn Get Not Existing Indexes 2 + ${metrics} Ctn Get Not Existing Metrics 2 Log To Console indexes ${indexes} and metrics ${metrics} to delete but they do not exist. - Remove Graphs 51001 ${indexes} ${metrics} + Ctn Remove Graphs 51001 ${indexes} ${metrics} ${content} Create List do not appear in the storage database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ... ${result} ... A message telling indexes nor metrics appear in the storage database should appear. @@ -159,34 +159,34 @@ BRRDDMID1 BRRDDMU1 [Documentation] RRD metric deletion on table metric with unified sql output [Tags] rrd metric deletion unified_sql - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central sql info - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We choose 3 metrics to remove. - ${metrics} Get Metrics To Delete 3 + ${metrics} Ctn Get Metrics To Delete 3 Log To Console metrics to delete ${metrics} ${empty} Create List - Remove Graphs 51001 ${empty} ${metrics} + Ctn Remove Graphs 51001 ${empty} ${metrics} ${metrics_str} Catenate SEPARATOR=, @{metrics} ${content} Create List metrics .* erased from database - ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 50 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start} ${content} 50 Should Be True ${result[0]} No log message telling about metrics ${metrics_str} deletion. # We should have one line, but stored in an array. @@ -203,34 +203,34 @@ BRRDDMU1 BRRDDIDU1 [Documentation] RRD metrics deletion from index ids with unified sql output. [Tags] rrd metric deletion unified_sql - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central sql info - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - ${indexes} Get Indexes To Delete 2 - ${metrics} Get Metrics Matching Indexes ${indexes} + ${indexes} Ctn Get Indexes To Delete 2 + ${metrics} Ctn Get Metrics Matching Indexes ${indexes} Log To Console indexes ${indexes} to delete with their metrics ${empty} Create List - Remove Graphs 51001 ${indexes} ${empty} + Ctn Remove Graphs 51001 ${indexes} ${empty} ${indexes_str} Catenate SEPARATOR=, @{indexes} ${content} Create List indexes .* erased from database - ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result[0]} No log message telling about indexes ${indexes_str} deletion. # We should have one line, but stored in an array. FOR ${l} IN @{result[1]} @@ -250,30 +250,30 @@ BRRDDIDU1 BRRDDMIDU1 [Documentation] RRD deletion of non existing metrics and indexes [Tags] rrd metric deletion unified_sql - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central sql info - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - ${indexes} Get Not Existing Indexes 2 - ${metrics} Get Not Existing Metrics 2 + ${indexes} Ctn Get Not Existing Indexes 2 + ${metrics} Ctn Get Not Existing Metrics 2 Log To Console indexes ${indexes} and metrics ${metrics} to delete but they do not exist. - Remove Graphs 51001 ${indexes} ${metrics} + Ctn Remove Graphs 51001 ${indexes} ${metrics} ${content} Create List do not appear in the storage database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ... ${result} ... A message telling indexes nor metrics appear in the storage database should appear. @@ -281,47 +281,47 @@ BRRDDMIDU1 BRRDRM1 [Documentation] RRD metric rebuild with gRPC API. 3 indexes are selected then a message to rebuild them is sent. This is done with storage/sql sql output. [Tags] rrd metric rebuild grpc - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Broker Config Log rrd rrd trace - Broker Config Log central sql trace - Broker Config Log rrd perfdata trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Log rrd perfdata trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs 51001 ${index} 1 + ${index} Ctn Get Indexes To Rebuild 3 + Ctn Rebuild Rrd Graphs 51001 ${index} 1 Log To Console Indexes to rebuild: ${index} - ${metrics} Get Metrics Matching Indexes ${index} + ${metrics} Ctn Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} ${content} Create List Metric rebuild: metric is sent to rebuild - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Central did not send metrics to rebuild ${content1} Create List RRD: Starting to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} ${value} Evaluate ${m} / 2 - ${result} Compare RRD Average Value ${m} ${value} + ${result} Ctn Compare Rrd Average Value ${m} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. @@ -329,7 +329,7 @@ BRRDRM1 FOR ${index_id} IN @{index} ${value} Evaluate ${index_id} %3 - ${result} Compare RRD Status Average Value ${index_id} ${value} + ${result} Ctn Compare Rrd Status Average Value ${index_id} ${value} Should Be True ... ${result} ... index_id=${index_id} Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 0 if modulo==2 . @@ -338,60 +338,60 @@ BRRDRM1 BRRDRMU1 [Documentation] RRD metric rebuild with gRPC API. 3 indexes are selected then a message to rebuild them is sent. This is done with unified_sql output. [Tags] rrd metric rebuild unified_sql grpc - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log rrd rrd trace - Broker Config Log central sql trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 - - ${start} Get Round Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 + + ${start} Ctn Get Round Current Date + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs 51001 ${index} 1 + ${index} Ctn Get Indexes To Rebuild 3 + Ctn Rebuild Rrd Graphs 51001 ${index} 1 Log To Console Indexes to rebuild: ${index} - ${metrics} Get Metrics Matching Indexes ${index} + ${metrics} Ctn Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} ${content} Create List Metric rebuild: metric is sent to rebuild - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Central did not send metrics to rebuild ${content1} Create List RRD: Starting to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} ${value} Evaluate ${m} / 2 - ${result} Compare RRD Average Value ${m} ${value} + ${result} Ctn Compare Rrd Average Value ${m} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. # 48 = 60(octal) - ${result} Has File Permissions ${VarRoot}/lib/centreon/metrics/${m}.rrd 48 + ${result} Ctn Has File Permissions ${VarRoot}/lib/centreon/metrics/${m}.rrd 48 Should Be True ${result} ${VarRoot}/lib/centreon/metrics/${m}.rrd has not RW group permission END FOR ${index_id} IN @{index} ${value} Evaluate ${index_id} %3 - ${result} Compare RRD Status Average Value ${index_id} ${value} + ${result} Ctn Compare Rrd Status Average Value ${index_id} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 0 if modulo==2 . @@ -400,41 +400,41 @@ BRRDRMU1 RRD1 [Documentation] RRD metric rebuild asked with gRPC API. Three non existing indexes IDs are selected then an error message is sent. This is done with unified_sql output. [Tags] rrd metric rebuild unified_sql grpc - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log rrd rrd trace - Broker Config Log central sql trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 - - ${start} Get Round Current Date - Run Keywords Start Broker AND Start Engine - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 + + ${start} Ctn Get Round Current Date + Run Keywords Ctn Start Broker AND Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index} Get Not Existing Indexes 3 - Rebuild Rrd Graphs 51001 ${index} 1 + ${index} Ctn Get Not Existing Indexes 3 + Ctn Rebuild Rrd Graphs 51001 ${index} 1 Log To Console Indexes to rebuild: ${index} - ${metrics} Get Metrics Matching Indexes ${index} + ${metrics} Ctn Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} ${content} Create List Metrics rebuild: metrics don't exist - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Central did not send metrics to rebuild ${content1} Create List mysql_connection: You have an error in your SQL syntax - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Not Be True ${result} Database did not receive command to rebuild metrics *** Keywords *** -Test Clean - Stop Engine - Kindly Stop Broker - Save Logs If Failed +Ctn Test Clean + Ctn Stop engine + Ctn Kindly Stop Broker + Ctn Save Logs If Failed diff --git a/tests/broker-engine/rrdcached-from-db.robot b/tests/broker-engine/rrdcached-from-db.robot index 76649fda776..db1732abdcd 100644 --- a/tests/broker-engine/rrdcached-from-db.robot +++ b/tests/broker-engine/rrdcached-from-db.robot @@ -3,47 +3,47 @@ Documentation Centreon Broker RRD metric deletion from the legacy query ma Resource ../resources/import.resource -Suite Setup Clean Before Suite With rrdcached -Suite Teardown Clean After Suite With rrdcached -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite With rrdcached +Suite Teardown Ctn Clean After Suite With rrdcached +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BRRDCDDMDB1 [Documentation] RRD metrics deletion from metric ids with a query in centreon_storage and rrdcached. [Tags] rrd metric deletion unified_sql mysql rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log central grpc error - Broker Config Log central sql info - Broker Config Log central core error - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log central grpc error + Ctn Broker Config Log central sql info + Ctn Broker Config Log central core error + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date exclude_millis=True - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We choose 3 metrics to remove. - ${metrics} Get Metrics To Delete 3 + ${metrics} Ctn Get Metrics To Delete 3 Log To Console Metrics to delete ${metrics} ${empty} Create List - Remove Graphs From Db ${empty} ${metrics} - Reload Broker + Ctn Remove Graphs From Db ${empty} ${metrics} + Ctn Reload Broker ${metrics_str} Catenate SEPARATOR=, @{metrics} ${content} Create List metrics ${metrics_str} erased from database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} Log To Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted @@ -53,40 +53,40 @@ BRRDCDDMDB1 BRRDCDDIDDB1 [Documentation] RRD metrics deletion from index ids with a query in centreon_storage with rrdcached. [Tags] rrd metric deletion unified_sql rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd debug - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd debug + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date Sleep 1s - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected Log To Console STEP1 - ${indexes} Get Indexes To Delete 2 + ${indexes} Ctn Get Indexes To Delete 2 Log To Console STEP2 - ${metrics} Get Metrics Matching Indexes ${indexes} + ${metrics} Ctn Get Metrics Matching Indexes ${indexes} Log To Console STEP3 Log To Console indexes ${indexes} to delete with their metrics ${empty} Create List - Remove Graphs From Db ${indexes} ${empty} - Reload Broker + Ctn Remove Graphs From Db ${indexes} ${empty} + Ctn Reload Broker ${indexes_str} Catenate SEPARATOR=, @{indexes} ${content} Create List indexes ${indexes_str} erased from database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} Log To Console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted @@ -100,46 +100,46 @@ BRRDCDDIDDB1 BRRDCDRBDB1 [Documentation] RRD metric rebuild with a query in centreon_storage and unified sql with rrdcached [Tags] rrd metric rebuild unified_sql rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log rrd rrd trace - Broker Config Log central sql trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs From Db ${index} + ${index} Ctn Get Indexes To Rebuild 3 + Ctn Rebuild Rrd Graphs From Db ${index} Log To Console Indexes to rebuild: ${index} - ${metrics} Get Metrics Matching Indexes ${index} + ${metrics} Ctn Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} - Reload Broker + Ctn Reload Broker ${content1} Create List RRD: Starting to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} ${value} Evaluate ${m} / 2 - ${result} Compare RRD Average Value ${m} ${value} + ${result} Ctn Compare Rrd Average Value ${m} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. @@ -148,46 +148,46 @@ BRRDCDRBDB1 BRRDCDRBUDB1 [Documentation] RRD metric rebuild with a query in centreon_storage and unified sql with rrdcached [Tags] rrd metric rebuild unified_sql grpc rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log rrd rrd trace - Broker Config Log central sql trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Config BBDO3 1 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Config BBDO3 1 + Ctn Create Metrics 3 ${start} Get Current Date exclude_millis=True - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs From Db ${index} - Reload Broker + ${index} Ctn Get Indexes To Rebuild 3 + Ctn Rebuild Rrd Graphs From Db ${index} + Ctn Reload Broker Log To Console Indexes to rebuild: ${index} - ${metrics} Get Metrics Matching Indexes ${index} + ${metrics} Ctn Get Metrics Matching Indexes ${index} ${content1} Create List RRD: Starting to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} ${value} Evaluate ${m} / 2 - ${result} Compare RRD Average Value ${m} ${value} + ${result} Ctn Compare Rrd Average Value ${m} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. diff --git a/tests/broker-engine/rrdcached.robot b/tests/broker-engine/rrdcached.robot index 6f064ff9f5a..c130d06576f 100644 --- a/tests/broker-engine/rrdcached.robot +++ b/tests/broker-engine/rrdcached.robot @@ -3,43 +3,43 @@ Documentation Centreon Broker RRD metric rebuild/deletion with rrdcached Resource ../resources/import.resource -Suite Setup Clean Before Suite With rrdcached -Suite Teardown Clean After Suite With rrdcached -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite With rrdcached +Suite Teardown Ctn Clean After Suite With rrdcached +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BRRDCDDM1 [Documentation] RRD metrics deletion from metric ids with rrdcached. [Tags] rrd metric deletion rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd trace - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We choose 3 metrics to remove. - ${metrics} Get Metrics To Delete 3 + ${metrics} Ctn Get Metrics To Delete 3 Log To Console Metrics to delete ${metrics} ${empty} Create List - Remove Graphs 51001 ${empty} ${metrics} + Ctn Remove Graphs 51001 ${empty} ${metrics} ${metrics_str} Catenate SEPARATOR=, @{metrics} ${content} Create List metrics ${metrics_str} erased from database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} Log To Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted @@ -49,33 +49,33 @@ BRRDCDDM1 BRRDCDDID1 [Documentation] RRD metrics deletion from index ids with rrdcached. [Tags] rrd metric deletion rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd trace - Broker Config Log rrd core error - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log rrd core error + Ctn Create Metrics 3 ${start} Get Current Date Sleep 1s - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - ${indexes} Get Indexes To Delete 2 - ${metrics} Get Metrics Matching Indexes ${indexes} + ${indexes} Ctn Get Indexes To Delete 2 + ${metrics} Ctn Get Metrics Matching Indexes ${indexes} Log To Console indexes ${indexes} to delete with their metrics ${empty} Create List - Remove Graphs 51001 ${indexes} ${empty} + Ctn Remove Graphs 51001 ${indexes} ${empty} ${indexes_str} Catenate SEPARATOR=, @{indexes} ${content} Create List indexes ${indexes_str} erased from database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} Log To Console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted @@ -89,30 +89,30 @@ BRRDCDDID1 BRRDCDDMID1 [Documentation] RRD deletion of non existing metrics and indexes with rrdcached [Tags] rrd metric deletion rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd trace - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - ${indexes} Get Not Existing Indexes 2 - ${metrics} Get Not Existing Metrics 2 + ${indexes} Ctn Get Not Existing Indexes 2 + ${metrics} Ctn Get Not Existing Metrics 2 Log To Console indexes ${indexes} and metrics ${metrics} to delete but they do not exist. - Remove Graphs 51001 ${indexes} ${metrics} + Ctn Remove Graphs 51001 ${indexes} ${metrics} ${content} Create List do not appear in the storage database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ... ${result} ... A message telling indexes nor metrics appear in the storage database should appear. @@ -120,35 +120,35 @@ BRRDCDDMID1 BRRDCDDMU1 [Documentation] RRD metric deletion on table metric with unified sql output with rrdcached [Tags] rrd metric deletion unified_sql rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd trace - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We choose 3 metrics to remove. - ${metrics} Get Metrics To Delete 3 + ${metrics} Ctn Get Metrics To Delete 3 Log To Console metrics to delete ${metrics} ${empty} Create List - Remove Graphs 51001 ${empty} ${metrics} + Ctn Remove Graphs 51001 ${empty} ${metrics} ${metrics_str} Catenate SEPARATOR=, @{metrics} ${content} Create List metrics ${metrics_str} erased from database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 50 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 50 Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s @@ -157,35 +157,35 @@ BRRDCDDMU1 BRRDCDDIDU1 [Documentation] RRD metrics deletion from index ids with unified sql output with rrdcached. [Tags] rrd metric deletion unified_sql rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd trace - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - ${indexes} Get Indexes To Delete 2 - ${metrics} Get Metrics Matching Indexes ${indexes} + ${indexes} Ctn Get Indexes To Delete 2 + ${metrics} Ctn Get Metrics Matching Indexes ${indexes} Log To Console indexes ${indexes} to delete with their metrics ${empty} Create List - Remove Graphs 51001 ${indexes} ${empty} + Ctn Remove Graphs 51001 ${indexes} ${empty} ${indexes_str} Catenate SEPARATOR=, @{indexes} ${content} Create List indexes ${indexes_str} erased from database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s @@ -197,31 +197,31 @@ BRRDCDDIDU1 BRRDCDDMIDU1 [Documentation] RRD deletion of non existing metrics and indexes with rrdcached [Tags] rrd metric deletion unified_sql rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker module - Broker Config Log central sql info - Broker Config Log rrd rrd trace - Broker Config Log rrd core error - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker module + Ctn Broker Config Log central sql info + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log rrd core error + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - ${indexes} Get Not Existing Indexes 2 - ${metrics} Get Not Existing Metrics 2 + ${indexes} Ctn Get Not Existing Indexes 2 + ${metrics} Ctn Get Not Existing Metrics 2 Log To Console indexes ${indexes} and metrics ${metrics} to delete but they do not exist. - Remove Graphs 51001 ${indexes} ${metrics} + Ctn Remove Graphs 51001 ${indexes} ${metrics} ${content} Create List do not appear in the storage database - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ... ${result} ... A message telling indexes nor metrics appear in the storage database should appear. @@ -229,47 +229,47 @@ BRRDCDDMIDU1 BRRDCDRB1 [Documentation] RRD metric rebuild with gRPC API. 3 indexes are selected then a message to rebuild them is sent. This is done with storage/sql sql output and rrdcached. [Tags] rrd metric rebuild grpc rrdcached - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker module - Broker Config Log rrd rrd trace - Broker Config Log central sql trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs 51001 ${index} 1 + ${index} Ctn Get Indexes To Rebuild 3 + Ctn Rebuild Rrd Graphs 51001 ${index} 1 Log To Console Indexes to rebuild: ${index} - ${metrics} Get Metrics Matching Indexes ${index} + ${metrics} Ctn Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} ${content} Create List Metric rebuild: metric is sent to rebuild - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Central did not send metrics to rebuild ${content1} Create List RRD: Starting to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} ${value} Evaluate ${m} / 2 - ${result} Compare RRD Average Value ${m} ${value} + ${result} Ctn Compare Rrd Average Value ${m} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. @@ -277,7 +277,7 @@ BRRDCDRB1 FOR ${index_id} IN @{index} ${value} Evaluate ${index_id} %3 - ${result} Compare RRD Status Average Value ${index_id} ${value} + ${result} Ctn Compare Rrd Status Average Value ${index_id} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 50 if modulo==2 . @@ -286,50 +286,50 @@ BRRDCDRB1 BRRDCDRBU1 [Documentation] RRD metric rebuild with gRPC API. 3 indexes are selected then a message to rebuild them is sent. This is done with unified_sql output and rrdcached. [Tags] rrd metric rebuild unified_sql grpc - Config Engine ${1} - Config Broker rrd - Add Path To RRD Output rrd ${BROKER_LIB}/rrdcached.sock - Config Broker central - Config Broker module - Config Broker Sql Output central unified_sql - Broker Config Log rrd rrd trace - Broker Config Log central sql trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Create Metrics 3 + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Add Path To Rrd Output rrd ${BROKER_LIB}/rrdcached.sock + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Create Metrics 3 ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs 51001 ${index} 1 + ${index} Ctn Get Indexes To Rebuild 3 + Ctn Rebuild Rrd Graphs 51001 ${index} 1 Log To Console Indexes to rebuild: ${index} - ${metrics} Get Metrics Matching Indexes ${index} + ${metrics} Ctn Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} ${content} Create List Metric rebuild: metric is sent to rebuild - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Central did not send metrics to rebuild ${content1} Create List RRD: Starting to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} ${value} Evaluate ${m} / 2 - ${result} Compare RRD Average Value ${m} ${value} + ${result} Ctn Compare Rrd Average Value ${m} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. @@ -337,7 +337,7 @@ BRRDCDRBU1 FOR ${index_id} IN @{index} ${value} Evaluate ${index_id} %3 - ${result} Compare RRD Status Average Value ${index_id} ${value} + ${result} Ctn Compare Rrd Status Average Value ${index_id} ${value} Should Be True ... ${result} ... Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 50 if modulo==2 . diff --git a/tests/broker-engine/scheduler.robot b/tests/broker-engine/scheduler.robot index 0024315ed37..25480c357c1 100644 --- a/tests/broker-engine/scheduler.robot +++ b/tests/broker-engine/scheduler.robot @@ -3,43 +3,43 @@ Documentation Centreon Broker and Engine log_v2 Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** ENRSCHE1 [Documentation] Verify that next check of a rescheduled host is made at last_check + interval_check [Tags] broker engine scheduler - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_level_checks debug - Engine Config Set Value ${0} log_flush_period 0 True + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_level_checks debug + Ctn Engine Config Set Value ${0} log_flush_period 0 True ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected ${content} Set Variable Rescheduling next check of host: host_14 # We check a retry check rescheduling - Process Host Check Result host_14 1 host_14 is down + Ctn Process Host Check Result host_14 1 host_14 is down - ${result} Check Reschedule With Timeout ${engineLog0} ${start} ${content} True 240 + ${result} Ctn Check Reschedule With Timeout ${engineLog0} ${start} ${content} True 240 Should Be True ${result} The delta between last_check and next_check is not equal to 60 as expected for a retry check # We check a normal check rescheduling ${start} Get Current Date - ${result} Check Reschedule With Timeout ${engineLog0} ${start} ${content} False 240 + ${result} Ctn Check Reschedule With Timeout ${engineLog0} ${start} ${content} False 240 Should Be True ${result} The delta between last_check and next_check is not equal to 300 as expected for a normal check - [Teardown] Stop Engine Broker And Save Logs + [Teardown] Ctn Stop Engine Broker And Save Logs diff --git a/tests/broker-engine/servicegroups.robot b/tests/broker-engine/servicegroups.robot index 6d40d5612e3..51f0e511542 100644 --- a/tests/broker-engine/servicegroups.robot +++ b/tests/broker-engine/servicegroups.robot @@ -3,152 +3,152 @@ Documentation Centreon Broker and Engine add servicegroup Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Stop Engine Broker And Save Logs +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Stop Engine Broker And Save Logs *** Test Cases *** EBNSG1 [Documentation] New service group with several pollers and connections to DB [Tags] broker engine servicegroup - Config Engine ${3} - Config Broker rrd - Config Broker central - Config Broker module ${3} + Ctn Config Engine ${3} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} - Broker Config Log central sql info - Broker Config Output Set central central-broker-master-sql connections_count 5 - Broker Config Output Set central central-broker-master-perfdata connections_count 5 + Ctn Broker Config Log central sql info + Ctn Broker Config Output Set central central-broker-master-sql connections_count 5 + Ctn Broker Config Output Set central central-broker-master-perfdata connections_count 5 - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine - Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] - Config Engine Add Cfg File ${0} servicegroups.cfg + Ctn Start Broker + Ctn Start engine + Ctn Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] + Ctn Config Engine Add Cfg File ${0} servicegroups.cfg Sleep 3s - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine ${content} Create List ... enabling membership of service (1, 3) to service group 1 on instance 1 ... enabling membership of service (1, 2) to service group 1 on instance 1 ... enabling membership of service (1, 1) to service group 1 on instance 1 - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 45 Should Be True ${result} One of the new service groups not found in logs. EBNSGU1 [Documentation] New service group with several pollers and connections to DB with broker configured with unified_sql [Tags] broker engine servicegroup unified_sql - Config Engine ${3} - Config Broker rrd - Config Broker central - Config Broker module + Ctn Config Engine ${3} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module - Broker Config Log central sql info - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql connections_count 5 + Ctn Broker Config Log central sql info + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5 - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine - Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] - Config Engine Add Cfg File ${0} servicegroups.cfg + Ctn Start Broker + Ctn Start engine + Ctn Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] + Ctn Config Engine Add Cfg File ${0} servicegroups.cfg Sleep 3s - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine ${content} Create List ... enabling membership of service (1, 3) to service group 1 on instance 1 ... enabling membership of service (1, 2) to service group 1 on instance 1 ... enabling membership of service (1, 1) to service group 1 on instance 1 - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 45 Should Be True ${result} One of the new service groups not found in logs. EBNSGU2 [Documentation] New service group with several pollers and connections to DB with broker configured with unified_sql [Tags] broker engine servicegroup unified_sql - Config Engine ${4} - Config Broker rrd - Config Broker central - Config Broker module ${4} - - Broker Config Log central sql info - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql connections_count 5 - Config BBDO3 4 - Broker Config Log central sql debug - - Clear Retention - Start Broker - Start Engine - Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] - Add Service Group ${1} ${1} ["host_14","service_261", "host_14","service_262","host_14", "service_263"] - Add Service Group ${2} ${1} ["host_27","service_521", "host_27","service_522","host_27", "service_523"] - Add Service Group ${3} ${1} ["host_40","service_781", "host_40","service_782","host_40", "service_783"] - Config Engine Add Cfg File ${0} servicegroups.cfg - Config Engine Add Cfg File ${1} servicegroups.cfg - Config Engine Add Cfg File ${2} servicegroups.cfg - Config Engine Add Cfg File ${3} servicegroups.cfg + Ctn Config Engine ${4} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${4} + + Ctn Broker Config Log central sql info + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5 + Ctn Config BBDO3 4 + Ctn Broker Config Log central sql debug + + Ctn Clear Retention + Ctn Start Broker + Ctn Start engine + Ctn Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] + Ctn Add Service Group ${1} ${1} ["host_14","service_261", "host_14","service_262","host_14", "service_263"] + Ctn Add Service Group ${2} ${1} ["host_27","service_521", "host_27","service_522","host_27", "service_523"] + Ctn Add Service Group ${3} ${1} ["host_40","service_781", "host_40","service_782","host_40", "service_783"] + Ctn Config Engine Add Cfg File ${0} servicegroups.cfg + Ctn Config Engine Add Cfg File ${1} servicegroups.cfg + Ctn Config Engine Add Cfg File ${2} servicegroups.cfg + Ctn Config Engine Add Cfg File ${3} servicegroups.cfg Sleep 3s - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine Sleep 3s - ${result} Check Number Of Relations Between Servicegroup And Services 1 12 30 + ${result} Ctn Check Number Of Relations Between Servicegroup And Services 1 12 30 Should Be True ${result} We should get 12 relations between the servicegroup 1 and services. - Config Engine Remove Cfg File ${0} servicegroups.cfg - Reload Broker - Reload Engine + Ctn Config Engine Remove Cfg File ${0} servicegroups.cfg + Ctn Reload Broker + Ctn Reload Engine - ${result} Check Number Of Relations Between Servicegroup And Services 1 9 30 + ${result} Ctn Check Number Of Relations Between Servicegroup And Services 1 9 30 Should Be True ${result} We should get 9 relations between the servicegroup 1 and services. EBNSGU3_${test_label} [Documentation] New service group with several pollers and connections to DB with broker and rename this servicegroup [Tags] broker engine servicegroup unified_sql - Config Engine ${3} - Config Broker rrd - Config Broker central - Config Broker module ${3} - - Broker Config Log central sql trace - Broker Config Log central lua trace - Broker Config Source Log central 1 - Broker Config Source Log module0 1 - Config Broker Sql Output central unified_sql 5 - Broker Config Output Set central central-broker-unified-sql connections_count 5 - Broker Config Add Lua Output central test-cache ${SCRIPTS}test-dump-groups.lua - Clear Retention + Ctn Config Engine ${3} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central lua trace + Ctn Broker Config Source Log central 1 + Ctn Broker Config Source Log module0 1 + Ctn Config Broker Sql Output central unified_sql 5 + Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5 + Ctn Broker Config Add Lua Output central test-cache ${SCRIPTS}test-dump-groups.lua + Ctn Clear Retention Create File /tmp/lua-engine.log - IF ${Use_BBDO3} Config BBDO3 ${3} + IF ${Use_BBDO3} Ctn Config BBDO3 ${3} - Config BBDO3 ${3} + Ctn Config BBDO3 ${3} ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s - Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] - Add Service Group ${1} ${1} ["host_18","service_341", "host_19","service_362","host_19", "service_363"] - Add Service Group ${2} ${1} ["host_35","service_681", "host_35","service_682","host_36", "service_706"] - Config Engine Add Cfg File ${0} servicegroups.cfg - Config Engine Add Cfg File ${1} servicegroups.cfg - Config Engine Add Cfg File ${2} servicegroups.cfg + Ctn Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] + Ctn Add Service Group ${1} ${1} ["host_18","service_341", "host_19","service_362","host_19", "service_363"] + Ctn Add Service Group ${2} ${1} ["host_35","service_681", "host_35","service_682","host_36", "service_706"] + Ctn Config Engine Add Cfg File ${0} servicegroups.cfg + Ctn Config Engine Add Cfg File ${1} servicegroups.cfg + Ctn Config Engine Add Cfg File ${2} servicegroups.cfg - Reload Broker - Reload Engine + Ctn Reload Broker + Ctn Reload Engine - ${result} Check Number Of Relations Between Servicegroup And Services 1 9 30 + ${result} Ctn Check Number Of Relations Between Servicegroup And Services 1 9 30 Should Be True ${result} We should get 9 relations between the servicegroup 1 and services. FOR ${loop_index} IN RANGE 30 @@ -159,13 +159,13 @@ EBNSGU3_${test_label} Should Be True len("""${grep_result}""") > 10 servicegroup_1 not found in /tmp/lua-engine.log - Rename Service Group ${0} servicegroup_1 servicegroup_test - Rename Service Group ${1} servicegroup_1 servicegroup_test - Rename Service Group ${2} servicegroup_1 servicegroup_test + Ctn Rename Service Group ${0} servicegroup_1 servicegroup_test + Ctn Rename Service Group ${1} servicegroup_1 servicegroup_test + Ctn Rename Service Group ${2} servicegroup_1 servicegroup_test - Reload Engine - Reload Broker - ${result} Check Number Of Relations Between Servicegroup And Services 1 9 30 servicegroup_test + Ctn Reload Engine + Ctn Reload Broker + ${result} Ctn Check Number Of Relations Between Servicegroup And Services 1 9 30 servicegroup_test Should Be True ${result} We should get 9 relations between the servicegroup 1 and services. Log To Console \nservicegroup_1 renamed to servicegroup_test @@ -179,13 +179,13 @@ EBNSGU3_${test_label} Should Be True len("""${grep_result}""") > 10 servicegroup_test not found in /tmp/lua-engine.log # remove servicegroup - Config Engine ${3} - Reload Engine - Reload Broker + Ctn Config Engine ${3} + Ctn Reload Engine + Ctn Reload Broker Log To Console \nremove servicegroup - ${result} Check Number Of Relations Between Servicegroup And Services 1 0 30 + ${result} Ctn Check Number Of Relations Between Servicegroup And Services 1 0 30 Should Be True ${result} still a relation between the servicegroup 1 and services. # clear lua file diff --git a/tests/broker-engine/services-and-bulk-stmt.robot b/tests/broker-engine/services-and-bulk-stmt.robot index b7252505420..5662fbdba12 100644 --- a/tests/broker-engine/services-and-bulk-stmt.robot +++ b/tests/broker-engine/services-and-bulk-stmt.robot @@ -3,45 +3,45 @@ Documentation Centreon Broker and Engine progressively add services Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Test Clean +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Test Clean *** Test Cases *** EBBPS1 [Documentation] 1000 service check results are sent to the poller. The test is done with the unified_sql stream, no service status is lost, we find the 1000 results in the database: table resources. [Tags] broker engine services unified_sql - Config Engine ${1} ${1} ${1000} + Ctn Config Engine ${1} ${1} ${1000} # We want all the services to be passive to avoid parasite checks during our test. - Set Services Passive ${0} service_.* - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core info - Broker Config Log central tcp error - Broker Config Log central sql trace - Broker Config Log central perfdata trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Set Services Passive ${0} service_.* + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core info + Ctn Broker Config Log central tcp error + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central perfdata trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention ${start} Get Current Date ${start_broker} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_1;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 30 Should Be True ... ${result} ... An Initial service state on host_1:service_1000 should be raised before we can start external commands. FOR ${i} IN RANGE ${1000} - Process Service Check Result host_1 service_${i+1} 1 warning${i} + Ctn Process Service Check Result host_1 service_${i+1} 1 warning${i} END ${content} Create List ... connected to 'MariaDB' Server ... it supports column-wise binding in prepared statements - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Prepared statements should be supported with this version of MariaDB. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -57,28 +57,28 @@ EBBPS1 Should Be Equal As Strings ${output} ((0,),) FOR ${i} IN RANGE ${1000} - Process Service Check Result host_1 service_${i+1} 2 warning${i} + Ctn Process Service Check Result host_1 service_${i+1} 2 warning${i} IF ${i} % 200 == 0 ${first_service_status_content} Create List unified_sql service_status processing - ${result} Find In Log With Timeout + ${result} Ctn Find In Log With Timeout ... ${centralLog} ... ${start_broker} ... ${first_service_status_content} ... 30 Should Be True ${result} No service_status processing found. Log To Console Stopping Broker - Kindly Stop Broker + Ctn Kindly Stop Broker Log To Console Waiting for 5s Sleep 5s Log To Console Restarting Broker ${start_broker} Get Current Date - Start Broker + Ctn Start Broker END END ${content} Create List ... connected to 'MariaDB' Server ... it supports column-wise binding in prepared statements - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Prepared statements should be supported with this version of MariaDB. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -96,35 +96,35 @@ EBBPS1 EBBPS2 [Documentation] 1000 service check results are sent to the poller. The test is done with the unified_sql stream, no service status is lost, we find the 1000 results in the database: table services. [Tags] broker engine services unified_sql - Config Engine ${1} ${1} ${1000} + Ctn Config Engine ${1} ${1} ${1000} # We want all the services to be passive to avoid parasite checks during our test. - Set Services Passive ${0} service_.* - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core info - Broker Config Log central tcp error - Broker Config Log central sql trace - Broker Config Log central perfdata trace - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Set Services Passive ${0} service_.* + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core info + Ctn Broker Config Log central tcp error + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central perfdata trace + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention ${start} Get Current Date ${start_broker} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List INITIAL SERVICE STATE: host_1;service_1000; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 30 Should Be True ... ${result} ... An Initial service state on host_1:service_1000 should be raised before we can start external commands. FOR ${i} IN RANGE ${1000} - Process Service Check Result host_1 service_${i+1} 1 warning${i} + Ctn Process Service Check Result host_1 service_${i+1} 1 warning${i} END ${content} Create List ... connected to 'MariaDB' Server ... it supports column-wise binding in prepared statements - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Prepared statements should be supported with this version of MariaDB. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -140,27 +140,27 @@ EBBPS2 Should Be Equal As Strings ${output} ((0,),) FOR ${i} IN RANGE ${1000} - Process Service Check Result host_1 service_${i+1} 2 critical${i} + Ctn Process Service Check Result host_1 service_${i+1} 2 critical${i} IF ${i} % 200 == 0 ${first_service_status_content} Create List unified_sql service_status processing - ${result} Find In Log With Timeout + ${result} Ctn Find In Log With Timeout ... ${centralLog} ... ${start_broker} ... ${first_service_status_content} ... 30 Should Be True ${result} No service_status processing found. - Kindly Stop Broker + Ctn Kindly Stop Broker Log To Console Waiting for 5s Sleep 5s Log To Console Restarting Broker ${start_broker} Get Current Date - Start Broker + Ctn Start Broker END END ${content} Create List ... connected to 'MariaDB' Server ... it supports column-wise binding in prepared statements - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Prepared statements should be supported with this version of MariaDB. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -178,37 +178,37 @@ EBBPS2 EBMSSM [Documentation] 1000 services are configured with 100 metrics each. The rrd output is removed from the broker configuration. GetSqlManagerStats is called to measure writes into data_bin. [Tags] broker engine services unified_sql benchmark - Clear Metrics - Config Engine ${1} ${1} ${1000} + Ctn Clear Metrics + Ctn Config Engine ${1} ${1} ${1000} # We want all the services to be passive to avoid parasite checks during our test. - Set Services Passive ${0} service_.* - Config Broker central - Config Broker rrd - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central core error - Broker Config Log central tcp error - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Config Broker Remove Rrd Output central - Clear Retention + Ctn Set Services Passive ${0} service_.* + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central tcp error + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker Remove Rrd Output central + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine - Broker Set Sql Manager Stats 51001 5 5 + Ctn Start Broker + Ctn Start engine + Ctn Broker Set Sql Manager Stats 51001 5 5 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${start} Get Round Current Date + ${start} Ctn Get Round Current Date # Let's wait for one "INSERT INTO data_bin" to appear in stats. FOR ${i} IN RANGE ${1000} - Process Service Check Result With Metrics host_1 service_${i+1} 1 warning${i} 100 + Ctn Process Service Check Result With Metrics host_1 service_${i+1} 1 warning${i} 100 END - ${duration} Broker Get Sql Manager Stats 51001 INSERT INTO data_bin 300 + ${duration} Ctn Broker Get Sql Manager Stats 51001 INSERT INTO data_bin 300 Should Be True ${duration} > 0 # Let's wait for all force checks to be in the storage database. @@ -224,59 +224,59 @@ EBMSSM EBPS2 [Documentation] 1000 services are configured with 20 metrics each. The rrd output is removed from the broker configuration to avoid to write too many rrd files. While metrics are written in bulk, the database is stopped. This must not crash broker. [Tags] broker engine services unified_sql benchmark - Clear Metrics - Config Engine ${1} ${1} ${1000} + Ctn Clear Metrics + Ctn Config Engine ${1} ${1} ${1000} # We want all the services to be passive to avoid parasite checks during our test. - Set Services Passive ${0} service_.* - Config Broker central - Config Broker rrd - Config Broker module ${1} - Config BBDO3 1 - Broker Config Flush Log central 0 - Broker Config Log central core error - Broker Config Log central tcp error - Broker Config Log central sql trace - Broker Config Log central perfdata debug - Config Broker Sql Output central unified_sql - Config Broker Remove Rrd Output central - Clear Retention + Ctn Set Services Passive ${0} service_.* + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Log central core error + Ctn Broker Config Log central tcp error + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central perfdata debug + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker Remove Rrd Output central + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # Let's wait for one "INSERT INTO data_bin" to appear in stats. FOR ${i} IN RANGE ${1000} - Process Service Check Result With Metrics host_1 service_${i+1} 1 warning${i} 20 + Ctn Process Service Check Result With Metrics host_1 service_${i+1} 1 warning${i} 20 END ${start} Get Current Date ${content} Create List Check if some statements are ready, sscr_bind connections - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} A message telling that statements are available should be displayed - Stop mysql - Stop Engine - Start mysql + Ctn Stop Mysql + Ctn Stop engine + Ctn Start Mysql RLCode [Documentation] Test if reloading LUA code in a stream connector applies the changes [Tags] lua stream connector - Clear Commands Status - Clear Retention + Ctn Clear Commands Status + Ctn Clear Retention Remove File /tmp/toto.lua - Config Engine ${1} ${1} ${10} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central tcp error - Broker Config Log central sql error - Broker Config Log central lua debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${1} ${10} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central tcp error + Ctn Broker Config Log central sql error + Ctn Broker Config Log central lua debug + Ctn Config Broker Sql Output central unified_sql ${INITIAL_SCRIPT_CONTENT} Catenate ... function init(params) @@ -291,20 +291,20 @@ RLCode # Create the initial LUA script file Create File /tmp/toto.lua ${INITIAL_SCRIPT_CONTENT} - Broker Config Add Lua Output central test-toto /tmp/toto.lua + Ctn Broker Config Add Lua Output central test-toto /tmp/toto.lua # Start the engine/broker ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} The lua virtual machine is not correctly initialized # Define the new content to take place of the first one @@ -322,30 +322,30 @@ RLCode Create File /tmp/toto.lua ${new_content} ${start} Get Current Date - Reload Broker + Ctn Reload Broker ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} The Lua virtual machine is not correctly initialized - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker metric_mapping [Documentation] Check if metric name exists using a stream connector [Tags] broker engine bbdo unified_sql metric - Clear Commands Status - Clear Retention + Ctn Clear Commands Status + Ctn Clear Retention Remove File /tmp/test.log - Config Engine ${1} ${1} ${10} - Config Broker central - Config Broker module - Broker Config Add Item central bbdo_version 3.0.1 - Broker Config Add Item module0 bbdo_version 3.0.1 - Broker Config Log central lua debug - Broker Config Log module0 neb debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${1} ${10} + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Add Item central bbdo_version 3.0.1 + Ctn Broker Config Add Item module0 bbdo_version 3.0.1 + Ctn Broker Config Log central lua debug + Ctn Broker Config Log module0 neb debug + Ctn Config Broker Sql Output central unified_sql ${new_content} Catenate ... function init(params) @@ -362,20 +362,20 @@ metric_mapping # Create the initial LUA script file Create File /tmp/test-metric.lua ${new_content} - Broker Config Add Lua Output central test-metric /tmp/test-metric.lua + Ctn Broker Config Add Lua Output central test-metric /tmp/test-metric.lua ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message about check_for_external_commands() should be available. # We force several checks with metrics FOR ${i} IN RANGE ${10} - Process Service Check Result With Metrics host_1 service_${i+1} 1 warning${i} 20 + Ctn Process Service Check Result With Metrics host_1 service_${i+1} 1 warning${i} 20 END Wait Until Created /tmp/test.log 30s @@ -385,39 +385,39 @@ metric_mapping Services_and_bulks_${id} [Documentation] One service is configured with one metric with a name of 150 to 1021 characters. [Tags] broker engine services unified_sql benchmark - Clear Metrics - Config Engine ${1} ${1} ${1} + Ctn Clear Metrics + Ctn Config Engine ${1} ${1} ${1} # We want all the services to be passive to avoid parasite checks during our test. ${random_string} Generate Random String ${metric_num_char} [LOWER] - Set Services passive ${0} service_.* - Config Broker central - Config Broker rrd - Config Broker module ${1} - Broker Config Add Item module0 bbdo_version 3.0.1 - Broker Config Add Item central bbdo_version 3.0.1 - Broker Config Log central core error - Broker Config Log central tcp error - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Broker Config Source Log central 1 - - Config Broker Remove Rrd Output central - Clear Retention - Clear Db metrics + Ctn Set Services Passive ${0} service_.* + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Broker Config Add Item module0 bbdo_version 3.0.1 + Ctn Broker Config Add Item central bbdo_version 3.0.1 + Ctn Broker Config Log central core error + Ctn Broker Config Log central tcp error + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Source Log central 1 + + Ctn Config Broker Remove Rrd Output central + Ctn Clear Retention + Ctn Clear Db metrics ${start} Get Current Date - Start Broker - Start Engine - Broker Set Sql Manager Stats 51001 5 5 + Ctn Start Broker + Ctn Start engine + Ctn Broker Set Sql Manager Stats 51001 5 5 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${start_1} Get Round Current Date + ${start_1} Ctn Get Round Current Date - Process Service Check result with metrics + Ctn Process Service Check Result With Metrics ... host_1 ... service_${1} ... ${1} @@ -428,10 +428,10 @@ Services_and_bulks_${id} ${content} Create List new perfdata inserted ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result} Find In Log With Timeout ${log} ${start_1} ${content} 60 + ${result} Ctn Find In Log With Timeout ${log} ${start_1} ${content} 60 Should Be True ${result} A message fail to handle a metric with ${metric_num_char} characters. - ${metrics} Get Metrics For Service 1 ${random_string}0 + ${metrics} Ctn Get Metrics For Service 1 ${random_string}0 Should Not Be Equal ${metrics} ${None} no metric found for service Examples: id metric_num_char -- @@ -440,7 +440,7 @@ Services_and_bulks_${id} *** Keywords *** -Test Clean - Stop Engine - Kindly Stop Broker - Save Logs If Failed +Ctn Test Clean + Ctn Stop engine + Ctn Kindly Stop Broker + Ctn Save Logs If Failed diff --git a/tests/broker-engine/services-increased.robot b/tests/broker-engine/services-increased.robot index 50ea231cd4d..895c6187de0 100644 --- a/tests/broker-engine/services-increased.robot +++ b/tests/broker-engine/services-increased.robot @@ -3,103 +3,103 @@ Documentation Centreon Broker and Engine progressively add services Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** EBNSVC1 [Documentation] New services with several pollers [Tags] broker engine services protobuf - Config Engine ${3} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${3} - Config BBDO3 3 - Broker Config Log central sql debug - Config Broker Sql Output central unified_sql - Clear Retention + Ctn Config Engine ${3} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + Ctn Config BBDO3 3 + Ctn Broker Config Log central sql debug + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine FOR ${i} IN RANGE ${3} Sleep 10s ${srv_by_host} Evaluate 20 + 4 * $i Log To Console ${srv_by_host} services by host with 50 hosts among 3 pollers. - Config Engine ${3} ${50} ${srv_by_host} - Reload Engine - Reload Broker + Ctn Config Engine ${3} ${50} ${srv_by_host} + Ctn Reload Engine + Ctn Reload Broker ${nb_srv} Evaluate 17 * (20 + 4 * $i) ${nb_res} Evaluate $nb_srv + 17 - ${result} Check Number Of Resources Monitored by Poller is ${1} ${nb_res} 30 + ${result} Ctn Check Number Of Resources Monitored By Poller Is ${1} ${nb_res} 30 Should Be True ${result} Poller 1 should monitor ${nb_srv} services and 17 hosts. - ${result} Check Number Of Resources Monitored by Poller is ${2} ${nb_res} 30 + ${result} Ctn Check Number Of Resources Monitored By Poller Is ${2} ${nb_res} 30 Should Be True ${result} Poller 2 should monitor ${nb_srv} services and 17 hosts. ${nb_srv} Evaluate 16 * (20 + 4 * $i) ${nb_res} Evaluate $nb_srv + 16 - ${result} Check Number Of Resources Monitored by Poller is ${3} ${nb_res} 30 + ${result} Ctn Check Number Of Resources Monitored By Poller Is ${3} ${nb_res} 30 Should Be True ${result} Poller 3 should monitor ${nb_srv} services and 16 hosts. END - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker Service_increased_huge_check_interval [Documentation] New services with high check interval at creation time. [Tags] broker engine services protobuf - Config Engine ${1} ${10} ${10} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Broker Config Source Log central 1 - Config BBDO3 1 - Broker Config Log rrd rrd trace - Broker Config Log central sql debug - Broker Config Log rrd core error - Config Broker Sql Output central unified_sql 10 - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Clear Retention - Clear Db services - Clear Db index_data - Clear Db metrics - - Delete All Rrd Metrics + Ctn Config Engine ${1} ${10} ${10} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Source Log central 1 + Ctn Config BBDO3 1 + Ctn Broker Config Log rrd rrd trace + Ctn Broker Config Log central sql debug + Ctn Broker Config Log rrd core error + Ctn Config Broker Sql Output central unified_sql 10 + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Clear Retention + Ctn Clear Db services + Ctn Clear Db index_data + Ctn Clear Db metrics + + Ctn Delete All Rrd Metrics ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Start Checkers - ${result} Check Host Status host_1 4 1 False + ${result} Ctn Check Host Status host_1 4 1 False Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} "host_1 init not found in log" # End Checkers - Process Service Check Result With Metrics host_1 service_1 1 warning0 1 + Ctn Process Service Check Result With Metrics host_1 service_1 1 warning0 1 ${content} Create List new pb data for metric - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content} 60 - ${index} Get Indexes To Rebuild 2 - ${metrics} Get Metrics Matching Indexes ${index} + ${index} Ctn Get Indexes To Rebuild 2 + ${metrics} Ctn Get Metrics Matching Indexes ${index} Log To Console Metrics: ${metrics} FOR ${m} IN @{metrics} - ${result} Check RRD Info ${m} ds[value].minimal_heartbeat 3000 + ${result} Ctn Check Rrd Info ${m} ds[value].minimal_heartbeat 3000 Should Be True ... ${result} ... ds[value].minimal_heartbeat must be equal to 3000 - ${result} Check RRD Info ${m} rra[0].pdp_per_row 300 + ${result} Ctn Check Rrd Info ${m} rra[0].pdp_per_row 300 Should Be True ... ${result} ... rra[0].pdp_per_row must be equal to 300 END - ${new_service_id} Create Service 0 1 1 + ${new_service_id} Ctn Create Service 0 1 1 Log To Console new service: ${new_service_id} @@ -108,40 +108,40 @@ Service_increased_huge_check_interval Execute Sql String ... INSERT INTO index_data (host_id, service_id, host_name, service_description) VALUES (1, ${new_service_id}, 'host1', 'service_${new_service_id}') - Engine Config Replace Value In Services 0 service_${new_service_id} check_interval 90 + Ctn Engine Config Replace Value In Services 0 service_${new_service_id} check_interval 90 ${start} Get Current Date - Reload Engine + Ctn Reload Engine ${content} Create List INITIAL SERVICE STATE: host_1;service_${new_service_id}; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} "service_"${new_service_id}" init not found in log" ${start} Get Current Date Sleep 5 - Process Service Check Result With Metrics host_1 service_${new_service_id} 1 warning0 1 + Ctn Process Service Check Result With Metrics host_1 service_${new_service_id} 1 warning0 1 - ${metrics} Get Metrics For Service ${new_service_id} + ${metrics} Ctn Get Metrics For Service ${new_service_id} Should Not Be Equal ${metrics} ${None} no metric found for service ${new_service_id} FOR ${m} IN @{metrics} - ${result} Wait Until File Modified ${VarRoot}/lib/centreon/metrics/${m}.rrd ${start} + ${result} Ctn Wait Until File Modified ${VarRoot}/lib/centreon/metrics/${m}.rrd ${start} Should Be True ... ${result} ... ${VarRoot}/lib/centreon/metrics/${m}.rrd should have been modified since ${start} - ${result} Check RRD Info ${m} ds[value].minimal_heartbeat 54000 + ${result} Ctn Check Rrd Info ${m} ds[value].minimal_heartbeat 54000 Should Be True ... ${result} ... ds[value].minimal_heartbeat must be equal to 54000 for metric ${m} - ${result} Check RRD Info ${m} rra[0].pdp_per_row 5400 + ${result} Ctn Check Rrd Info ${m} rra[0].pdp_per_row 5400 Should Be True ... ${result} ... rra[0].pdp_per_row must be equal to 5400 for metric ${m} END - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker diff --git a/tests/broker-engine/services-with-notes-and-actions.robot b/tests/broker-engine/services-with-notes-and-actions.robot index 52afea3ab39..31bdbdeacf3 100644 --- a/tests/broker-engine/services-with-notes-and-actions.robot +++ b/tests/broker-engine/services-with-notes-and-actions.robot @@ -3,29 +3,29 @@ Documentation Centreon Broker and Engine progressively add services Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** EBSNU1 [Documentation] New services with notes_url with more than 2000 characters [Tags] broker engine services protobuf - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central sql debug - Broker Config Log central bbdo debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Broker Config Log central bbdo debug + Ctn Config Broker Sql Output central unified_sql ${nu} Evaluate 2000*"X" - Engine Config Set Value In Services 0 service_1 notes_url ${nu} - Clear Retention - Start Broker - Start Engine + Ctn Engine Config Set Value In Services 0 service_1 notes_url ${nu} + Ctn Clear Retention + Ctn Start Broker + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -40,25 +40,25 @@ EBSNU1 IF "${output}" == "(('${nu}',),)" BREAK END Should Be Equal As Strings ${output} (('${nu}',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EBSAU2 [Documentation] New services with action_url with more than 2000 characters [Tags] broker engine services protobuf - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central sql debug - Broker Config Log central bbdo debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Broker Config Log central bbdo debug + Ctn Config Broker Sql Output central unified_sql ${au} Evaluate 2000*"Y" - Engine Config Set Value In Services 0 service_2 action_url ${au} - Clear Retention - Start Broker - Start Engine + Ctn Engine Config Set Value In Services 0 service_2 action_url ${au} + Ctn Clear Retention + Ctn Start Broker + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -73,25 +73,25 @@ EBSAU2 IF "${output}" == "(('${au}',),)" BREAK END Should Be Equal As Strings ${output} (('${au}',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EBSN3 [Documentation] New services with notes with more than 500 characters [Tags] broker engine services protobuf - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central sql debug - Broker Config Log central bbdo debug - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Broker Config Log central bbdo debug + Ctn Config Broker Sql Output central unified_sql ${n} Evaluate 500*"Z" - Engine Config Set Value In Services 0 service_3 notes ${n} - Clear Retention - Start Broker - Start Engine + Ctn Engine Config Set Value In Services 0 service_3 notes ${n} + Ctn Clear Retention + Ctn Start Broker + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -106,5 +106,5 @@ EBSN3 IF "${output}" == "(('${n}',),)" BREAK END Should Be Equal As Strings ${output} (('${n}',),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/services.robot b/tests/broker-engine/services.robot index 6c94e50691f..5de10e96dfe 100644 --- a/tests/broker-engine/services.robot +++ b/tests/broker-engine/services.robot @@ -3,43 +3,43 @@ Documentation Centreon Broker and Engine progressively add services Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** SDER [Documentation] The check attempts and the max check attempts of (host_1,service_1) are changed to 280 thanks to the retention.dat file. Then engine and broker are started and broker should write these values in the services and resources tables. We only test the services table because we need a resources table that allows bigger numbers for these two attributes. But we see that broker doesn't crash anymore. [Tags] broker engine host extcmd - Config Engine ${1} ${1} ${25} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${1} ${25} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 neb trace + Ctn Config Broker Sql Output central unified_sql ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - Stop Engine + Ctn Stop engine - Modify Retention Dat 0 host_1 service_1 current_attempt 280 + Ctn Modify Retention Dat 0 host_1 service_1 current_attempt 280 # modified attributes is a bit field. We must set the bit corresponding to MAX_ATTEMPTS to be allowed to change max_attempts. Otherwise it will be set to 3. - Modify Retention Dat 0 host_1 service_1 modified_attributes 65535 - Modify Retention Dat 0 host_1 service_1 max_attempts 280 + Ctn Modify Retention Dat 0 host_1 service_1 modified_attributes 65535 + Ctn Modify Retention Dat 0 host_1 service_1 max_attempts 280 - Modify Retention Dat 0 host_1 service_1 current_state 2 - Modify Retention Dat 0 host_1 service_1 state_type 1 - Start Engine + Ctn Modify Retention Dat 0 host_1 service_1 current_state 2 + Ctn Modify Retention Dat 0 host_1 service_1 state_type 1 + Ctn Start engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -52,5 +52,5 @@ SDER END Should Be Equal As Strings ${output} ((280,),) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/start-stop.robot b/tests/broker-engine/start-stop.robot index 16af7e4e676..235fc2ffa08 100644 --- a/tests/broker-engine/start-stop.robot +++ b/tests/broker-engine/start-stop.robot @@ -3,491 +3,491 @@ Documentation Centreon Broker and Engine start/stop tests Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BESS1 [Documentation] Start-Stop Broker/Engine - Broker started first - Broker stopped first [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Start Broker - Start Engine - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine BESS2 [Documentation] Start-Stop Broker/Engine - Broker started first - Engine stopped first [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Start Broker - Start Engine - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} - ${result} Check Poller Enabled In Database 1 10 + ${result} Ctn Check Poller Enabled In Database 1 10 Should Be True ${result} - Stop Engine - ${result} Check Poller Disabled In Database 1 10 + Ctn Stop engine + ${result} Ctn Check Poller Disabled In Database 1 10 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker BESS3 [Documentation] Start-Stop Broker/Engine - Engine started first - Engine stopped first [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Start Engine - Start Broker - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Start engine + Ctn Start Broker + ${result} Ctn Check Connections Should Be True ${result} - ${result} Check Poller Enabled In Database 1 10 + ${result} Ctn Check Poller Enabled In Database 1 10 Should Be True ${result} - Stop Engine - ${result} Check Poller Disabled In Database 1 10 + Ctn Stop engine + ${result} Ctn Check Poller Disabled In Database 1 10 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker BESS4 [Documentation] Start-Stop Broker/Engine - Engine started first - Broker stopped first [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Start Engine - Start Broker - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Start engine + Ctn Start Broker + ${result} Ctn Check Connections Should Be True ${result} - ${result} Check Poller Enabled In Database 1 10 + ${result} Ctn Check Poller Enabled In Database 1 10 Should Be True ${result} - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine BESS5 [Documentation] Start-Stop Broker/engine - Engine debug level is set to all, it should not hang [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Engine Config Set Value ${0} debug_level ${-1} - Start Broker - Start Engine - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Engine Config Set Value ${0} debug_level ${-1} + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Broker and Engine seem not connected - [Teardown] Stop Engine Broker And Save Logs + [Teardown] Ctn Stop Engine Broker And Save Logs BESS_GRPC1 [Documentation] Start-Stop grpc version Broker/Engine - Broker started first - Broker stopped first [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Start Broker - Start Engine - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine BESS_GRPC2 [Documentation] Start-Stop grpc version Broker/Engine - Broker started first - Engine stopped first [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Start Broker - Start Engine - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} - ${result} Check Poller Enabled In Database 1 10 + ${result} Ctn Check Poller Enabled In Database 1 10 Should Be True ${result} - Stop Engine - ${result} Check Poller Disabled In Database 1 10 + Ctn Stop engine + ${result} Ctn Check Poller Disabled In Database 1 10 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker BESS_GRPC3 [Documentation] Start-Stop grpc version Broker/Engine - Engine started first - Engine stopped first [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Start Engine - Start Broker - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Start engine + Ctn Start Broker + ${result} Ctn Check Connections Should Be True ${result} - ${result} Check Poller Enabled In Database 1 10 + ${result} Ctn Check Poller Enabled In Database 1 10 Should Be True ${result} - Stop Engine - ${result} Check Poller Disabled In Database 1 10 + Ctn Stop engine + ${result} Ctn Check Poller Disabled In Database 1 10 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker BESS_GRPC4 [Documentation] Start-Stop grpc version Broker/Engine - Engine started first - Broker stopped first [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Start Engine - Start Broker - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Start engine + Ctn Start Broker + ${result} Ctn Check Connections Should Be True ${result} - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine BESS_GRPC5 [Documentation] Start-Stop grpc version Broker/engine - Engine debug level is set to all, it should not hang [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Engine Config Set Value ${0} debug_level ${-1} - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Start Broker - Start Engine - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Engine Config Set Value ${0} debug_level ${-1} + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} - ${result} Check Poller Enabled In Database 1 10 + ${result} Ctn Check Poller Enabled In Database 1 10 Should Be True ${result} - Stop Engine - ${result} Check Poller Disabled In Database 1 10 + Ctn Stop engine + ${result} Ctn Check Poller Disabled In Database 1 10 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker BESS_GRPC_COMPRESS1 [Documentation] Start-Stop grpc version Broker/Engine - Broker started first - Broker stopped last compression activated [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Change Broker Compression Output module0 central-module-master-output yes - Change Broker Compression Input central centreon-broker-master-input yes - Start Broker - Start Engine - ${result} Check Connections + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Change Broker Compression Output module0 central-module-master-output yes + Ctn Change Broker Compression Input central centreon-broker-master-input yes + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} - ${result} Check Poller Enabled In Database 1 10 + ${result} Ctn Check Poller Enabled In Database 1 10 Should Be True ${result} - Stop Engine - ${result} Check Poller Disabled In Database 1 10 + Ctn Stop engine + ${result} Ctn Check Poller Disabled In Database 1 10 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker BESS_CRYPTED_GRPC1 [Documentation] Start-Stop grpc version Broker/Engine - well configured [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.key /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.crt /tmp/ - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Add Broker Tcp Output Grpc Crypto module0 True False - Add Broker Tcp Input Grpc Crypto central True False - Remove Host From Broker Output module0 central-module-master-output - Add Host To Broker Output module0 central-module-master-output localhost + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Add Broker Tcp Output Grpc Crypto module0 True False + Ctn Add Broker Tcp Input Grpc Crypto central True False + Ctn Remove Host From Broker Output module0 central-module-master-output + Ctn Add Host To Broker Output module0 central-module-master-output localhost FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} - ${result} Check Poller Enabled In Database 1 10 + ${result} Ctn Check Poller Enabled In Database 1 10 Should Be True ${result} - Stop Engine - ${result} Check Poller Disabled In Database 1 10 + Ctn Stop engine + ${result} Ctn Check Poller Disabled In Database 1 10 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker END BESS_CRYPTED_GRPC2 [Documentation] Start-Stop grpc version Broker/Engine only server crypted [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.key /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.crt /tmp/ - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Add Broker Tcp Input Grpc Crypto central True False + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Add Broker Tcp Input Grpc Crypto central True False FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 2s - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine END BESS_CRYPTED_GRPC3 [Documentation] Start-Stop grpc version Broker/Engine only engine crypted [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.key /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.crt /tmp/ - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Add Broker Tcp Output Grpc Crypto module0 True False + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Add Broker Tcp Output Grpc Crypto module0 True False FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 2s - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine END BESS_CRYPTED_REVERSED_GRPC1 [Documentation] Start-Stop grpc version Broker/Engine - well configured [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.key /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.crt /tmp/ - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Add Broker Tcp Output Grpc Crypto module0 True True - Add Broker Tcp Input Grpc Crypto central True True - Add Host To Broker Input central central-broker-master-input localhost - Remove Host From Broker Output module0 central-module-master-output + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Add Broker Tcp Output Grpc Crypto module0 True True + Ctn Add Broker Tcp Input Grpc Crypto central True True + Ctn Add Host To Broker Input central central-broker-master-input localhost + Ctn Remove Host From Broker Output module0 central-module-master-output FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Sleep 2s - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine END BESS_CRYPTED_REVERSED_GRPC2 [Documentation] Start-Stop grpc version Broker/Engine only engine server crypted [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.key /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.crt /tmp/ - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Add Broker Tcp Output Grpc Crypto module0 True True - Add Host To Broker Input central central-broker-master-input localhost - Remove Host From Broker Output module0 central-module-master-output + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Add Broker Tcp Output Grpc Crypto module0 True True + Ctn Add Host To Broker Input central central-broker-master-input localhost + Ctn Remove Host From Broker Output module0 central-module-master-output FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 5s - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine END BESS_CRYPTED_REVERSED_GRPC3 [Documentation] Start-Stop grpc version Broker/Engine only engine crypted [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd - Add Broker Tcp Input Grpc Crypto central True True - Add Host To Broker Input central central-broker-master-input localhost - Remove Host From Broker Output module0 central-module-master-output + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Ctn Add Broker Tcp Input Grpc Crypto central True True + Ctn Add Host To Broker Input central central-broker-master-input localhost + Ctn Remove Host From Broker Output module0 central-module-master-output FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 5s - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine END BESS_ENGINE_DELETE_HOST [Documentation] once engine and cbd started, stop and restart cbd, delete an host and reload engine, cbd mustn't core [Tags] broker engine start-stop - Config Engine ${1} - Config Broker central - Config Broker module - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Clear Retention ${start} Get Current Date - Start Broker True - Start Engine + Ctn Start Broker True + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Kindly Stop Broker True - Start Broker True - Engine Config Remove Service Host ${0} host_16 - Engine Config Remove Host ${0} host_16 - Reload Engine + Ctn Kindly Stop Broker True + Ctn Start Broker True + Ctn Engine Config Remove Service Host ${0} host_16 + Ctn Engine Config Remove Host ${0} host_16 + Ctn Reload Engine Sleep 2s - Kindly Stop Broker True - Stop Engine + Ctn Kindly Stop Broker True + Ctn Stop engine BESSBQ1 [Documentation] A very bad queue file is written for broker. Broker and Engine are then started, Broker must read the file raising an error because of that file and then get data sent by Engine. [Tags] broker engine start-stop queue - Config Engine ${1} - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Flush Log central 0 - Broker Config Log central core error - Broker Config Log central bbdo debug - Broker Config Log central sql trace - Broker Config Log central core debug - Config Broker Sql Output central unified_sql - Clear Retention - Create Bad Queue central-broker-master.queue.central-broker-master-sql + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Log central core error + Ctn Broker Config Log central bbdo debug + Ctn Broker Config Log central sql trace + Ctn Broker Config Log central core debug + Ctn Config Broker Sql Output central unified_sql + Ctn Clear Retention + Ctn Create Bad Queue central-broker-master.queue.central-broker-master-sql ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List execute statement 306524174 - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 120 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 120 Should Be True ${result} Services should be updated after the ingestion of the queue file - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker Start_Stop_Engine_Broker_${id} [Documentation] Start-Stop Broker/Engine - Broker started first - Broker stopped first [Tags] broker engine start-stop - Config Engine ${1} ${1} ${1} - Config Broker central - Config Broker module - Config Broker rrd - Broker Config Flush Log central 0 - Broker Config Log central core debug - Broker Config Log central processing info - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} ${1} ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Log central core debug + Ctn Broker Config Log central processing info + Ctn Config Broker Sql Output central unified_sql IF ${grpc} - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd END ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List create feeder central-broker-master-input - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} create feeder not found - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} no connection between engine and cbd Sleep 5s ${start_stop} Get Current Date - Stop Engine + Ctn Stop engine ${content} Create List feeder 'central-broker-master-input-1', connection closed - ${result} Find In Log With Timeout ${centralLog} ${start_stop} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start_stop} ${content} 60 Should Be True ${result} connection closed not found Examples: id grpc -- ... 1 False ... 2 True - Kindly Stop Broker + Ctn Kindly Stop Broker Start_Stop_Broker_Engine_${id} [Documentation] Start-Stop Broker/Engine - Broker started first - Engine stopped first [Tags] broker engine start-stop - Config Engine ${1} ${1} ${1} - Config Broker central - Config Broker module - Config Broker rrd - Broker Config Flush Log central 0 - Broker Config Log central core debug + Ctn Config Engine ${1} ${1} ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Log central core debug IF ${grpc} - Change Broker Tcp Output To Grpc central - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Change Broker Tcp Input To Grpc rrd + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd END ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${content} Create List create feeder central-broker-master-input - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} create feeder not found - ${result} Check Connections + ${result} Ctn Check Connections Should Be True ${result} no connection between engine and cbd Sleep 5s ${stop_broker} Get Current Date - Kindly Stop Broker + Ctn Kindly Stop Broker ${content} Create List failover central-module-master-output: connection closed - ${result} Find In Log With Timeout ${moduleLog0} ${stop_broker} ${content} 60 + ${result} Ctn Find In Log With Timeout ${moduleLog0} ${stop_broker} ${content} 60 Should Be True ${result} connection closed not found Examples: id grpc -- ... 1 False ... 2 True - Stop Engine + Ctn Stop engine diff --git a/tests/broker-engine/tags.robot b/tests/broker-engine/tags.robot index fd166649248..a8389889d2b 100644 --- a/tests/broker-engine/tags.robot +++ b/tests/broker-engine/tags.robot @@ -3,706 +3,706 @@ Documentation Engine/Broker tests on tags. Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Init Test -Test Teardown Stop Engine Broker And Save Logs +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Init Test +Test Teardown Ctn Stop Engine Broker And Save Logs *** Test Cases *** BETAG1 [Documentation] Engine is configured with some tags. When broker receives them, it stores them in the centreon_storage.tags table. Broker is started before. [Tags] broker engine protobuf bbdo tags - Config Engine ${1} - Create Tags File ${0} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Log module0 neb debug - Broker Config Log central sql debug - Clear Retention - Start Broker + Ctn Config Engine ${1} + Ctn Create Tags File ${0} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug + Ctn Clear Retention + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Tag With Timeout tag20 3 30 + ${result} Ctn Check Tag With Timeout tag20 3 30 Should Be True ${result} tag20 should be of type 3 - ${result} Check Tag With Timeout tag1 0 30 + ${result} Ctn Check Tag With Timeout tag1 0 30 Should Be True ${result} tag1 should be of type 0 BETAG2 [Documentation] Engine is configured with some tags. When broker receives them, it stores them in the centreon_storage.tags table. Engine is started before. [Tags] broker engine protobuf bbdo tags - Config Engine ${1} - Create Tags File ${0} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Log module0 neb debug - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} + Ctn Create Tags File ${0} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug + Ctn Clear Retention Sleep 1s ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Tag With Timeout tag20 3 30 + ${result} Ctn Check Tag With Timeout tag20 3 30 Should Be True ${result} tag20 should be of type 3 - ${result} Check Tag With Timeout tag1 0 30 + ${result} Ctn Check Tag With Timeout tag1 0 30 Should Be True ${result} tag1 should be of type 0 BEUTAG1 [Documentation] Engine is configured with some tags. When broker receives them through unified_sql stream, it stores them in the centreon_storage.tags table. Broker is started before. [Tags] broker engine protobuf bbdo tags unified_sql - Config Engine ${1} - Create Tags File ${0} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Config Broker central - Config Broker rrd - Config Broker module - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Log module0 neb debug - Broker Config Log central sql debug - Clear Retention - Start Broker + Ctn Config Engine ${1} + Ctn Create Tags File ${0} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug + Ctn Clear Retention + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Tag With Timeout tag20 3 30 + ${result} Ctn Check Tag With Timeout tag20 3 30 Should Be True ${result} tag20 should be of type 3 - ${result} Check Tag With Timeout tag1 0 30 + ${result} Ctn Check Tag With Timeout tag1 0 30 Should Be True ${result} tag1 should be of type 0 BEUTAG2 [Documentation] Engine is configured with some tags. A new service is added with a tag. Broker should make the relations. [Tags] broker engine protobuf bbdo tags unified_sql - Config Engine ${1} - Create Tags File ${0} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Config Broker central - Config Broker rrd - Config Broker module - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Output Set central central-broker-unified-sql connections_count 1 - Broker Config Output Set central central-broker-unified-sql queries_per_transaction 1 - Broker Config Output Set central central-broker-unified-sql read_timeout 1 - Broker Config Output Set central central-broker-unified-sql retry_interval 5 - Broker Config Log module0 neb debug - Broker Config Log central sql error - Clear Retention - Start Broker + Ctn Config Engine ${1} + Ctn Create Tags File ${0} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Output Set central central-broker-unified-sql connections_count 1 + Ctn Broker Config Output Set central central-broker-unified-sql queries_per_transaction 1 + Ctn Broker Config Output Set central central-broker-unified-sql read_timeout 1 + Ctn Broker Config Output Set central central-broker-unified-sql retry_interval 5 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql error + Ctn Clear Retention + Ctn Start Broker ${start} Get Current Date - Start Engine + Ctn Start engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${svc} Create Service ${0} 1 1 - Add Tags To Services ${0} group_tags 4 [${svc}] + ${svc} Ctn Create Service ${0} 1 1 + Ctn Add Tags To Services ${0} group_tags 4 [${svc}] - Stop Engine + Ctn Stop engine ${start} Get Current Date - Start Engine - Reload Broker + Ctn Start engine + Ctn Reload Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Resources Tags With Timeout 1 ${svc} servicegroup [4] 60 + ${result} Ctn Check Resources Tags With Timeout 1 ${svc} servicegroup [4] 60 Should Be True ${result} New service should have a service group tag of id 4. BEUTAG3 [Documentation] Engine is configured with some tags. When broker receives them, it stores them in the centreon_storage.tags table. Engine is started before. [Tags] broker engine protobuf bbdo tags unified_sql - Config Engine ${1} - Create Tags File ${0} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Config Broker central - Config Broker rrd - Config Broker module - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Log module0 neb debug - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} + Ctn Create Tags File ${0} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug + Ctn Clear Retention Sleep 1s ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Tag With Timeout tag20 3 30 + ${result} Ctn Check Tag With Timeout tag20 3 30 Should Be True ${result} tag20 should be of type 3 - ${result} Check Tag With Timeout tag1 0 30 + ${result} Ctn Check Tag With Timeout tag1 0 30 Should Be True ${result} tag1 should be of type 0 BEUTAG4 [Documentation] Engine is configured with some tags. Group tags tag9, tag13 are set to services 1 and 3. Category tags tag3 and tag11 are added to services 1, 3, 5 and 6. The centreon_storage.resources and resources_tags tables are well filled. [Tags] broker engine protobuf bbdo tags unified_sql # Clear Db tags - Config Engine ${1} - Create Tags File ${0} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Add Tags To Services ${0} group_tags 4,5 [1, 3] - Add Tags To Services ${0} category_tags 2,4 [3, 5, 6] - Config Broker central - Config Broker rrd - Config Broker module - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Log module0 neb debug - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} + Ctn Create Tags File ${0} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Add Tags To Services ${0} group_tags 4,5 [1, 3] + Ctn Add Tags To Services ${0} category_tags 2,4 [3, 5, 6] + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug + Ctn Clear Retention ${start} Get Current Date - Start Engine + Ctn Start engine Sleep 1s - Start Broker + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Resources Tags With Timeout 1 1 servicegroup [4, 5] 60 + ${result} Ctn Check Resources Tags With Timeout 1 1 servicegroup [4, 5] 60 Should Be True ${result} Service (1, 1) should have servicegroup tag ids 4 and 5 - ${result} Check Resources Tags With Timeout 1 3 servicegroup [4, 5] 60 + ${result} Ctn Check Resources Tags With Timeout 1 3 servicegroup [4, 5] 60 Should Be True ${result} Service (1, 3) should have servicegroup tag ids 4, 5 - ${result} Check Resources Tags With Timeout 1 3 servicecategory [2, 4] 60 + ${result} Ctn Check Resources Tags With Timeout 1 3 servicecategory [2, 4] 60 Should Be True ${result} Service (1, 3) should have servicecategory tag ids 2, 4 - ${result} Check Resources Tags With Timeout 1 5 servicecategory [2, 4] 60 + ${result} Ctn Check Resources Tags With Timeout 1 5 servicecategory [2, 4] 60 Should Be True ${result} Service (1, 5) should have servicecategory tag ids 2, 4 BEUTAG5 [Documentation] Engine is configured with some tags. Group tags tag2, tag6 are set to hosts 1 and 2. Category tags tag4 and tag8 are added to hosts 2, 3, 4. The resources and resources_tags tables are well filled. [Tags] broker engine protobuf bbdo tags # Clear Db tags - Config Engine ${1} - Create Tags File ${0} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Add Tags To Hosts ${0} group_tags 2,3 [1, 2] - Add Tags To Hosts ${0} category_tags 2,3 [2, 3, 4] - Config Broker central - Config Broker rrd - Config Broker module - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Log module0 neb debug - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} + Ctn Create Tags File ${0} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Add Tags To Hosts ${0} group_tags 2,3 [1, 2] + Ctn Add Tags To Hosts ${0} category_tags 2,3 [2, 3, 4] + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug + Ctn Clear Retention Sleep 1s ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Resources Tags With Timeout 0 1 hostgroup [2,3] 60 + ${result} Ctn Check Resources Tags With Timeout 0 1 hostgroup [2,3] 60 Should Be True ${result} Host 1 should have hostgroup tags 2 and 3 - ${result} Check Resources Tags With Timeout 0 2 hostgroup [2,3] 60 + ${result} Ctn Check Resources Tags With Timeout 0 2 hostgroup [2,3] 60 Should Be True ${result} Host 2 should have hostgroup tags 2 and 3 - ${result} Check Resources Tags With Timeout 0 2 hostcategory [2, 3] 60 + ${result} Ctn Check Resources Tags With Timeout 0 2 hostcategory [2, 3] 60 Should Be True ${result} Host 2 should have hostcategory tags 2 and 3 - ${result} Check Resources Tags With Timeout 0 3 hostcategory [2, 3] 60 + ${result} Ctn Check Resources Tags With Timeout 0 3 hostcategory [2, 3] 60 Should Be True ${result} Host 3 should have hostcategory tags 2 and 3 BEUTAG6 [Documentation] Engine is configured with some tags. When broker receives them, it stores them in the centreon_storage.resources_tags table. Engine is started before. [Tags] broker engine protobuf bbdo tags # Clear Db tags - Config Engine ${1} - Create Tags File ${0} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Add Tags To Hosts ${0} group_tags 2,4 [1, 2, 3, 4] - Add Tags To Hosts ${0} category_tags 1,5 [1, 2, 3, 4] - Add Tags To Services ${0} group_tags 2,4 [1, 2, 3, 4] - Add Tags To Services ${0} category_tags 3,5 [1, 2, 3, 4] - Config Broker central - Config Broker rrd - Config Broker module ${1} - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Log module0 neb debug - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} + Ctn Create Tags File ${0} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Add Tags To Hosts ${0} group_tags 2,4 [1, 2, 3, 4] + Ctn Add Tags To Hosts ${0} category_tags 1,5 [1, 2, 3, 4] + Ctn Add Tags To Services ${0} group_tags 2,4 [1, 2, 3, 4] + Ctn Add Tags To Services ${0} category_tags 3,5 [1, 2, 3, 4] + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug + Ctn Clear Retention Sleep 1s ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Resources Tags With Timeout 0 1 hostgroup [2,4] 60 + ${result} Ctn Check Resources Tags With Timeout 0 1 hostgroup [2,4] 60 Should Be True ${result} Host 1 should have hostgroup tag_id 2 and 4 - ${result} Check Resources Tags With Timeout 0 1 hostcategory [1,5] 60 + ${result} Ctn Check Resources Tags With Timeout 0 1 hostcategory [1,5] 60 Should Be True ${result} Host 1 should have hostcategory tag_id 1 and 5 - ${result} Check Resources Tags With Timeout 1 1 servicegroup [2,4] 60 + ${result} Ctn Check Resources Tags With Timeout 1 1 servicegroup [2,4] 60 Should Be True ${result} Service (1, 1) should have servicegroup tag_id 2 and 4. - ${result} Check Resources Tags With Timeout 1 1 servicecategory [3,5] 60 + ${result} Ctn Check Resources Tags With Timeout 1 1 servicecategory [3,5] 60 Should Be True ${result} Service (1, 1) should have servicecategory tag_id 3 and 5. BEUTAG7 [Documentation] Some services are configured with tags on two pollers. Then tags configuration is modified. [Tags] broker engine protobuf bbdo tags unstable - Config Engine ${2} - Create Tags File ${0} ${20} - Create Tags File ${1} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Config Engine Add Cfg File ${1} tags.cfg - Engine Config Set Value ${0} log_level_config debug - Engine Config Set Value ${1} log_level_config debug - Add Tags To Services ${0} group_tags 2,4 [1, 2, 3, 4] - Add Tags To Services ${0} category_tags 3,5 [1, 2, 3, 4] - Add Tags To Services ${1} group_tags 3,5 [501, 502, 503, 504] - Add Tags To Services ${1} category_tags 2,4 [501, 502, 503, 504] - Config Broker central - Config Broker rrd - Config Broker module ${2} - Config Broker Sql Output central unified_sql - Config BBDO3 2 - Broker Config Log module0 neb debug - Broker Config Log module1 neb debug - Broker Config Log central sql trace - Clear Retention + Ctn Config Engine ${2} + Ctn Create Tags File ${0} ${20} + Ctn Create Tags File ${1} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Config Engine Add Cfg File ${1} tags.cfg + Ctn Engine Config Set Value ${0} log_level_config debug + Ctn Engine Config Set Value ${1} log_level_config debug + Ctn Add Tags To Services ${0} group_tags 2,4 [1, 2, 3, 4] + Ctn Add Tags To Services ${0} category_tags 3,5 [1, 2, 3, 4] + Ctn Add Tags To Services ${1} group_tags 3,5 [501, 502, 503, 504] + Ctn Add Tags To Services ${1} category_tags 2,4 [501, 502, 503, 504] + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${2} + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 2 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log module1 neb debug + Ctn Broker Config Log central sql trace + Ctn Clear Retention ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # We check in the DB if the service (1,1) has well its servicegroup tags configured. - ${result} Check Resources Tags With Timeout 1 1 servicegroup [2,4] 60 + ${result} Ctn Check Resources Tags With Timeout 1 1 servicegroup [2,4] 60 Should Be True ${result} First step: Service (1, 1) should have servicegroup tags 2 and 4 - ${result} Check Resources Tags With Timeout 26 502 servicecategory [2,4] 60 + ${result} Ctn Check Resources Tags With Timeout 26 502 servicecategory [2,4] 60 Should Be True ${result} First step: Service (26, 502) should have servicecategory tags 13, 9, 3 and 11. - ${result} Check Resources Tags With Timeout 26 502 servicegroup [3,5] 60 + ${result} Ctn Check Resources Tags With Timeout 26 502 servicegroup [3,5] 60 Should Be True ${result} First step: Service (26, 502) should have servicegroup tags 3 and 5. - Remove Tags From Services ${0} group_tags - Remove Tags From Services ${0} category_tags - Remove Tags From Services ${1} group_tags - Remove Tags From Services ${1} category_tags - Create Tags File ${0} ${18} - Create Tags File ${1} ${18} - Add Tags To Services ${1} group_tags 3,5 [505, 506, 507, 508] - ${start} Get Round Current Date - Reload Engine - Reload Broker + Ctn Remove Tags From Services ${0} group_tags + Ctn Remove Tags From Services ${0} category_tags + Ctn Remove Tags From Services ${1} group_tags + Ctn Remove Tags From Services ${1} category_tags + Ctn Create Tags File ${0} ${18} + Ctn Create Tags File ${1} ${18} + Ctn Add Tags To Services ${1} group_tags 3,5 [505, 506, 507, 508] + ${start} Ctn Get Round Current Date + Ctn Reload Engine + Ctn Reload Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Resources Tags With Timeout 26 507 servicegroup [3,5] 60 + ${result} Ctn Check Resources Tags With Timeout 26 507 servicegroup [3,5] 60 Should Be True ${result} Second step: Service (26, 507) should have servicegroup tags 3 and 5 - ${result} Check Resources Tags With Timeout 26 508 servicegroup [3,5] 60 + ${result} Ctn Check Resources Tags With Timeout 26 508 servicegroup [3,5] 60 Should Be True ${result} Second step: Service (26, 508) should have servicegroup tags 3 and 5 BEUTAG8 [Documentation] Services have tags provided by templates. [Tags] broker engine protobuf bbdo tags - Config Engine ${2} - Create Tags File ${0} ${40} - Create Tags File ${1} ${40} - Create Template File ${0} service group_tags [1, 9] - Create Template File ${1} service group_tags [5, 7] - - Config Engine Add Cfg File ${0} tags.cfg - Config Engine Add Cfg File ${1} tags.cfg - Config Engine Add Cfg File ${0} serviceTemplates.cfg - Config Engine Add Cfg File ${1} serviceTemplates.cfg - Engine Config Set Value ${0} log_level_config debug - Engine Config Set Value ${1} log_level_config debug - Add Template To Services 0 service_template_1 [2, 4] - Add Template To Services 0 service_template_2 [5, 7] - Add Template To Services 1 service_template_1 [501, 502] - Add Template To Services 1 service_template_2 [503, 504] - - Add Tags To Services ${0} category_tags 3,5 [1, 2] - Add Tags To Services ${1} group_tags 1,4 [501, 502] - - Config Broker central - Config Broker rrd - Config Broker module ${2} - Config Broker Sql Output central unified_sql - Config BBDO3 2 - Broker Config Log module0 neb debug - Broker Config Log module1 neb debug - Broker Config Log central sql trace - Clear Retention + Ctn Config Engine ${2} + Ctn Create Tags File ${0} ${40} + Ctn Create Tags File ${1} ${40} + Ctn Create Template File ${0} service group_tags [1, 9] + Ctn Create Template File ${1} service group_tags [5, 7] + + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Config Engine Add Cfg File ${1} tags.cfg + Ctn Config Engine Add Cfg File ${0} serviceTemplates.cfg + Ctn Config Engine Add Cfg File ${1} serviceTemplates.cfg + Ctn Engine Config Set Value ${0} log_level_config debug + Ctn Engine Config Set Value ${1} log_level_config debug + Ctn Add Template To Services 0 service_template_1 [2, 4] + Ctn Add Template To Services 0 service_template_2 [5, 7] + Ctn Add Template To Services 1 service_template_1 [501, 502] + Ctn Add Template To Services 1 service_template_2 [503, 504] + + Ctn Add Tags To Services ${0} category_tags 3,5 [1, 2] + Ctn Add Tags To Services ${1} group_tags 1,4 [501, 502] + + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${2} + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 2 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log module1 neb debug + Ctn Broker Config Log central sql trace + Ctn Clear Retention ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # We need to wait a little before reloading Engine - ${result} Check Resources Tags With Timeout 1 2 servicecategory [3,5] 60 + ${result} Ctn Check Resources Tags With Timeout 1 2 servicecategory [3,5] 60 Should Be True ${result} First step: Service (1, 2) should have servicecategory tags 3 and 5. - ${result} Check Resources Tags With Timeout 1 2 servicegroup [1] 60 + ${result} Ctn Check Resources Tags With Timeout 1 2 servicegroup [1] 60 Should Be True ${result} First step: Service (1, 2) should have servicegroup tag 1. - ${result} Check Resources Tags With Timeout 1 5 servicegroup [9] 60 + ${result} Ctn Check Resources Tags With Timeout 1 5 servicegroup [9] 60 Should Be True ${result} First step: Service (1, 5) should have servicegroup tag 9 - ${result} Check Resources Tags With Timeout 26 502 servicegroup [1,4,5] 60 + ${result} Ctn Check Resources Tags With Timeout 26 502 servicegroup [1,4,5] 60 Should Be True ${result} First step: Service (26, 502) should have tags 1, 4 and 5 - ${result} Check Resources Tags With Timeout 26 503 servicegroup [7] 60 + ${result} Ctn Check Resources Tags With Timeout 26 503 servicegroup [7] 60 Should Be True ${result} First step: Service (26, 503) should have servicegroup tag 7 BEUTAG9 [Documentation] hosts have tags provided by templates. [Tags] broker engine protobuf bbdo tags - Config Engine ${2} - Create Tags File ${0} ${40} - Create Tags File ${1} ${40} - Create Template File ${0} host group_tags [2, 6] - Create Template File ${1} host group_tags [8, 9] - - Config Engine Add Cfg File ${0} tags.cfg - Config Engine Add Cfg File ${1} tags.cfg - Config Engine Add Cfg File ${0} hostTemplates.cfg - Config Engine Add Cfg File ${1} hostTemplates.cfg - Engine Config Set Value ${0} log_level_config debug - Engine Config Set Value ${1} log_level_config debug - Add Template To Hosts 0 host_template_1 [9, 10] - Add Template To Hosts 0 host_template_2 [11, 12] - Add Template To Hosts 1 host_template_1 [30, 31] - Add Template To Hosts 1 host_template_2 [32, 33] - Config Broker central - Config Broker rrd - Config Broker module ${2} - Config Broker Sql Output central unified_sql - Config BBDO3 2 - Broker Config Log module0 neb debug - Broker Config Log module1 neb debug - Broker Config Log central sql trace - Clear Retention + Ctn Config Engine ${2} + Ctn Create Tags File ${0} ${40} + Ctn Create Tags File ${1} ${40} + Ctn Create Template File ${0} host group_tags [2, 6] + Ctn Create Template File ${1} host group_tags [8, 9] + + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Config Engine Add Cfg File ${1} tags.cfg + Ctn Config Engine Add Cfg File ${0} hostTemplates.cfg + Ctn Config Engine Add Cfg File ${1} hostTemplates.cfg + Ctn Engine Config Set Value ${0} log_level_config debug + Ctn Engine Config Set Value ${1} log_level_config debug + Ctn Add Template To Hosts 0 host_template_1 [9, 10] + Ctn Add Template To Hosts 0 host_template_2 [11, 12] + Ctn Add Template To Hosts 1 host_template_1 [30, 31] + Ctn Add Template To Hosts 1 host_template_2 [32, 33] + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${2} + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 2 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log module1 neb debug + Ctn Broker Config Log central sql trace + Ctn Clear Retention Sleep 1s ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # We need to wait a little before reloading Engine - ${result} Check Resources Tags With Timeout 0 9 hostgroup [2] 60 + ${result} Ctn Check Resources Tags With Timeout 0 9 hostgroup [2] 60 Should Be True ${result} First step: resource 9 should have hostgroup tag with id=2 - ${result} Check Resources Tags With Timeout 0 10 hostgroup [2] 60 + ${result} Ctn Check Resources Tags With Timeout 0 10 hostgroup [2] 60 Should Be True ${result} First step: resource 10 should have hostgroup tag with id=2 - ${result} Check Resources Tags With Timeout 0 11 hostgroup [6] 60 + ${result} Ctn Check Resources Tags With Timeout 0 11 hostgroup [6] 60 Should Be True ${result} First step: resource 11 should have hostgroup tag with id=6 - ${result} Check Resources Tags With Timeout 0 12 hostgroup [6] 60 + ${result} Ctn Check Resources Tags With Timeout 0 12 hostgroup [6] 60 Should Be True ${result} First step: resource 12 should have hostgroup tag with id=6 - ${result} Check Resources Tags With Timeout 0 30 hostgroup [8] 60 + ${result} Ctn Check Resources Tags With Timeout 0 30 hostgroup [8] 60 Should Be True ${result} First step: resource 30 should have hostgroup tag with id=10 - ${result} Check Resources Tags With Timeout 0 31 hostgroup [8] 60 + ${result} Ctn Check Resources Tags With Timeout 0 31 hostgroup [8] 60 Should Be True ${result} First step: resource 31 should have hostgroup tag with id=10 - ${result} Check Resources Tags With Timeout 0 32 hostgroup [9] 60 + ${result} Ctn Check Resources Tags With Timeout 0 32 hostgroup [9] 60 Should Be True ${result} First step: resource 32 should have hostgroup tag with id=14 - ${result} Check Resources Tags With Timeout 0 33 hostgroup [9] 60 + ${result} Ctn Check Resources Tags With Timeout 0 33 hostgroup [9] 60 Should Be True ${result} First step: host 33 should have hostgroup tag with id=14 BEUTAG10 [Documentation] some services are configured with tags on two pollers. Then tags are removed from some of them and in centreon_storage, we can observe resources_tags table updated. [Tags] broker engine protobuf bbdo tags - Config Engine ${2} - Create Tags File ${0} ${20} - Create Tags File ${1} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Config Engine Add Cfg File ${1} tags.cfg - Engine Config Set Value ${0} log_level_config debug - Engine Config Set Value ${1} log_level_config debug - Add Tags To Services ${0} group_tags 2,4 [1, 2, 3, 4] - Add Tags To Services ${0} category_tags 3,5 [1, 2, 3, 4] - Add Tags To Services ${1} group_tags 3,5 [501, 502, 503, 504] - Add Tags To Services ${1} category_tags 2,4 [501, 502, 503, 504] - Config Broker central - Config Broker rrd - Config Broker module ${2} - Config Broker Sql Output central unified_sql - Config BBDO3 2 - Broker Config Log module0 neb debug - Broker Config Log module1 neb debug - Broker Config Log central sql trace - Clear Retention + Ctn Config Engine ${2} + Ctn Create Tags File ${0} ${20} + Ctn Create Tags File ${1} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Config Engine Add Cfg File ${1} tags.cfg + Ctn Engine Config Set Value ${0} log_level_config debug + Ctn Engine Config Set Value ${1} log_level_config debug + Ctn Add Tags To Services ${0} group_tags 2,4 [1, 2, 3, 4] + Ctn Add Tags To Services ${0} category_tags 3,5 [1, 2, 3, 4] + Ctn Add Tags To Services ${1} group_tags 3,5 [501, 502, 503, 504] + Ctn Add Tags To Services ${1} category_tags 2,4 [501, 502, 503, 504] + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${2} + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 2 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log module1 neb debug + Ctn Broker Config Log central sql trace + Ctn Clear Retention ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 + ${result} Ctn Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 Should Be True ${result} First step: Service (1, 4) should have servicegroup tags 2 and 4 - ${result} Check Resources Tags With Timeout 1 3 servicecategory [3,5] 60 + ${result} Ctn Check Resources Tags With Timeout 1 3 servicecategory [3,5] 60 Should Be True ${result} First step: Service (1, 3) should have servicecategory tags 3 and 5 - ${result} Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 + ${result} Ctn Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 Should Be True ${result} First step: Service (26, 504) should have servicegroup tags 3 and 5. - ${result} Check Resources Tags With Timeout 26 503 servicecategory [2,4] 60 + ${result} Ctn Check Resources Tags With Timeout 26 503 servicecategory [2,4] 60 Should Be True ${result} First step: Service (26, 503) should have servicecategory tags 2 and 4. - Remove Tags From Services ${0} group_tags - Remove Tags From Services ${0} category_tags - Remove Tags From Services ${1} group_tags - Remove Tags From Services ${1} category_tags - Create Tags File ${0} ${20} - Create Tags File ${1} ${20} - Add Tags To Services ${0} group_tags 2,4 [1, 2, 3] - Add Tags To Services ${0} category_tags 3,5 [1, 2, 4] - Add Tags To Services ${1} group_tags 3,5 [501, 502, 503] - Add Tags To Services ${1} category_tags 2,4 [501, 502, 504] - Reload Engine - Reload Broker - ${result} Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 False + Ctn Remove Tags From Services ${0} group_tags + Ctn Remove Tags From Services ${0} category_tags + Ctn Remove Tags From Services ${1} group_tags + Ctn Remove Tags From Services ${1} category_tags + Ctn Create Tags File ${0} ${20} + Ctn Create Tags File ${1} ${20} + Ctn Add Tags To Services ${0} group_tags 2,4 [1, 2, 3] + Ctn Add Tags To Services ${0} category_tags 3,5 [1, 2, 4] + Ctn Add Tags To Services ${1} group_tags 3,5 [501, 502, 503] + Ctn Add Tags To Services ${1} category_tags 2,4 [501, 502, 504] + Ctn Reload Engine + Ctn Reload Broker + ${result} Ctn Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 False Should Be True ${result} Second step: Service (1, 4) should not have servicegroup tags 2 and 4 - ${result} Check Resources Tags With Timeout 1 3 servicecategory [3,5] 60 False + ${result} Ctn Check Resources Tags With Timeout 1 3 servicecategory [3,5] 60 False Should Be True ${result} Second step: Service (1, 3) should not have servicecategory tags 3 and 5 - ${result} Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 False + ${result} Ctn Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 False Should Be True ${result} Second step: Service (26, 504) should not have servicegroup tags 3 and 5 - ${result} Check Resources Tags With Timeout 26 503 servicecategory [3,5] 60 False + ${result} Ctn Check Resources Tags With Timeout 26 503 servicecategory [3,5] 60 False Should Be True ${result} Second step: Service (26, 503) should not have servicecategory tags 3 and 5 BEUTAG11 [Documentation] some services are configured with tags on two pollers. Then several tags are removed, and we can observe resources_tags table updated. [Tags] broker engine protobuf bbdo tags - Config Engine ${2} - Create Tags File ${0} ${20} - Create Tags File ${1} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Config Engine Add Cfg File ${1} tags.cfg - Engine Config Set Value ${0} log_level_config debug - Engine Config Set Value ${1} log_level_config debug - Add Tags To Services ${0} group_tags 2,4 [1, 2, 3, 4] - Add Tags To Services ${0} category_tags 3,5 [1, 2, 3, 4] - Add Tags To Services ${1} group_tags 3,5 [501, 502, 503, 504] - Add Tags To Services ${1} category_tags 2,4 [501, 502, 503, 504] - Config Broker central - Config Broker rrd - Config Broker module ${2} - Config Broker Sql Output central unified_sql - Config BBDO3 2 - Broker Config Log module0 neb debug - Broker Config Log module1 neb debug - Broker Config Log central sql trace - Clear Retention + Ctn Config Engine ${2} + Ctn Create Tags File ${0} ${20} + Ctn Create Tags File ${1} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Config Engine Add Cfg File ${1} tags.cfg + Ctn Engine Config Set Value ${0} log_level_config debug + Ctn Engine Config Set Value ${1} log_level_config debug + Ctn Add Tags To Services ${0} group_tags 2,4 [1, 2, 3, 4] + Ctn Add Tags To Services ${0} category_tags 3,5 [1, 2, 3, 4] + Ctn Add Tags To Services ${1} group_tags 3,5 [501, 502, 503, 504] + Ctn Add Tags To Services ${1} category_tags 2,4 [501, 502, 503, 504] + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${2} + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 2 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log module1 neb debug + Ctn Broker Config Log central sql trace + Ctn Clear Retention ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 + ${result} Ctn Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 Should Be True ${result} First step: Service (1, 4) should have servicegroup tags 2 and 4 - ${result} Check Resources Tags With Timeout 1 3 servicecategory [3,5] 60 + ${result} Ctn Check Resources Tags With Timeout 1 3 servicecategory [3,5] 60 Should Be True ${result} First step: Service (1, 3) should have servicecategory tags 3 and 5 - ${result} Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 + ${result} Ctn Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 Should Be True ${result} First step: Service (26, 504) should have servicegroup tags 3 and 5. - ${result} Check Resources Tags With Timeout 26 503 servicecategory [2,4] 60 + ${result} Ctn Check Resources Tags With Timeout 26 503 servicecategory [2,4] 60 Should Be True ${result} First step: Service (26, 503) should have servicecategory tags 2 and 4. - Remove Tags From Services ${0} group_tags - Remove Tags From Services ${0} category_tags - Remove Tags From Services ${1} group_tags - Remove Tags From Services ${1} category_tags - Create Tags File ${0} ${18} - Create Tags File ${1} ${18} - Add Tags To Services ${0} group_tags 2,4 [1, 2, 3, 4] - Add Tags To Services ${0} category_tags 3 [1, 2, 3, 4] - Add Tags To Services ${1} group_tags 3,5 [501, 502, 503] - Add Tags To Services ${1} category_tags 2,4 [501, 502, 504] - Reload Engine - Reload Broker - ${result} Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 + Ctn Remove Tags From Services ${0} group_tags + Ctn Remove Tags From Services ${0} category_tags + Ctn Remove Tags From Services ${1} group_tags + Ctn Remove Tags From Services ${1} category_tags + Ctn Create Tags File ${0} ${18} + Ctn Create Tags File ${1} ${18} + Ctn Add Tags To Services ${0} group_tags 2,4 [1, 2, 3, 4] + Ctn Add Tags To Services ${0} category_tags 3 [1, 2, 3, 4] + Ctn Add Tags To Services ${1} group_tags 3,5 [501, 502, 503] + Ctn Add Tags To Services ${1} category_tags 2,4 [501, 502, 504] + Ctn Reload Engine + Ctn Reload Broker + ${result} Ctn Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 Should Be True ${result} Second step: Service (1, 4) should not have servicegroup tags 2 and 4 - ${result} Check Resources Tags With Timeout 1 3 servicecategory [5] 60 False + ${result} Ctn Check Resources Tags With Timeout 1 3 servicecategory [5] 60 False Should Be True ${result} Second step: Service (1, 3) should not have servicecategory tags 5 - ${result} Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 False + ${result} Ctn Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 False Should Be True ${result} Second step: Service (26, 504) should not have servicegroup tags 3 and 5 - ${result} Check Resources Tags With Timeout 26 503 servicecategory [3,5] 60 + ${result} Ctn Check Resources Tags With Timeout 26 503 servicecategory [3,5] 60 Should Be True ${result} Second step: Service (26, 503) should not have servicecategory tags 3 and 5 BEUTAG12 [Documentation] Engine is configured with some tags. Group tags tag2, tag6 are set to hosts 1 and 2. Category tags tag4 and tag8 are added to hosts 2, 3, 4. The resources and resources_tags tables are well filled. The tag6 and tag8 are removed and resources_tags is also well updated. [Tags] broker engine protobuf bbdo tags # Clear Db tags - Config Engine ${1} - Create Tags File ${0} ${20} - Config Engine Add Cfg File ${0} tags.cfg - Add Tags To Hosts ${0} group_tags 2,3 [1, 2] - Add Tags To Hosts ${0} category_tags 2,3 [2, 3, 4] - Config Broker central - Config Broker rrd - Config Broker module - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Log module0 neb debug - Broker Config Log central sql debug - Clear Retention + Ctn Config Engine ${1} + Ctn Create Tags File ${0} ${20} + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Add Tags To Hosts ${0} group_tags 2,3 [1, 2] + Ctn Add Tags To Hosts ${0} category_tags 2,3 [2, 3, 4] + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql debug + Ctn Clear Retention Sleep 1s ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Resources Tags With Timeout 0 1 hostgroup [2,3] 60 + ${result} Ctn Check Resources Tags With Timeout 0 1 hostgroup [2,3] 60 Should Be True ${result} Host 1 should have hostgroup tags 2 and 3 - ${result} Check Resources Tags With Timeout 0 2 hostgroup [2,3] 60 + ${result} Ctn Check Resources Tags With Timeout 0 2 hostgroup [2,3] 60 Should Be True ${result} Host 2 should have hostgroup tags 2 and 3 - ${result} Check Resources Tags With Timeout 0 2 hostcategory [2, 3] 60 + ${result} Ctn Check Resources Tags With Timeout 0 2 hostcategory [2, 3] 60 Should Be True ${result} Host 2 should have hostcategory tags 2 and 3 - ${result} Check Resources Tags With Timeout 0 3 hostcategory [2, 3] 60 + ${result} Ctn Check Resources Tags With Timeout 0 3 hostcategory [2, 3] 60 Should Be True ${result} Host 3 should have hostcategory tags 2 and 3 - Remove Tags From Hosts ${0} group_tags - Remove Tags From Hosts ${0} category_tags - Create Tags File ${0} ${5} - Config Engine Add Cfg File ${0} tags.cfg + Ctn Remove Tags From Hosts ${0} group_tags + Ctn Remove Tags From Hosts ${0} category_tags + Ctn Create Tags File ${0} ${5} + Ctn Config Engine Add Cfg File ${0} tags.cfg - Reload Engine - Reload Broker + Ctn Reload Engine + Ctn Reload Broker - ${result} Check Resources Tags With Timeout 0 1 hostgroup [2,3] 60 False + ${result} Ctn Check Resources Tags With Timeout 0 1 hostgroup [2,3] 60 False Should Be True ${result} Host 1 should not have hostgroup tags 2 nor 3 - ${result} Check Resources Tags With Timeout 0 2 hostgroup [2,3] 60 False + ${result} Ctn Check Resources Tags With Timeout 0 2 hostgroup [2,3] 60 False Should Be True ${result} Host 2 should not have hostgroup tags 2 nor 3 - ${result} Check Resources Tags With Timeout 0 2 hostcategory [2,3] 60 False + ${result} Ctn Check Resources Tags With Timeout 0 2 hostcategory [2,3] 60 False Should Be True ${result} Host 2 should not have hostgroup tags 2 nor 3 - ${result} Check Resources Tags With Timeout 0 3 hostcategory [2,3] 60 False + ${result} Ctn Check Resources Tags With Timeout 0 3 hostcategory [2,3] 60 False Should Be True ${result} Host 3 should not have hostgroup tags 2 nor 3 - ${result} Check Resources Tags With Timeout 0 4 hostcategory [2,3] 60 False + ${result} Ctn Check Resources Tags With Timeout 0 4 hostcategory [2,3] 60 False Should Be True ${result} Host 4 should not have hostgroup tags 2 nor 3 BEUTAG_REMOVE_HOST_FROM_HOSTGROUP [Documentation] remove a host from hostgroup, reload, insert 2 host in the hostgroup must not make sql error [Tags] broker engine tags - Clear Db tags - Config Engine ${1} - Create Tags File ${0} ${3} ${0} hostgroup - Config Engine Add Cfg File ${0} tags.cfg - Add Tags To Hosts ${0} group_tags 2 1 - Add Tags To Hosts ${0} group_tags 1 4 - Config Broker central - Config Broker rrd - Config Broker module - Config Broker Sql Output central unified_sql - Config BBDO3 1 - Broker Config Log module0 neb debug - Broker Config Log central sql trace - Clear Retention + Ctn Clear Db tags + Ctn Config Engine ${1} + Ctn Create Tags File ${0} ${3} ${0} hostgroup + Ctn Config Engine Add Cfg File ${0} tags.cfg + Ctn Add Tags To Hosts ${0} group_tags 2 1 + Ctn Add Tags To Hosts ${0} group_tags 1 4 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Broker Sql Output central unified_sql + Ctn Config BBDO3 1 + Ctn Broker Config Log module0 neb debug + Ctn Broker Config Log central sql trace + Ctn Clear Retention Sleep 1s ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} Check Resources Tags With Timeout 0 1 hostgroup [2] 60 True + ${result} Ctn Check Resources Tags With Timeout 0 1 hostgroup [2] 60 True Should Be True ${result} Host 1 should not have hostgroup tags 2 ${content} Create List unified_sql:_check_queues - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} A message unified_sql:_check_queues should be available. - Engine Config Remove Service Host ${0} host_1 - Engine Config Remove Host 0 host_1 - Engine Config Remove Tag 0 2 - Reload Engine + Ctn Engine Config Remove Service Host ${0} host_1 + Ctn Engine Config Remove Host 0 host_1 + Ctn Engine Config Remove Tag 0 2 + Ctn Reload Engine - ${result} Check Resources Tags With Timeout 0 1 hostgroup [2] 60 False + ${result} Ctn Check Resources Tags With Timeout 0 1 hostgroup [2] 60 False Should Be True ${result} Host 1 should not have hostgroup tags 2 # wait for commits ${start} Get Current Date ${content} Create List unified_sql:_check_queues - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} A message unified_sql:_check_queues should be available. Sleep 5 - Create Tags File ${0} ${3} ${0} hostgroup - Add Tags To Hosts ${0} group_tags 2 [2,3] - Reload Engine + Ctn Create Tags File ${0} ${3} ${0} hostgroup + Ctn Add Tags To Hosts ${0} group_tags 2 [2,3] + Ctn Reload Engine - ${result} Check Resources Tags With Timeout 0 2 hostgroup [2] 60 True + ${result} Ctn Check Resources Tags With Timeout 0 2 hostgroup [2] 60 True Should Be True ${result} Host 2 should have hostgroup tags 2 - ${result} Check Resources Tags With Timeout 0 3 hostgroup [2] 60 True + ${result} Ctn Check Resources Tags With Timeout 0 3 hostgroup [2] 60 True Should Be True ${result} Host 3 should have hostgroup tags 2 *** Keywords *** -Init Test - Stop Processes - Truncate Resource Host Service +Ctn Init Test + Ctn Stop Processes + Ctn Truncate Resource Host Service diff --git a/tests/broker-engine/tls.robot b/tests/broker-engine/tls.robot index 3b8891f431c..9dc8feecb46 100644 --- a/tests/broker-engine/tls.robot +++ b/tests/broker-engine/tls.robot @@ -3,10 +3,10 @@ Documentation Centreon Broker and Engine communication with or without TLS Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Variables *** @@ -19,24 +19,24 @@ Test Teardown Save Logs If Failed BECT1 [Documentation] Broker/Engine communication with anonymous TLS between central and poller [Tags] broker engine tls tcp - Config Engine ${1} - Config Broker rrd + Ctn Config Engine ${1} + Ctn Config Broker rrd FOR ${comp1} IN @{choices} FOR ${comp2} IN @{choices} Log To Console TLS set to ${comp1} on central and to ${comp2} on module - Config Broker central - Config Broker module - Broker Config Input Set central central-broker-master-input tls ${comp1} - Broker Config Output Set module0 central-module-master-output tls ${comp2} - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Input Set central central-broker-master-input tls ${comp1} + Ctn Broker Config Output Set module0 central-module-master-output tls ${comp2} + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content1} Create List we have extensions '${ext["${comp1}"]}' and peer has '${ext["${comp2}"]}' ${content2} Create List we have extensions '${ext["${comp2}"]}' and peer has '${ext["${comp1}"]}' IF "${comp1}" == "yes" and "${comp2}" == "no" @@ -50,9 +50,9 @@ BECT1 ... ${-1} ... extension 'TLS' is set to 'yes' in the configuration but cannot be activated because of peer configuration END - ${result} Find In Log ${centralLog} ${start} ${content1} + ${result} Ctn Find In Log ${centralLog} ${start} ${content1} Should Be True ${result} - ${result} Find In Log ${moduleLog0} ${start} ${content2} + ${result} Ctn Find In Log ${moduleLog0} ${start} ${content2} Should Be True ${result} END END @@ -60,229 +60,229 @@ BECT1 BECT2 [Documentation] Broker/Engine communication with TLS between central and poller with key/cert [Tags] broker engine tls tcp - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module - ${hostname} Get Hostname - Create Key And Certificate + ${hostname} Ctn Get Hostname + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/server.key ... ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... private_key ... ${EtcRoot}/centreon-broker/client.key - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... public_cert ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... public_cert ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Log central tls debug - Broker Config Log module0 tls debug - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info - Broker Config Input Set central central-broker-master-input tls yes - Broker Config Output Set module0 central-module-master-output tls yes + Ctn Broker Config Log central tls debug + Ctn Broker Config Log module0 tls debug + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info + Ctn Broker Config Input Set central central-broker-master-input tls yes + Ctn Broker Config Output Set module0 central-module-master-output tls yes ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} - ${result} Find In Log ${centralLog} ${start} ${content1} + ${result} Ctn Find In Log ${centralLog} ${start} ${content1} Should Be True ${result} - ${result} Find In Log ${moduleLog0} ${start} ${content2} + ${result} Ctn Find In Log ${moduleLog0} ${start} ${content2} Should Be True ${result} BECT3 [Documentation] Broker/Engine communication with anonymous TLS and ca certificate [Tags] broker engine tls tcp - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module - ${hostname} Get Hostname - Create Certificate ${hostname} ${EtcRoot}/centreon-broker/server.crt - Create Certificate ${hostname} ${EtcRoot}/centreon-broker/client.crt + ${hostname} Ctn Get Hostname + Ctn Create Certificate ${hostname} ${EtcRoot}/centreon-broker/server.crt + Ctn Create Certificate ${hostname} ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Log central tls debug - Broker Config Log module0 tls debug - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info - Broker Config Input Set central central-broker-master-input tls yes - Broker Config Output Set module0 central-module-master-output tls yes + Ctn Broker Config Log central tls debug + Ctn Broker Config Log module0 tls debug + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info + Ctn Broker Config Input Set central central-broker-master-input tls yes + Ctn Broker Config Output Set module0 central-module-master-output tls yes # We get the current date just before starting broker ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using anonymous server credentials ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using anonymous client credentials ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result} Find In Log ${log} ${start} ${content1} + ${result} Ctn Find In Log ${log} ${start} ${content1} Should Be True ${result} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result} Find In Log ${log} ${start} ${content2} + ${result} Ctn Find In Log ${log} ${start} ${content2} Should Be True ${result} BECT4 [Documentation] Broker/Engine communication with TLS between central and poller with key/cert and hostname forced [Tags] broker engine tls tcp - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module Set Local Variable ${hostname} centreon - Create Key And Certificate + Ctn Create Key And Certificate ... ${hostname} ... ${EtcRoot}/centreon-broker/server.key ... ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate + Ctn Create Key And Certificate ... ${hostname} ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Log central tls debug - Broker Config Log module0 tls debug - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info - Broker Config Input Set central central-broker-master-input tls yes - Broker Config Input Set + Ctn Broker Config Log central tls debug + Ctn Broker Config Log module0 tls debug + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info + Ctn Broker Config Input Set central central-broker-master-input tls yes + Ctn Broker Config Input Set ... central ... central-broker-master-input ... private_key ... ${EtcRoot}/centreon-broker/client.key - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... public_cert ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Input Set central central-broker-master-input tls_hostname centreon - Broker Config Output Set module0 central-module-master-output tls yes - Broker Config Output Set + Ctn Broker Config Input Set central central-broker-master-input tls_hostname centreon + Ctn Broker Config Output Set module0 central-module-master-output tls yes + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... public_cert ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt # We get the current date just before starting broker ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result} Find In Log ${log} ${start} ${content1} + ${result} Ctn Find In Log ${log} ${start} ${content1} Should Be True ${result} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result} Find In Log ${log} ${start} ${content2} + ${result} Ctn Find In Log ${log} ${start} ${content2} Should Be True ${result} BECT_GRPC1 [Documentation] Broker/Engine communication with GRPC and with anonymous TLS between central and poller [Tags] broker engine tls tcp - Config Engine ${1} - Config Broker rrd + Ctn Config Engine ${1} + Ctn Config Broker rrd FOR ${comp1} IN @{choices} FOR ${comp2} IN @{choices} Log To Console TLS set to ${comp1} on central and to ${comp2} on module - Config Broker central - Config Broker module - Broker Config Input Set central central-broker-master-input tls ${comp1} - Broker Config Output Set module0 central-module-master-output tls ${comp2} - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info - Broker Config Log central grpc debug - Broker Config Log module0 grpc debug - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central + Ctn Config Broker central + Ctn Config Broker module + Ctn Broker Config Input Set central central-broker-master-input tls ${comp1} + Ctn Broker Config Output Set module0 central-module-master-output tls ${comp2} + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info + Ctn Broker Config Log central grpc debug + Ctn Broker Config Log module0 grpc debug + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content1} Create List we have extensions '${ext["${comp1}"]}' and peer has '${ext["${comp2}"]}' ${content2} Create List we have extensions '${ext["${comp2}"]}' and peer has '${ext["${comp1}"]}' IF "${comp1}" == "yes" and "${comp2}" == "no" @@ -296,9 +296,9 @@ BECT_GRPC1 ... ${-1} ... extension 'TLS' is set to 'yes' in the configuration but cannot be activated because of peer configuration END - ${result} Find In Log ${centralLog} ${start} ${content1} + ${result} Ctn Find In Log ${centralLog} ${start} ${content1} Should Be True ${result} - ${result} Find In Log ${moduleLog0} ${start} ${content2} + ${result} Ctn Find In Log ${moduleLog0} ${start} ${content2} Should Be True ${result} END END @@ -306,207 +306,207 @@ BECT_GRPC1 BECT_GRPC2 [Documentation] Broker/Engine communication with TLS between central and poller with key/cert [Tags] broker engine tls tcp - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module - Create Key And Certificate + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/server.key ... ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... private_key ... ${EtcRoot}/centreon-broker/client.key - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... public_cert ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... public_cert ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Log central tls debug - Broker Config Log module0 tls debug - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info - Broker Config Input Set central central-broker-master-input tls yes - Broker Config Output Set module0 central-module-master-output tls yes - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central + Ctn Broker Config Log central tls debug + Ctn Broker Config Log module0 tls debug + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info + Ctn Broker Config Input Set central central-broker-master-input tls yes + Ctn Broker Config Output Set module0 central-module-master-output tls yes + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result} Find In Log ${log} ${start} ${content1} + ${result} Ctn Find In Log ${log} ${start} ${content1} Should Be True ${result} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result} Find In Log ${log} ${start} ${content2} + ${result} Ctn Find In Log ${log} ${start} ${content2} Should Be True ${result} BECT_GRPC3 [Documentation] Broker/Engine communication with anonymous TLS and ca certificate [Tags] broker engine tls tcp - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module - ${hostname} Get Hostname - Create Certificate ${hostname} ${EtcRoot}/centreon-broker/server.crt - Create Certificate ${hostname} ${EtcRoot}/centreon-broker/client.crt + ${hostname} Ctn Get Hostname + Ctn Create Certificate ${hostname} ${EtcRoot}/centreon-broker/server.crt + Ctn Create Certificate ${hostname} ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Log central tls debug - Broker Config Log module0 tls debug - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Broker Config Input Set central central-broker-master-input tls yes - Broker Config Output Set module0 central-module-master-output tls yes + Ctn Broker Config Log central tls debug + Ctn Broker Config Log module0 tls debug + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Broker Config Input Set central central-broker-master-input tls yes + Ctn Broker Config Output Set module0 central-module-master-output tls yes # We get the current date just before starting broker ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using anonymous server credentials ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using anonymous client credentials ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result} Find In Log ${log} ${start} ${content1} + ${result} Ctn Find In Log ${log} ${start} ${content1} Should Be True ${result} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result} Find In Log ${log} ${start} ${content2} + ${result} Ctn Find In Log ${log} ${start} ${content2} Should Be True ${result} BECT_GRPC4 [Documentation] Broker/Engine communication with TLS between central and poller with key/cert and hostname forced [Tags] broker engine tls tcp - Config Engine ${1} - Config Broker rrd - Config Broker central - Config Broker module + Ctn Config Engine ${1} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module Set Local Variable ${hostname} centreon - Create Key And Certificate + Ctn Create Key And Certificate ... ${hostname} ... ${EtcRoot}/centreon-broker/server.key ... ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate + Ctn Create Key And Certificate ... ${hostname} ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Log central tls debug - Broker Config Log module0 tls debug - Broker Config Log central bbdo info - Broker Config Log module0 bbdo info - Change Broker Tcp Output To Grpc module0 - Change Broker Tcp Input To Grpc central - Broker Config Input Set central central-broker-master-input tls yes - Broker Config Input Set + Ctn Broker Config Log central tls debug + Ctn Broker Config Log module0 tls debug + Ctn Broker Config Log central bbdo info + Ctn Broker Config Log module0 bbdo info + Ctn Change Broker Tcp Output To Grpc module0 + Ctn Change Broker Tcp Input To Grpc central + Ctn Broker Config Input Set central central-broker-master-input tls yes + Ctn Broker Config Input Set ... central ... central-broker-master-input ... private_key ... ${EtcRoot}/centreon-broker/client.key - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... public_cert ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Input Set central central-broker-master-input tls_hostname centreon - Broker Config Output Set module0 central-module-master-output tls yes - Broker Config Output Set + Ctn Broker Config Input Set central central-broker-master-input tls_hostname centreon + Ctn Broker Config Output Set module0 central-module-master-output tls yes + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... public_cert ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt # We get the current date just before starting broker ${start} Get Current Date - Start Broker - Start Engine - ${result} Check Connections + Ctn Start Broker + Ctn Start engine + ${result} Ctn Check Connections Should Be True ${result} Engine and Broker not connected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result} Find In Log ${log} ${start} ${content1} + ${result} Ctn Find In Log ${log} ${start} ${content1} Should Be True ${result} ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result} Find In Log ${log} ${start} ${content2} + ${result} Ctn Find In Log ${log} ${start} ${content2} Should Be True ${result} diff --git a/tests/broker-engine/victoria.robot b/tests/broker-engine/victoria.robot index 7cbbc8c1533..525ee6988f9 100644 --- a/tests/broker-engine/victoria.robot +++ b/tests/broker-engine/victoria.robot @@ -3,41 +3,41 @@ Documentation Centreon Broker victoria metrics tests Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** VICT_ONE_CHECK_METRIC [Documentation] victoria metrics metric output [Tags] broker engine victoria_metrics - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Clear Retention - Broker Config Log central victoria_metrics trace - Broker Config Log central perfdata trace - Broker Config Source Log central 1 - Config Broker Sql Output central unified_sql - Config Broker Victoria Output + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Clear Retention + Ctn Broker Config Log central victoria_metrics trace + Ctn Broker Config Log central perfdata trace + Ctn Broker Config Source Log central 1 + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker Victoria Output ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Start Server 127.0.0.1 8000 # wait all is started ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Process Service Check Result host_16 service_314 0 taratata|metric_taratata=80%;50;75;5;99 + Ctn Process Service Check Result host_16 service_314 0 taratata|metric_taratata=80%;50;75;5;99 - ${start} Get Round Current Date + ${start} Ctn Get Round Current Date ${timeout} Get Current Date result_format=epoch increment=00:01:00 ${now} Get Current Date result_format=epoch WHILE ${now} < ${timeout} @@ -46,7 +46,7 @@ VICT_ONE_CHECK_METRIC Set Test Variable ${metric_found} False IF ${body != None} ${body} Decode Bytes To String ${body} UTF-8 - ${metric_found} Check Victoria Metric + ${metric_found} Ctn Check Victoria Metric ... ${body} ... ${start} ... unit=% @@ -67,36 +67,36 @@ VICT_ONE_CHECK_METRIC Should Be True ${now} < ${timeout} - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker AND Stop Server + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker AND Stop Server VICT_ONE_CHECK_STATUS [Documentation] victoria metrics status output [Tags] broker engine victoria_metrics - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Clear Retention - Broker Config Log central victoria_metrics trace - Broker Config Log central perfdata trace - Broker Config Source Log central 1 - Config Broker Sql Output central unified_sql - Config Broker Victoria Output + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Clear Retention + Ctn Broker Config Log central victoria_metrics trace + Ctn Broker Config Log central perfdata trace + Ctn Broker Config Source Log central 1 + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker Victoria Output ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Start Server 127.0.0.1 8000 # wait all is started ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. # service ok - ${start} Get Round Current Date - Process Service Check Result host_16 service_314 0 taratata|metric_taratata=80%;50;75;5;99 + ${start} Ctn Get Round Current Date + Ctn Process Service Check Result host_16 service_314 0 taratata|metric_taratata=80%;50;75;5;99 ${timeout} Get Current Date result_format=epoch increment=00:01:00 ${now} Get Current Date result_format=epoch @@ -106,7 +106,7 @@ VICT_ONE_CHECK_STATUS Set Test Variable ${status_found} False IF ${body != None} ${body} Decode Bytes To String ${body} UTF-8 - ${status_found} Check Victoria Status + ${status_found} Ctn Check Victoria Status ... ${body} ... ${start} ... host_id=16 @@ -124,8 +124,8 @@ VICT_ONE_CHECK_STATUS Should Be True ${now} < ${timeout} # service warning - ${start} Get Round Current Date - Process Service Result Hard + ${start} Ctn Get Round Current Date + Ctn Process Service Result Hard ... host_16 ... service_314 ... 1 @@ -139,7 +139,7 @@ VICT_ONE_CHECK_STATUS Set Test Variable ${status_found} False IF ${body != None} ${body} Decode Bytes To String ${body} UTF-8 - ${status_found} Check Victoria Status + ${status_found} Ctn Check Victoria Status ... ${body} ... ${start} ... host_id=16 @@ -158,8 +158,8 @@ VICT_ONE_CHECK_STATUS # service critical - ${start} Get Round Current Date - Process Service Result Hard + ${start} Ctn Get Round Current Date + Ctn Process Service Result Hard ... host_16 ... service_314 ... 2 @@ -173,7 +173,7 @@ VICT_ONE_CHECK_STATUS Set Test Variable ${status_found} False IF ${body != None} ${body} Decode Bytes To String ${body} UTF-8 - ${status_found} Check Victoria Status + ${status_found} Ctn Check Victoria Status ... ${body} ... ${start} ... host_id=16 @@ -190,37 +190,37 @@ VICT_ONE_CHECK_STATUS Should Be True ${now} < ${timeout} - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker AND Stop Server + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker AND Stop Server VICT_ONE_CHECK_METRIC_AFTER_FAILURE [Documentation] victoria metrics metric output after victoria shutdown [Tags] broker engine victoria_metrics - Config Engine ${1} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${1} - Config BBDO3 1 - Clear Retention - Broker Config Log central victoria_metrics trace - Broker Config Log central perfdata trace - Broker Config Source Log central 1 - Config Broker Sql Output central unified_sql - Config Broker Victoria Output + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Config BBDO3 1 + Ctn Clear Retention + Ctn Broker Config Log central victoria_metrics trace + Ctn Broker Config Log central perfdata trace + Ctn Broker Config Source Log central 1 + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker Victoria Output ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine # wait all is started ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Process Service Check Result host_16 service_314 0 taratata|metric_taratata=80%;50;75;5;99 - ${start} Get Round Current Date + Ctn Process Service Check Result host_16 service_314 0 taratata|metric_taratata=80%;50;75;5;99 + ${start} Ctn Get Round Current Date ${content} Create List [victoria_metrics] name: "metric_taratata" - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} victoria should add metric in a request Start Server 127.0.0.1 8000 @@ -232,7 +232,7 @@ VICT_ONE_CHECK_METRIC_AFTER_FAILURE Set Test Variable ${metric_found} False IF ${body != None} ${body} Decode Bytes To String ${body} UTF-8 - ${metric_found} Check Victoria Metric + ${metric_found} Ctn Check Victoria Metric ... ${body} ... ${start} ... unit=% @@ -253,4 +253,4 @@ VICT_ONE_CHECK_METRIC_AFTER_FAILURE Should Be True ${now} < ${timeout} - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker AND Stop Server + [Teardown] Run Keywords Ctn Stop engine AND Ctn Kindly Stop Broker AND Stop Server diff --git a/tests/broker-engine/whitelist.robot b/tests/broker-engine/whitelist.robot index 898497b0326..205f343da48 100644 --- a/tests/broker-engine/whitelist.robot +++ b/tests/broker-engine/whitelist.robot @@ -3,229 +3,229 @@ Documentation Centreon Broker and Engine benchmark Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean Whitelist -Test Setup Whitelist Setup -Test Teardown Stop Engine Broker And Save Logs only_central=${True} +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean Whitelist +Test Setup Ctn Whitelist Setup +Test Teardown Ctn Stop Engine Broker And Save Logs only_central=${True} *** Test Cases *** Whitelist_No_Whitelist_Directory [Documentation] log if /etc/centreon-engine-whitelist doesn't exist [Tags] whitelist engine - Config Engine ${1} ${50} ${20} - Config Broker module ${1} + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker module ${1} Remove Directory /etc/centreon-engine-whitelist recursive=${True} ${start} Get Current Date - Start Engine + Ctn Start engine ${content} Create List ... no whitelist directory found, all commands are accepted - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} no whitelist directory found must be found in logs Whitelist_Empty_Directory [Documentation] log if /etc/centreon-engine-whitelist if empty [Tags] whitelist engine - Config Engine ${1} ${50} ${20} - Config Broker module ${1} + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker module ${1} Empty Directory /etc/centreon-engine-whitelist ${start} Get Current Date - Start Engine + Ctn Start engine ${content} Create List ... whitelist directory found, but no restrictions, all commands are accepted - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} all commands are accepted must be found in logs Whitelist_Directory_Rights [Documentation] log if /etc/centreon-engine-whitelist has not mandatory rights or owner [Tags] whitelist engine - Config Engine ${1} ${50} ${20} - Config Broker module ${1} + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker module ${1} Run chown root:root /etc/centreon-engine-whitelist ${start} Get Current Date - Start Engine + Ctn Start engine ${content} Create List ... directory /etc/centreon-engine-whitelist must be owned by root@centreon-engine - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 30 Should Be True ${result} owned by root@centreon-engine must be found in logs ${start} Get Current Date Run chown root:centreon-engine /etc/centreon-engine-whitelist Run chmod 0777 /etc/centreon-engine-whitelist - Reload Engine - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + Ctn Reload Engine + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 30 Should Not Be True ${result} owned by root@centreon-engine must not be found in logs ${content} Create List directory /etc/centreon-engine-whitelist must have 750 right access - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 30 Should Be True ${result} must have 750 right access must be found in logs ${start} Get Current Date Run chmod 0750 /etc/centreon-engine-whitelist - Reload Engine - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + Ctn Reload Engine + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 30 Should Not Be True ${result} must have 750 right access must not be found in logs Whitelist_Host [Documentation] test allowed and forbidden commands for hosts [Tags] whitelist engine - Config Engine ${1} ${50} ${20} + Ctn Config Engine ${1} ${50} ${20} Empty Directory /etc/centreon-engine-whitelist - Config Broker central - Config Broker module ${1} - Engine Config Set Value 0 log_level_checks trace True - Engine Config Set Value 0 log_level_commands trace True - Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/check.pl 0 $HOSTADDRESS$ - Engine Config Replace Value In Hosts 0 host_1 check_command command_1 + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Engine Config Set Value 0 log_level_checks trace True + Ctn Engine Config Set Value 0 log_level_commands trace True + Ctn Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/check.pl 0 $HOSTADDRESS$ + Ctn Engine Config Replace Value In Hosts 0 host_1 check_command command_1 ${start} Get Current Date - Start Broker only_central=${True} - Start Engine + Ctn Start Broker only_central=${True} + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # no file => no restriction ${start} Get Current Date - Schedule Forced Host Check host_1 + Ctn Schedule Forced Host Check host_1 ${content} Create List raw::run: cmd='/tmp/var/lib/centreon-engine/check.pl 0 1.0.0.0' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check result found for host_1 # create non matching file with /tmp/var/lib/centreon-engine/check.pl 0 1.0.0.0 ${whitelist_content} Catenate ... {"whitelist":{"wildcard":["/tmp/var/lib/centreon-engine/toto* * *"], "regex":["/tmp/var/lib/centreon-engine/check.pl [1-9] 1.0.0.0"]}} Create File /etc/centreon-engine-whitelist/test ${whitelist_content} - Reload Engine + Ctn Reload Engine ${start} Get Current Date - Schedule Forced Host Check host_1 + Ctn Schedule Forced Host Check host_1 ${content} Create List ... host_1: this command cannot be executed because of security restrictions on the poller. A whitelist has been defined, and it does not include this command. - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No command not allowed found for host_1 # matching with /tmp/var/lib/centreon-engine/check.pl [1-9] 1.0.0.0"] - Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/check.pl 1 $HOSTADDRESS$ - Reload Engine + Ctn Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/check.pl 1 $HOSTADDRESS$ + Ctn Reload Engine ${start} Get Current Date - Schedule Forced Host Check host_1 + Ctn Schedule Forced Host Check host_1 ${content} Create List raw::run: cmd='/tmp/var/lib/centreon-engine/check.pl 1 1.0.0.0' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} /tmp/var/lib/centreon-engine/check.pl 1 not run # matching with /tmp/var/lib/centreon-engine/toto* * */etc/centreon-engine-whitelist/test - Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/totozea 1 $HOSTADDRESS$ - Reload Engine + Ctn Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/totozea 1 $HOSTADDRESS$ + Ctn Reload Engine ${start} Get Current Date - Schedule Forced Host Check host_1 + Ctn Schedule Forced Host Check host_1 ${content} Create List raw::run: cmd='/tmp/var/lib/centreon-engine/totozea 1 1.0.0.0' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} totozea not found Whitelist_Service [Documentation] test allowed and forbidden commands for services [Tags] whitelist engine - Config Engine ${1} ${50} ${20} + Ctn Config Engine ${1} ${50} ${20} Empty Directory /etc/centreon-engine-whitelist - Config Broker central - Config Broker module ${1} - Engine Config Set Value 0 log_level_checks trace True - Engine Config Set Value 0 log_level_commands trace True + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Engine Config Set Value 0 log_level_checks trace True + Ctn Engine Config Set Value 0 log_level_commands trace True # service_1 uses command_1 - Engine Config Replace Value In Services 0 service_1 check_command command_1 - Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/check.pl 0 $HOSTADDRESS$ + Ctn Engine Config Replace Value In Services 0 service_1 check_command command_1 + Ctn Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/check.pl 0 $HOSTADDRESS$ ${start} Get Current Date - Start Broker only_central=${True} - Start Engine + Ctn Start Broker only_central=${True} + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # no file => no restriction ${start} Get Current Date - Schedule Forced Svc Check host_1 service_1 + Ctn Schedule Forced Svc Check host_1 service_1 ${content} Create List raw::run: cmd='/tmp/var/lib/centreon-engine/check.pl 0 1.0.0.0' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check result found for service_1 # create non matching file with /tmp/var/lib/centreon-engine/check.pl 0 1.0.0.0 ${whitelist_content} Catenate ... {"whitelist":{"wildcard":["/tmp/var/lib/centreon-engine/toto* * *"], "regex":["/tmp/var/lib/centreon-engine/check.pl [1-9] 1.0.0.0"]}} Create File /etc/centreon-engine-whitelist/test ${whitelist_content} - Reload Engine + Ctn Reload Engine ${start} Get Current Date - Schedule Forced Svc Check host_1 service_1 + Ctn Schedule Forced Svc Check host_1 service_1 ${content} Create List ... service_1: this command cannot be executed because of security restrictions on the poller. A whitelist has been defined, and it does not include this command. - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No command not allowed found for service_1 # matching with /tmp/var/lib/centreon-engine/check.pl [1-9] 1.0.0.0"] - Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/check.pl 1 $HOSTADDRESS$ - Reload Engine + Ctn Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/check.pl 1 $HOSTADDRESS$ + Ctn Reload Engine ${start} Get Current Date - Schedule Forced Svc Check host_1 service_1 + Ctn Schedule Forced Svc Check host_1 service_1 ${content} Create List raw::run: cmd='/tmp/var/lib/centreon-engine/check.pl 1 1.0.0.0' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} /tmp/var/lib/centreon-engine/check.pl 1 not run # matching with /tmp/var/lib/centreon-engine/toto* * * - Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/totozea 1 $HOSTADDRESS$ - Reload Engine + Ctn Engine Config Change Command 0 1 /tmp/var/lib/centreon-engine/totozea 1 $HOSTADDRESS$ + Ctn Reload Engine ${start} Get Current Date - Schedule Forced Svc Check host_1 service_1 + Ctn Schedule Forced Svc Check host_1 service_1 ${content} Create List raw::run: cmd='/tmp/var/lib/centreon-engine/totozea 1 1.0.0.0' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} totozea not found Whitelist_Perl_Connector [Documentation] test allowed and forbidden commands for services [Tags] whitelist engine connector - Config Engine ${1} ${50} ${20} + Ctn Config Engine ${1} ${50} ${20} Empty Directory /etc/centreon-engine-whitelist - Config Broker central - Config Broker module ${1} - Engine Config Set Value 0 log_level_checks trace True - Engine Config Set Value 0 log_level_commands trace True + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Engine Config Set Value 0 log_level_checks trace True + Ctn Engine Config Set Value 0 log_level_commands trace True # service_1 uses command_14 (uses perl connector) - Engine Config Replace Value In Services 0 service_1 check_command command_14 - Engine Config Change Command 0 14 /tmp/var/lib/centreon-engine/check.pl 0 $HOSTADDRESS$ + Ctn Engine Config Replace Value In Services 0 service_1 check_command command_14 + Ctn Engine Config Change Command 0 14 /tmp/var/lib/centreon-engine/check.pl 0 $HOSTADDRESS$ ${whitelist_content} Catenate ... {"whitelist":{"wildcard":["/tmp/var/lib/centreon-engine/toto* * *"], "regex":["/tmp/var/lib/centreon-engine/check.pl [1-9] 1.0.0.0"]}} Create File /etc/centreon-engine-whitelist/test ${whitelist_content} ${start} Get Current Date - Start Broker only_central=${True} - Start Engine + Ctn Start Broker only_central=${True} + Ctn Start engine ${content} Create List check_for_external_commands - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # command not allowed because of 0 in first argument ${start} Get Current Date - Schedule Forced Svc Check host_1 service_1 + Ctn Schedule Forced Svc Check host_1 service_1 ${content} Create List ... service_1: this command cannot be executed because of security restrictions on the poller. A whitelist has been defined, and it does not include this command. - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No command not allowed found for service_1 # command allowed by whitelist - Engine Config Change Command 0 14 /tmp/var/lib/centreon-engine/check.pl 1 $HOSTADDRESS$ - Reload Engine + Ctn Engine Config Change Command 0 14 /tmp/var/lib/centreon-engine/check.pl 1 $HOSTADDRESS$ + Ctn Reload Engine ${start} Get Current Date - Schedule Forced Svc Check host_1 service_1 + Ctn Schedule Forced Svc Check host_1 service_1 ${content} Create List ... connector::run: connector='Perl Connector', cmd='/tmp/var/lib/centreon-engine/check.pl 1 1.0.0.0' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} /tmp/var/lib/centreon-engine/check.pl 1 1.0.0.0 not found *** Keywords *** -Whitelist Setup +Ctn Whitelist Setup Create Directory /etc/centreon-engine-whitelist - Stop Processes + Ctn Stop Processes -Clean Whitelist - Clean After Suite +Ctn Clean Whitelist + Ctn Clean After Suite Remove File /etc/centreon-engine-whitelist/test diff --git a/tests/broker/bbdo-server-client-ko.robot b/tests/broker/bbdo-server-client-ko.robot index 645e60d50e4..57cda5688c3 100644 --- a/tests/broker/bbdo-server-client-ko.robot +++ b/tests/broker/bbdo-server-client-ko.robot @@ -3,86 +3,86 @@ Documentation Centreon Broker start/stop tests with bbdo_server and bbdo_c Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** BSCSSK1 [Documentation] Start-Stop two instances of broker, server configured with grpc and client with tcp. No connectrion established and error raised on client side. [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_client 5670 tcp localhost - Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config Log central grpc debug - Broker Config Log central tcp debug - Broker Config Log rrd grpc debug - Broker Config Log rrd tcp debug - Broker Config Log central core error - Broker Config Log rrd core error + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_client 5670 tcp localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 grpc + Ctn Broker Config Log central grpc debug + Ctn Broker Config Log central tcp debug + Ctn Broker Config Log rrd grpc debug + Ctn Broker Config Log rrd tcp debug + Ctn Broker Config Log central core error + Ctn Broker Config Log rrd core error ${start} Get Current Date exclude_millis=True Sleep 1s - Start Broker + Ctn Start Broker # Client cannot connect. It returns an error ${content} Create List peer tcp://localhost:5670 is sending corrupted data - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No message about the bad connection. - Kindly Stop Broker + Ctn Kindly Stop Broker BSCSSK2 [Documentation] Start-Stop two instances of broker, server configured with tcp and client with grpc. No connection established and error raised on client side. [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 grpc - Config Broker BBDO Output central bbdo_client 5670 grpc localhost - Config Broker BBDO Input rrd bbdo_server 5670 tcp - Broker Config Log central grpc debug - Broker Config Log central tcp debug - Broker Config Log rrd grpc debug - Broker Config Log rrd tcp debug - Broker Config Log central core error - Broker Config Log rrd core error + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 grpc + Ctn Config Broker Bbdo Output central bbdo_client 5670 grpc localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 tcp + Ctn Broker Config Log central grpc debug + Ctn Broker Config Log central tcp debug + Ctn Broker Config Log rrd grpc debug + Ctn Broker Config Log rrd tcp debug + Ctn Broker Config Log central core error + Ctn Broker Config Log rrd core error ${start} Get Current Date exclude_millis=True Sleep 1s - Start Broker + Ctn Start Broker # Client cannot connect. It returns an error ${content} Create List ... BBDO: invalid protocol header, aborting connection: waiting for message of type 'version_response' but nothing received - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No message about the bad connection. - Kindly Stop Broker + Ctn Kindly Stop Broker *** Keywords *** -Start Stop Service +Ctn Start Stop Service [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-rrd.json alias=b2 Sleep ${interval} ${pid1} Get Process Id b1 ${pid2} Get Process Id b2 - ${result} Check Connection 5670 ${pid1} ${pid2} + ${result} Ctn Check Connection 5670 ${pid1} ${pid2} Should Be True ${result} The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 - ${result} Wait Or Dump And Kill Process b1 /usr/sbin/cbd 60s + ${result} Ctn Wait Or Dump And Kill Process b1 /usr/sbin/cbd 60s Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped Send Signal To Process SIGTERM b2 - ${result} Wait Or Dump And Kill Process b2 /usr/sbin/cbd 60s + ${result} Ctn Wait Or Dump And Kill Process b2 /usr/sbin/cbd 60s Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped -Start Stop Instance +Ctn Start Stop Instance [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Sleep ${interval} Send Signal To Process SIGTERM b1 - ${result} Wait Or Dump And Kill Process b1 /usr/sbin/cbd 60s + ${result} Ctn Wait Or Dump And Kill Process b1 /usr/sbin/cbd 60s Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker instance badly stopped diff --git a/tests/broker/bbdo-server-client-reversed.robot b/tests/broker/bbdo-server-client-reversed.robot index c7f7ba01806..365bceed270 100644 --- a/tests/broker/bbdo-server-client-reversed.robot +++ b/tests/broker/bbdo-server-client-reversed.robot @@ -3,303 +3,303 @@ Documentation Centreon Broker start/stop tests with bbdo_server and bbdo_c Resource ../resources/import.resource -Suite Setup Prepare Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Prepare Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BSCSSR1 [Documentation] Start-Stop two instances of broker and no coredump. Connection with bbdo_server/bbdo_client and reversed. [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_server 5670 tcp - Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Log central config debug - Repeat Keyword 5 times Start Stop Service 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_server 5670 tcp + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 tcp localhost + Ctn Broker Config Log central config debug + Repeat Keyword 5 times Ctn Start Stop Service 0 BSCSSRR1 [Documentation] Start-Stop two instances of broker and no coredump. Connection with bbdo_server/bbdo_client, reversed and retention. centreon-broker-master-rrd is then a failover. [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_server 5670 tcp - Broker Config Output Set central centreon-broker-master-rrd retention yes - Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Log central config debug - ${start} Get Round Current Date - Repeat Keyword 5 times Start Stop Service 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_server 5670 tcp + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 tcp localhost + Ctn Broker Config Log central config debug + ${start} Ctn Get Round Current Date + Repeat Keyword 5 times Ctn Start Stop Service 0 ${content} Create List failover 'centreon-broker-master-rrd' construction. - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No information about TLS activation. BSCSSPRR1 [Documentation] Start-Stop two instances of broker and no coredump. The server contains a listen address, reversed and retention. centreon-broker-master-rrd is then a failover. [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_server 5670 tcp localhost - Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Output Set central centreon-broker-master-rrd retention yes - Broker Config Log central config info - Repeat Keyword 5 times Start Stop Service 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_server 5670 tcp localhost + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 tcp localhost + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Ctn Broker Config Log central config info + Repeat Keyword 5 times Ctn Start Stop Service 0 BSCSSRR2 [Documentation] Start/Stop 10 times broker with 300ms interval and no coredump, reversed and retention. centreon-broker-master-rrd is then a failover. [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker BBDO Input central bbdo_client 5669 tcp localhost - Config Broker BBDO Output central bbdo_server 5670 tcp - Broker Config Output Set central centreon-broker-master-rrd retention yes - Repeat Keyword 10 times Start Stop Instance 300ms + Ctn Config Broker central + Ctn Config Broker Bbdo Input central bbdo_client 5669 tcp localhost + Ctn Config Broker Bbdo Output central bbdo_server 5670 tcp + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Repeat Keyword 10 times Ctn Start Stop Instance 300ms BSCSSGRR1 [Documentation] Start-Stop two instances of broker and no coredump, reversed and retention, with transport protocol grpc, start-stop 5 times. [Tags] broker start-stop bbdo_server bbdo_client grpc - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 grpc localhost - Config Broker BBDO Output central bbdo_server 5670 grpc - Broker Config Output Set central centreon-broker-master-rrd retention yes - Config Broker BBDO Input rrd bbdo_client 5670 grpc localhost - Broker Config Log central config info - ${start} Get Round Current Date - Repeat Keyword 5 times Start Stop Service 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 grpc localhost + Ctn Config Broker Bbdo Output central bbdo_server 5670 grpc + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 grpc localhost + Ctn Broker Config Log central config info + ${start} Ctn Get Round Current Date + Repeat Keyword 5 times Ctn Start Stop Service 0 ${content} Create List ... endpoint applier: creating new failover 'centreon-broker-master-rrd' ... failover 'centreon-broker-master-rrd' construction. - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No information about TLS activation. BSCSSTRR1 [Documentation] Start-Stop two instances of broker and no coredump. Encryption is enabled. transport protocol is tcp, reversed and retention. [Tags] broker start-stop bbdo_server bbdo_client tcp tls - Config Broker central - Config Broker rrd - Config Broker BBDO Output central bbdo_server 5670 tcp - Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Output Set central centreon-broker-master-rrd encryption yes - Broker Config Output Set central centreon-broker-master-rrd retention yes - Broker Config Input Set rrd central-rrd-master-input encryption yes - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log central tls debug - ${start} Get Round Current Date - Repeat Keyword 5 times Start Stop Service 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Output central bbdo_server 5670 tcp + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 tcp localhost + Ctn Broker Config Output Set central centreon-broker-master-rrd encryption yes + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Ctn Broker Config Input Set rrd central-rrd-master-input encryption yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log central tls debug + ${start} Ctn Get Round Current Date + Repeat Keyword 5 times Ctn Start Stop Service 0 ${content} Create List TLS: successful handshake - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No information about TLS activation. BSCSSTRR2 [Documentation] Start-Stop two instances of broker and no coredump. Encryption is enabled. [Tags] broker start-stop bbdo_server bbdo_client tcp tls - Config Broker central - Config Broker rrd - Config Broker BBDO Output central bbdo_server 5670 tcp - Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Output Set central centreon-broker-master-rrd encryption yes - Broker Config Output Set central centreon-broker-master-rrd retention yes - Broker Config Input Set rrd central-rrd-master-input encryption yes - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log central tls debug - Broker Config Output Set + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Output central bbdo_server 5670 tcp + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 tcp localhost + Ctn Broker Config Output Set central centreon-broker-master-rrd encryption yes + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Ctn Broker Config Input Set rrd central-rrd-master-input encryption yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log central tls debug + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set rrd central-rrd-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input Set rrd central-rrd-master-input certificate ${EtcRoot}/centreon-broker/client.crt - ${start} Get Round Current Date - Repeat Keyword 5 times Start Stop Service 0 + Ctn Broker Config Input Set rrd central-rrd-master-input private_key ${EtcRoot}/centreon-broker/client.key + Ctn Broker Config Input Set rrd central-rrd-master-input certificate ${EtcRoot}/centreon-broker/client.crt + ${start} Ctn Get Round Current Date + Repeat Keyword 5 times Ctn Start Stop Service 0 ${content} Create List TLS: successful handshake - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No information about TLS activation. BSCSSTGRR2 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with encryption enabled. It works with good certificates and keys. Reversed grpc connection with retention. [Tags] broker start-stop bbdo_server bbdo_client grpc tls - Config Broker central - Config Broker rrd - Config Broker BBDO Output central bbdo_server 5670 grpc - Config Broker BBDO Input rrd bbdo_client 5670 grpc localhost - Broker Config Output Set central centreon-broker-master-rrd encryption yes - Broker Config Output Set central centreon-broker-master-rrd retention yes - Broker Config Input Set rrd central-rrd-master-input encryption yes - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log rrd core off - Broker Config Log central tls debug - Broker Config Log central grpc trace - Create Key And Certificate + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Output central bbdo_server 5670 grpc + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 grpc localhost + Ctn Broker Config Output Set central centreon-broker-master-rrd encryption yes + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Ctn Broker Config Input Set rrd central-rrd-master-input encryption yes + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log rrd core off + Ctn Broker Config Log central tls debug + Ctn Broker Config Log central grpc trace + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/server.key ... ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Input Set rrd central-rrd-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input Set rrd central-rrd-master-input certificate ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set rrd central-rrd-master-input private_key ${EtcRoot}/centreon-broker/client.key + Ctn Broker Config Input Set rrd central-rrd-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set ... rrd ... central-rrd-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - ${start} Get Round Current Date - Start Broker + ${start} Ctn Get Round Current Date + Ctn Start Broker ${content} Create List write: buff: write done: buff: - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No information about TLS activation. - Kindly Stop Broker + Ctn Kindly Stop Broker BSCSSCRR1 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with tcp transport protocol. Compression is enabled on client side. Connection reversed with retention. [Tags] broker start-stop bbdo_server bbdo_client compression - Config Broker central - Config Broker rrd - Config Broker BBDO Output central bbdo_server 5670 tcp - Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Output Set central centreon-broker-master-rrd compression yes - Broker Config Output Set central centreon-broker-master-rrd retention yes - Broker Config Log central config off - Broker Config Log central core trace - Broker Config Log rrd core trace - Broker Config Flush Log central 0 - ${start} Get Round Current Date - Start Broker + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Output central bbdo_server 5670 tcp + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 tcp localhost + Ctn Broker Config Output Set central centreon-broker-master-rrd compression yes + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core trace + Ctn Broker Config Log rrd core trace + Ctn Broker Config Flush Log central 0 + ${start} Ctn Get Round Current Date + Ctn Start Broker ${content} Create List compression: writing - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No compression enabled - Kindly Stop Broker + Ctn Kindly Stop Broker BSCSSCRR2 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with tcp transport protocol. Compression is disabled on client side. Connection reversed with retention. [Tags] broker start-stop bbdo_server bbdo_client compression - Config Broker central - Config Broker rrd - Config Broker BBDO Output central bbdo_server 5670 tcp - Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Output Set central centreon-broker-master-rrd compression no - Broker Config Output Set central centreon-broker-master-rrd retention yes - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log rrd core trace - Broker Config Log central bbdo trace - Broker Config Flush Log central 0 - ${start} Get Round Current Date - Start Broker + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Output central bbdo_server 5670 tcp + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 tcp localhost + Ctn Broker Config Output Set central centreon-broker-master-rrd compression no + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log rrd core trace + Ctn Broker Config Log central bbdo trace + Ctn Broker Config Flush Log central 0 + ${start} Ctn Get Round Current Date + Ctn Start Broker ${content} Create List BBDO: we have extensions '' and peer has 'COMPRESSION' - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Compression enabled but should not. - Kindly Stop Broker + Ctn Kindly Stop Broker BSCSSCGRR1 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with grpc transport protocol. Compression is enabled on output side. Reversed connection with retention and grpc transport protocol. [Tags] broker start-stop bbdo_server bbdo_client compression tls - Config Broker central - Config Broker rrd - Config Broker BBDO Output central bbdo_server 5670 grpc - Config Broker BBDO Input rrd bbdo_client 5670 grpc localhost - Broker Config Output Set central centreon-broker-master-rrd compression yes - Broker Config Output Set central centreon-broker-master-rrd retention yes - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log rrd core off - Broker Config Log central tls debug - Broker Config Log central grpc debug - Broker Config Flush Log central 0 - ${start} Get Round Current Date - Start Broker + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Output central bbdo_server 5670 grpc + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 grpc localhost + Ctn Broker Config Output Set central centreon-broker-master-rrd compression yes + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log rrd core off + Ctn Broker Config Log central tls debug + Ctn Broker Config Log central grpc debug + Ctn Broker Config Flush Log central 0 + ${start} Ctn Get Round Current Date + Ctn Start Broker ${content} Create List server default compression deflate - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No compression enabled - Kindly Stop Broker + Ctn Kindly Stop Broker BSCSSCGRR2 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with grpc transport protocol. Compression is enabled on output side. Reversed connection with retention and grpc transport protocol. [Tags] broker start-stop bbdo_server bbdo_client compression tls - Config Broker central - Config Broker rrd - Config Broker BBDO Output central bbdo_server 5670 grpc - Config Broker BBDO Input rrd bbdo_client 5670 grpc localhost - Broker Config Output Set central centreon-broker-master-rrd compression no - Broker Config Output Set central centreon-broker-master-rrd retention yes - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log rrd core off - Broker Config Log central tls debug - Broker Config Log central grpc debug - Broker Config Flush Log central 0 - ${start} Get Round Current Date - Start Broker + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Output central bbdo_server 5670 grpc + Ctn Config Broker Bbdo Input rrd bbdo_client 5670 grpc localhost + Ctn Broker Config Output Set central centreon-broker-master-rrd compression no + Ctn Broker Config Output Set central centreon-broker-master-rrd retention yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log rrd core off + Ctn Broker Config Log central tls debug + Ctn Broker Config Log central grpc debug + Ctn Broker Config Flush Log central 0 + ${start} Ctn Get Round Current Date + Ctn Start Broker ${content} Create List server default compression deflate - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 15 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 15 Should Be True not ${result} No compression enabled - Kindly Stop Broker + Ctn Kindly Stop Broker *** Keywords *** -Start Stop Service +Ctn Start Stop Service [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-rrd.json alias=b2 Sleep ${interval} ${pid1} Get Process Id b1 ${pid2} Get Process Id b2 - ${result} Check Connection 5670 ${pid1} ${pid2} + ${result} Ctn Check Connection 5670 ${pid1} ${pid2} Should Be True ${result} The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 - ${result} Wait Or Dump And Kill Process b1 /usr/sbin/cbd 60s + ${result} Ctn Wait Or Dump And Kill Process b1 /usr/sbin/cbd 60s Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped Send Signal To Process SIGTERM b2 - ${result} Wait Or Dump And Kill Process b2 /usr/sbin/cbd 60s + ${result} Ctn Wait Or Dump And Kill Process b2 /usr/sbin/cbd 60s Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped -Start Stop Instance +Ctn Start Stop Instance [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Sleep ${interval} Send Signal To Process SIGTERM b1 - ${result} Wait Or Dump And Kill Process b1 /usr/sbin/cbd 60s + ${result} Ctn Wait Or Dump And Kill Process b1 /usr/sbin/cbd 60s Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker instance badly stopped -Prepare Suite - Clean Before Suite - Create Key And Certificate +Ctn Prepare Suite + Ctn Clean Before Suite + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/server.key ... ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt diff --git a/tests/broker/bbdo-server-client.robot b/tests/broker/bbdo-server-client.robot index 44717e13635..a3d6fbee4c3 100644 --- a/tests/broker/bbdo-server-client.robot +++ b/tests/broker/bbdo-server-client.robot @@ -3,399 +3,399 @@ Documentation Centreon Broker start/stop tests with bbdo_server and bbdo_c Resource ../resources/import.resource -Suite Setup Prepare Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Prepare Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** BSCSS1 [Documentation] Start-Stop two instances of broker and no coredump [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_client 5670 tcp localhost - Config Broker BBDO Input rrd bbdo_server 5670 tcp - Broker Config Log central config info - Repeat Keyword 5 times Start Stop Service 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_client 5670 tcp localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 tcp + Ctn Broker Config Log central config info + Repeat Keyword 5 times Ctn Start Stop Service 0 BSCSSP1 [Documentation] Start-Stop two instances of broker and no coredump. The server contains a listen address [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_client 5670 tcp localhost - Config Broker BBDO Input rrd bbdo_server 5670 tcp localhost - Broker Config Log central config info - Repeat Keyword 5 times Start Stop Service 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_client 5670 tcp localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 tcp localhost + Ctn Broker Config Log central config info + Repeat Keyword 5 times Ctn Start Stop Service 0 BSCSS2 [Documentation] Start/Stop 10 times broker with 300ms interval and no coredump [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_client 5670 tcp localhost - Repeat Keyword 10 times Start Stop Instance 300ms + Ctn Config Broker central + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_client 5670 tcp localhost + Repeat Keyword 10 times Ctn Start Stop Instance 300ms BSCSS3 [Documentation] Start-Stop one instance of broker and no coredump [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_client 5670 tcp localhost - Repeat Keyword 5 times Start Stop Instance 0 + Ctn Config Broker central + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_client 5670 tcp localhost + Repeat Keyword 5 times Ctn Start Stop Instance 0 BSCSS4 [Documentation] Start/Stop 10 times broker with 1sec interval and no coredump [Tags] broker start-stop bbdo_server bbdo_client tcp - Config Broker central - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_client 5670 tcp localhost - Repeat Keyword 10 times Start Stop Instance 1s + Ctn Config Broker central + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_client 5670 tcp localhost + Repeat Keyword 10 times Ctn Start Stop Instance 1s BSCSSG1 [Documentation] Start-Stop two instances of broker and no coredump [Tags] broker start-stop bbdo_server bbdo_client grpc - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 gRPC localhost - Config Broker BBDO Output central bbdo_client 5670 gRPC localhost - Config Broker BBDO Input rrd bbdo_server 5670 gRPC - Broker Config Log central config info - Repeat Keyword 5 times Start Stop Service 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 gRPC localhost + Ctn Config Broker Bbdo Output central bbdo_client 5670 gRPC localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 gRPC + Ctn Broker Config Log central config info + Repeat Keyword 5 times Ctn Start Stop Service 0 BSCSSG2 [Documentation] Start/Stop 10 times broker with 300ms interval and no coredump [Tags] broker start-stop bbdo_server bbdo_client grpc - Config Broker central - Config Broker BBDO Input central bbdo_server 5669 gRPC localhost - Config Broker BBDO Output central bbdo_client 5670 gRPC localhost - Repeat Keyword 10 times Start Stop Instance 300ms + Ctn Config Broker central + Ctn Config Broker Bbdo Input central bbdo_server 5669 gRPC localhost + Ctn Config Broker Bbdo Output central bbdo_client 5670 gRPC localhost + Repeat Keyword 10 times Ctn Start Stop Instance 300ms BSCSSG3 [Documentation] Start-Stop one instance of broker and no coredump [Tags] broker start-stop bbdo_server bbdo_client grpc - Config Broker central - Config Broker BBDO Input central bbdo_server 5669 gRPC - Config Broker BBDO Output central bbdo_client 5670 gRPC localhost - Repeat Keyword 5 times Start Stop Instance 0 + Ctn Config Broker central + Ctn Config Broker Bbdo Input central bbdo_server 5669 gRPC + Ctn Config Broker Bbdo Output central bbdo_client 5670 gRPC localhost + Repeat Keyword 5 times Ctn Start Stop Instance 0 BSCSSG4 [Documentation] Start/Stop 10 times broker with 1sec interval and no coredump [Tags] broker start-stop bbdo_server bbdo_client grpc - Config Broker central - Config Broker BBDO Input central bbdo_server 5669 gRPC - Config Broker BBDO Output central bbdo_client 5670 gRPC localhost - Repeat Keyword 10 times Start Stop Instance 1s + Ctn Config Broker central + Ctn Config Broker Bbdo Input central bbdo_server 5669 gRPC + Ctn Config Broker Bbdo Output central bbdo_client 5670 gRPC localhost + Repeat Keyword 10 times Ctn Start Stop Instance 1s BSCSST1 [Documentation] Start-Stop two instances of broker and no coredump. Encryption is enabled on client side. [Tags] broker start-stop bbdo_server bbdo_client tcp tls - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_client 5670 tcp localhost - Config Broker BBDO Input rrd bbdo_server 5670 tcp - Broker Config Output Set central centreon-broker-master-rrd encryption yes - Broker Config Input Set rrd central-rrd-master-input encryption yes - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log central tls debug + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_client 5670 tcp localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 tcp + Ctn Broker Config Output Set central centreon-broker-master-rrd encryption yes + Ctn Broker Config Input Set rrd central-rrd-master-input encryption yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log central tls debug ${start} Get Current Date - Repeat Keyword 5 times Start Stop Service 0 + Repeat Keyword 5 times Ctn Start Stop Service 0 ${content} Create List TLS: successful handshake - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No information about TLS activation. BSCSST2 [Documentation] Start-Stop two instances of broker and no coredump. Encryption is enabled on client side. [Tags] broker start-stop bbdo_server bbdo_client tcp tls - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_client 5670 tcp localhost - Config Broker BBDO Input rrd bbdo_server 5670 tcp - Broker Config Output Set central centreon-broker-master-rrd encryption yes - Broker Config Input Set rrd central-rrd-master-input encryption yes - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log central tls debug - Broker Config Output Set + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_client 5670 tcp localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 tcp + Ctn Broker Config Output Set central centreon-broker-master-rrd encryption yes + Ctn Broker Config Input Set rrd central-rrd-master-input encryption yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log central tls debug + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set rrd central-rrd-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input Set rrd central-rrd-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set rrd central-rrd-master-input private_key ${EtcRoot}/centreon-broker/client.key + Ctn Broker Config Input Set rrd central-rrd-master-input certificate ${EtcRoot}/centreon-broker/client.crt ${start} Get Current Date - Repeat Keyword 5 times Start Stop Service 0 + Repeat Keyword 5 times Ctn Start Stop Service 0 ${content} Create List TLS: successful handshake - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No information about TLS activation. BSCSSTG1 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with encryption enabled. This is not sufficient, then an error is raised. [Tags] broker start-stop bbdo_server bbdo_client grpc tls - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 gRPC - Config Broker BBDO Output central bbdo_client 5670 gRPC localhost - Config Broker BBDO Input rrd bbdo_server 5670 gRPC - Broker Config Output Set central centreon-broker-master-rrd encryption yes - Broker Config Input Set rrd central-rrd-master-input encryption yes - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log rrd core off - Broker Config Log central tls debug - Broker Config Log central grpc debug - Broker Config Log rrd grpc debug - Broker Config Flush Log central 0 - Broker Config Source Log central 1 - Broker Config Flush Log rrd 0 - Broker Config Source Log rrd 1 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 gRPC + Ctn Config Broker Bbdo Output central bbdo_client 5670 gRPC localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 gRPC + Ctn Broker Config Output Set central centreon-broker-master-rrd encryption yes + Ctn Broker Config Input Set rrd central-rrd-master-input encryption yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log rrd core off + Ctn Broker Config Log central tls debug + Ctn Broker Config Log central grpc debug + Ctn Broker Config Log rrd grpc debug + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Source Log central 1 + Ctn Broker Config Flush Log rrd 0 + Ctn Broker Config Source Log rrd 1 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List Handshake failed - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No information about TLS activation. BSCSSTG2 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with encryption enabled. It works with good certificates and keys. [Tags] broker start-stop bbdo_server bbdo_client grpc tls - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 grpc - Config Broker BBDO Output central bbdo_client 5670 grpc localhost - Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config Output Set central centreon-broker-master-rrd encryption yes - Broker Config Input Set rrd central-rrd-master-input encryption yes - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log rrd core off - Broker Config Log central tls debug - Broker Config Log rrd grpc trace - Broker Config Log central grpc trace - Create Key And Certificate + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 grpc + Ctn Config Broker Bbdo Output central bbdo_client 5670 grpc localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 grpc + Ctn Broker Config Output Set central centreon-broker-master-rrd encryption yes + Ctn Broker Config Input Set rrd central-rrd-master-input encryption yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log rrd core off + Ctn Broker Config Log central tls debug + Ctn Broker Config Log rrd grpc trace + Ctn Broker Config Log central grpc trace + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/server.key ... ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set rrd central-rrd-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input Set rrd central-rrd-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set rrd central-rrd-master-input private_key ${EtcRoot}/centreon-broker/client.key + Ctn Broker Config Input Set rrd central-rrd-master-input certificate ${EtcRoot}/centreon-broker/client.crt ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List encrypted connection write: buff: write done: buff: - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No information about TLS activation. - Kindly Stop Broker + Ctn Kindly Stop Broker BSCSSTG3 [Documentation] Start-Stop two instances of broker. The connection cannot be established if the server private key is missing and an error message explains this issue. [Tags] broker start-stop bbdo_server bbdo_client grpc tls - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 grpc - Config Broker BBDO Output central bbdo_client 5670 grpc localhost - Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config Output Set central centreon-broker-master-rrd encryption yes - Broker Config Input Set rrd central-rrd-master-input encryption yes - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log rrd core off - Broker Config Log central tls debug - Broker Config Log central grpc debug - Broker Config Log rrd grpc debug - Create Key And Certificate + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 grpc + Ctn Config Broker Bbdo Output central bbdo_client 5670 grpc localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 grpc + Ctn Broker Config Output Set central centreon-broker-master-rrd encryption yes + Ctn Broker Config Input Set rrd central-rrd-master-input encryption yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log rrd core off + Ctn Broker Config Log central tls debug + Ctn Broker Config Log central grpc debug + Ctn Broker Config Log rrd grpc debug + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/server.key ... ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output Set + Ctn Broker Config Output Set ... central ... centreon-broker-master-rrd ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input Set + Ctn Broker Config Input Set ... rrd ... central-rrd-master-input ... private_key ... ${EtcRoot}/centreon-broker/missing-client.key - Broker Config Input Set rrd central-rrd-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set rrd central-rrd-master-input certificate ${EtcRoot}/centreon-broker/client.crt ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List ... Cannot open file '/tmp/etc/centreon-broker/missing-client.key': No such file or directory - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content} 30 Should Be True ${result} No information about the missing private key on server. BSCSSC1 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with tcp transport protocol. Compression is enabled on client side. [Tags] broker start-stop bbdo_server bbdo_client compression - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_client 5670 tcp localhost - Config Broker BBDO Input rrd bbdo_server 5670 tcp - Broker Config Output Set central centreon-broker-master-rrd compression yes - Broker Config Log central config off - Broker Config Log central core trace - Broker Config Log rrd core trace - Broker Config Flush Log central 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_client 5670 tcp localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 tcp + Ctn Broker Config Output Set central centreon-broker-master-rrd compression yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core trace + Ctn Broker Config Log rrd core trace + Ctn Broker Config Flush Log central 0 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List compression: writing - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No compression enabled - Kindly Stop Broker + Ctn Kindly Stop Broker BSCSSC2 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with tcp transport protocol. Compression is disabled on client side. [Tags] broker start-stop bbdo_server bbdo_client compression - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 tcp - Config Broker BBDO Output central bbdo_client 5670 tcp localhost - Config Broker BBDO Input rrd bbdo_server 5670 tcp - Broker Config Output Set central centreon-broker-master-rrd compression no - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log rrd core trace - Broker Config Log central bbdo trace - Broker Config Flush Log central 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 tcp + Ctn Config Broker Bbdo Output central bbdo_client 5670 tcp localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 tcp + Ctn Broker Config Output Set central centreon-broker-master-rrd compression no + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log rrd core trace + Ctn Broker Config Log central bbdo trace + Ctn Broker Config Flush Log central 0 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List BBDO: we have extensions '' and peer has 'COMPRESSION' - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Compression enabled but should not. - Kindly Stop Broker + Ctn Kindly Stop Broker BSCSSCG1 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with grpc transport protocol. Compression is enabled on client side. [Tags] broker start-stop bbdo_server bbdo_client compression tls - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 grpc - Config Broker BBDO Output central bbdo_client 5670 grpc localhost - Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config Output Set central centreon-broker-master-rrd compression yes - Broker Config Log central config off - Broker Config Log central core trace - Broker Config Log rrd core off - Broker Config Log central tls debug - Broker Config Log rrd grpc debug - Broker Config Log central grpc debug - Broker Config Flush Log central 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 grpc + Ctn Config Broker Bbdo Output central bbdo_client 5670 grpc localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 grpc + Ctn Broker Config Output Set central centreon-broker-master-rrd compression yes + Ctn Broker Config Log central config off + Ctn Broker Config Log central core trace + Ctn Broker Config Log rrd core off + Ctn Broker Config Log central tls debug + Ctn Broker Config Log rrd grpc debug + Ctn Broker Config Log central grpc debug + Ctn Broker Config Flush Log central 0 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List activate compression deflate - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No compression enabled - Kindly Stop Broker + Ctn Kindly Stop Broker BSCSSGA1 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with grpc transport protocol. An authorization token is added on the server. Error messages are raised. [Tags] broker start-stop bbdo_server bbdo_client compression tls - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 grpc - Config Broker BBDO Output central bbdo_client 5670 grpc localhost - Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config Input Set rrd central-rrd-master-input authorization titus - Broker Config Log central config off - Broker Config Log central core off - Broker Config Log rrd core off - Broker Config Log rrd tls debug - Broker Config Log rrd grpc trace - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 grpc + Ctn Config Broker Bbdo Output central bbdo_client 5670 grpc localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 grpc + Ctn Broker Config Input Set rrd central-rrd-master-input authorization titus + Ctn Broker Config Log central config off + Ctn Broker Config Log central core off + Ctn Broker Config Log rrd core off + Ctn Broker Config Log rrd tls debug + Ctn Broker Config Log rrd grpc trace + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List Wrong client authorization token - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content} 30 Should Be True ${result} An error message about the authorization token should be raised. - Kindly Stop Broker + Ctn Kindly Stop Broker BSCSSGA2 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with grpc transport protocol. An authorization token is added on the server and also on the client. All looks ok. [Tags] broker start-stop bbdo_server bbdo_client compression tls - Config Broker central - Config Broker rrd - Config Broker BBDO Input central bbdo_server 5669 grpc - Config Broker BBDO Output central bbdo_client 5670 grpc localhost - Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config Input Set rrd central-rrd-master-input authorization titus - Broker Config Output Set central centreon-broker-master-rrd authorization titus - Broker Config Log central config trace - Broker Config Log central core trace - Broker Config Log rrd core off - Broker Config Log rrd tls debug - Broker Config Log rrd grpc debug - Broker Config Log central grpc debug - Broker Config Flush Log central 0 - Broker Config Flush Log rrd 0 - Broker Config Source Log rrd 1 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Bbdo Input central bbdo_server 5669 grpc + Ctn Config Broker Bbdo Output central bbdo_client 5670 grpc localhost + Ctn Config Broker Bbdo Input rrd bbdo_server 5670 grpc + Ctn Broker Config Input Set rrd central-rrd-master-input authorization titus + Ctn Broker Config Output Set central centreon-broker-master-rrd authorization titus + Ctn Broker Config Log central config trace + Ctn Broker Config Log central core trace + Ctn Broker Config Log rrd core off + Ctn Broker Config Log rrd tls debug + Ctn Broker Config Log rrd grpc debug + Ctn Broker Config Log central grpc debug + Ctn Broker Config Flush Log central 0 + Ctn Broker Config Flush Log rrd 0 + Ctn Broker Config Source Log rrd 1 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List receive: buff - ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${content} 30 Should Be True ${result} If the authorization token is the same on both side, no issue - Kindly Stop Broker + Ctn Kindly Stop Broker *** Keywords *** -Start Stop Service +Ctn Start Stop Service [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-rrd.json alias=b2 Sleep ${interval} ${pid1} Get Process Id b1 ${pid2} Get Process Id b2 - ${result} Check Connection 5670 ${pid1} ${pid2} + ${result} Ctn Check Connection 5670 ${pid1} ${pid2} Should Be True ${result} The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 @@ -405,7 +405,7 @@ Start Stop Service ${result} Wait For Process b2 timeout=60s on_timeout=kill Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped -Start Stop Instance +Ctn Start Stop Instance [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Sleep ${interval} @@ -413,13 +413,13 @@ Start Stop Instance ${result} Wait For Process b1 timeout=60s on_timeout=kill Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker instance badly stopped -Prepare Suite - Clean Before Suite - Create Key And Certificate +Ctn Prepare Suite + Ctn Clean Before Suite + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/server.key ... ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate + Ctn Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt diff --git a/tests/broker/command-line.robot b/tests/broker/command-line.robot index f8586c86a45..fd5202f76a4 100644 --- a/tests/broker/command-line.robot +++ b/tests/broker/command-line.robot @@ -3,69 +3,69 @@ Documentation Centreon Broker only start/stop tests Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** BCL1 [Documentation] Starting broker with option '-s foobar' should return an error [Tags] broker start-stop - Config Broker central - Start Broker With Args -s foobar - ${result} Wait For Broker + Ctn Config Broker central + Ctn Start Broker With Args -s foobar + ${result} Ctn Wait For broker ${expected} Evaluate "The option -s expects a positive integer" in """${result}""" Should Be True ${expected} expected error 'The option -s expects a positive integer' BCL2 [Documentation] Starting broker with option '-s5' should work [Tags] broker start-stop - Config Broker central + Ctn Config Broker central ${start} Get Current Date exclude_millis=True Sleep 1s - Start Broker With Args -s5 ${EtcRoot}/centreon-broker/central-broker.json + Ctn Start Broker With Args -s5 ${EtcRoot}/centreon-broker/central-broker.json ${table} Create List Starting the TCP thread pool of 5 threads - ${logger_res} Find In Log With Timeout ${centralLog} ${start} ${table} 30 + ${logger_res} Ctn Find In Log With Timeout ${centralLog} ${start} ${table} 30 Should Be True ... ${logger_res} ... Didn't found 5 threads in ${VarRoot}/log/centreon-broker/central-broker-master.log - Stop Broker With Args + Ctn Stop Broker With Args BCL3 [Documentation] Starting broker with options '-D' should work and activate diagnose mode [Tags] broker start-stop - Config Broker central + Ctn Config Broker central ${start} Get Current Date exclude_millis=True Sleep 1s - Start Broker With Args -D ${EtcRoot}/centreon-broker/central-broker.json - ${result} Wait For Broker + Ctn Start Broker With Args -D ${EtcRoot}/centreon-broker/central-broker.json + ${result} Ctn Wait For broker ${expected} Evaluate "diagnostic:" in """${result}""" Should Be True ${expected} diagnostic mode didn't launch BCL4 [Documentation] Starting broker with options '-s2' and '-D' should work. [Tags] broker start-stop - Config Broker central - Start Broker With Args -s2 -D ${EtcRoot}/centreon-broker/central-broker.json - ${result} Wait For Broker + Ctn Config Broker central + Ctn Start Broker With Args -s2 -D ${EtcRoot}/centreon-broker/central-broker.json + ${result} Ctn Wait For broker ${expected} Evaluate "diagnostic:" in """${result}""" Should Be True ${expected} diagnostic mode didn't launch *** Keywords *** -Start Broker With Args +Ctn Start Broker With Args [Arguments] @{options} Log To Console @{options} Start Process /usr/sbin/cbd @{options} alias=b1 stdout=/tmp/output.txt -Wait For broker +Ctn Wait For broker Wait For Process b1 ${result} Get File /tmp/output.txt Remove File /tmp/output.txt RETURN ${result} -Stop Broker With Args +Ctn Stop Broker With Args Send Signal To Process SIGTERM b1 ${result} Wait For Process b1 timeout=60s on_timeout=kill Should Be Equal As Integers ${result.rc} 0 diff --git a/tests/broker/filters.robot b/tests/broker/filters.robot index f8f803bb0ae..efdd935e8af 100644 --- a/tests/broker/filters.robot +++ b/tests/broker/filters.robot @@ -3,56 +3,56 @@ Documentation Centreon Broker only start/stop tests Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** BFC1 [Documentation] Start broker with invalid filters but one filter ok [Tags] broker start-stop log-v2 - Config Broker central - Config Broker rrd - Broker Config Log central config info - Broker Config Log central sql error - Broker Config Log central core error - Broker Config Output Set Json + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central config info + Ctn Broker Config Log central sql error + Ctn Broker Config Log central core error + Ctn Broker Config Output Set Json ... central ... central-broker-master-sql ... filters ... {"category": ["neb", "foo", "bar"]} - ${start} Get Round Current Date - Start Broker + ${start} Ctn Get Round Current Date + Ctn Start Broker ${content} Create List ... 'foo' is not a known category: cannot find event category 'foo' ... 'bar' is not a known category: cannot find event category 'bar' ... Filters applied on endpoint:neb - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} "Only neb filter should be applied on sql output" - Kindly Stop Broker + Ctn Kindly Stop Broker BFC2 [Documentation] Start broker with only invalid filters on an output [Tags] broker start-stop log-v2 - Config Broker central - Config Broker rrd - Broker Config Log central config info - Broker Config Log central sql error - Broker Config Log central core error - Broker Config Output Set Json + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central config info + Ctn Broker Config Log central sql error + Ctn Broker Config Log central core error + Ctn Broker Config Output Set Json ... central ... central-broker-master-sql ... filters ... {"category": ["doe", "foo", "bar"]} - ${start} Get Round Current Date - Start Broker + ${start} Ctn Get Round Current Date + Ctn Start Broker ${content} Create List ... 'doe' is not a known category: cannot find event category 'doe' ... 'bar' is not a known category: cannot find event category 'bar' ... Filters applied on endpoint:all - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} "Only neb filter should be applied on sql output" - Kindly Stop Broker + Ctn Kindly Stop Broker diff --git a/tests/broker/grpc-stream.robot b/tests/broker/grpc-stream.robot index caf87de7e19..ac5850ca8b1 100644 --- a/tests/broker/grpc-stream.robot +++ b/tests/broker/grpc-stream.robot @@ -3,110 +3,110 @@ Documentation Centreon Broker only start/stop tests Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If Failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BGRPCSS1 [Documentation] Start-Stop two instances of broker configured with grpc stream and no coredump [Tags] broker start-stop grpc - Config Broker central - Config Broker rrd - Change Broker Tcp Output To Grpc central - Change Broker Tcp Input To Grpc rrd - Repeat Keyword 5 times Start Stop Service 100ms + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Repeat Keyword 5 times Ctn Start Stop Service 100ms BGRPCSS2 [Documentation] Start/Stop 10 times broker configured with grpc stream with 300ms interval and no coredump [Tags] broker start-stop grpc - Config Broker central - Change Broker Tcp Output To Grpc central - Repeat Keyword 10 times Start Stop Instance 300ms + Ctn Config Broker central + Ctn Change Broker Tcp Output To Grpc central + Repeat Keyword 10 times Ctn Start Stop Instance 300ms BGRPCSS3 [Documentation] Start-Stop one instance of broker configured with grpc stream and no coredump [Tags] broker start-stop grpc - Config Broker central - Change Broker Tcp Output To Grpc central - Repeat Keyword 5 times Start Stop Instance 100ms + Ctn Config Broker central + Ctn Change Broker Tcp Output To Grpc central + Repeat Keyword 5 times Ctn Start Stop Instance 100ms BGRPCSS4 [Documentation] Start/Stop 10 times broker configured with grpc stream with 1sec interval and no coredump [Tags] broker start-stop grpc - Config Broker central - Change Broker Tcp Output To Grpc central - Repeat Keyword 10 times Start Stop Instance 1s + Ctn Config Broker central + Ctn Change Broker Tcp Output To Grpc central + Repeat Keyword 10 times Ctn Start Stop Instance 1s BGRPCSS5 [Documentation] Start-Stop with reversed connection on grpc acceptor with only one instance and no deadlock [Tags] broker start-stop grpc - Config Broker central - Change Broker Tcp Output To Grpc central - Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes - Broker Config Output Remove central centreon-broker-master-rrd host - Repeat Keyword 5 times Start Stop Instance 1s + Ctn Config Broker central + Ctn Change Broker Tcp Output To Grpc central + Ctn Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes + Ctn Broker Config Output Remove central centreon-broker-master-rrd host + Repeat Keyword 5 times Ctn Start Stop Instance 1s BGRPCSSU1 [Documentation] Start-Stop with unified_sql two instances of broker with grpc stream and no coredump [Tags] broker start-stop unified_sql grpc - Config Broker central - Config Broker rrd - Config Broker Sql Output central unified_sql - Change Broker Tcp Output To Grpc central - Change Broker Tcp Input To Grpc rrd - Repeat Keyword 5 times Start Stop Service 100ms + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Sql Output central unified_sql + Ctn Change Broker Tcp Output To Grpc central + Ctn Change Broker Tcp Input To Grpc rrd + Repeat Keyword 5 times Ctn Start Stop Service 100ms BGRPCSSU2 [Documentation] Start/Stop with unified_sql 10 times broker configured with grpc stream with 300ms interval and no coredump [Tags] broker start-stop unified_sql grpc - Config Broker central - Config Broker Sql Output central unified_sql - Change Broker Tcp Output To Grpc central - Repeat Keyword 10 times Start Stop Instance 300ms + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Change Broker Tcp Output To Grpc central + Repeat Keyword 10 times Ctn Start Stop Instance 300ms BGRPCSSU3 [Documentation] Start-Stop with unified_sql one instance of broker configured with grpc and no coredump [Tags] broker start-stop unified_sql grpc - Config Broker central - Change Broker Tcp Output To Grpc central - Config Broker Sql Output central unified_sql - Repeat Keyword 5 times Start Stop Instance 100ms + Ctn Config Broker central + Ctn Change Broker Tcp Output To Grpc central + Ctn Config Broker Sql Output central unified_sql + Repeat Keyword 5 times Ctn Start Stop Instance 100ms BGRPCSSU4 [Documentation] Start/Stop with unified_sql 10 times broker configured with grpc stream with 1sec interval and no coredump [Tags] broker start-stop unified_sql grpc - Config Broker central - Change Broker Tcp Output To Grpc central - Config Broker Sql Output central unified_sql - Repeat Keyword 10 times Start Stop Instance 1s + Ctn Config Broker central + Ctn Change Broker Tcp Output To Grpc central + Ctn Config Broker Sql Output central unified_sql + Repeat Keyword 10 times Ctn Start Stop Instance 1s BGRPCSSU5 [Documentation] Start-Stop with unified_sql with reversed connection on grpc acceptor with only one instance and no deadlock [Tags] broker start-stop unified_sql grpc - Config Broker central - Config Broker Sql Output central unified_sql - Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes - Broker Config Output Remove central centreon-broker-master-rrd host - Change Broker Tcp Output To Grpc central - Repeat Keyword 5 times Start Stop Instance 1s + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes + Ctn Broker Config Output Remove central centreon-broker-master-rrd host + Ctn Change Broker Tcp Output To Grpc central + Repeat Keyword 5 times Ctn Start Stop Instance 1s *** Keywords *** -Start Stop Service +Ctn Start Stop Service [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-rrd.json alias=b2 Sleep ${interval} - Kindly Stop Broker + Ctn Kindly Stop Broker -Start Stop Instance +Ctn Start Stop Instance [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Sleep ${interval} - Kindly Stop Broker True + Ctn Kindly Stop Broker True Send Signal To Process SIGTERM b1 ${result} Wait For Process b1 timeout=60s on_timeout=kill Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker instance badly stopped diff --git a/tests/broker/log.robot b/tests/broker/log.robot index d79a24d264a..da17dd6f797 100644 --- a/tests/broker/log.robot +++ b/tests/broker/log.robot @@ -3,67 +3,67 @@ Documentation Centreon Broker only start/stop tests Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** BLDIS1 [Documentation] Start broker with core logs 'disabled' [Tags] broker start-stop log-v2 - Config Broker rrd - Config Broker central - Broker Config Log central core disabled - Broker Config Log central sql debug + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Broker Config Log central core disabled + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List [sql] - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} "No sql logs produced" ${content} Create List [core] - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be Equal ${result} ${False} "We should not have core logs" - Kindly Stop Broker + Ctn Kindly Stop Broker BLEC1 [Documentation] Change live the core level log from trace to debug [Tags] broker log-v2 grpc - Config Broker rrd - Config Broker central - Broker Config Log central core trace - Broker Config Log central sql debug + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Broker Config Log central core trace + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - ${result} Get Broker Log Level 51001 core + Ctn Start Broker + ${result} Ctn Get Broker Log Level 51001 core Should Be Equal ${result} trace - Set Broker Log Level 51001 core debug - ${result} Get Broker Log Level 51001 core + Ctn Set Broker Log Level 51001 core debug + ${result} Ctn Get Broker Log Level 51001 core Should Be Equal ${result} debug BLEC2 [Documentation] Change live the core level log from trace to foo raises an error [Tags] broker log-v2 grpc - Config Broker rrd - Config Broker central - Broker Config Log central core trace - Broker Config Log central sql debug + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Broker Config Log central core trace + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - ${result} Get Broker Log Level 51001 core + Ctn Start Broker + ${result} Ctn Get Broker Log Level 51001 core Should Be Equal ${result} trace - ${result} Set Broker Log Level 51001 core foo + ${result} Ctn Set Broker Log Level 51001 core foo Should Be Equal ${result} Enum LogLevelEnum has no value defined for name 'FOO' BLEC3 [Documentation] Change live the foo level log to trace raises an error [Tags] broker log-v2 grpc - Config Broker rrd - Config Broker central - Broker Config Log central core trace - Broker Config Log central sql debug + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Broker Config Log central core trace + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker - ${result} Set Broker Log Level 51001 foo trace + Ctn Start Broker + ${result} Ctn Set Broker Log Level 51001 foo trace Should Be Equal ${result} The 'foo' logger does not exist diff --git a/tests/broker/sql.robot b/tests/broker/sql.robot index a81abe922a8..87c8f40c7b1 100644 --- a/tests/broker/sql.robot +++ b/tests/broker/sql.robot @@ -3,389 +3,389 @@ Documentation Centreon Broker Mariadb access Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save Logs If failed +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed *** Test Cases *** BDB1 [Documentation] Access denied when database name exists but is not the good one for sql output [Tags] broker sql - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-master-sql db_name centreon + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-master-sql db_name centreon FOR ${i} IN RANGE 0 5 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List storage and sql streams do not have the same database configuration - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ... ${result} ... A message should tell that sql and storage outputs do not have the same configuration. - Kindly Stop Broker + Ctn Kindly Stop Broker END BDB2 [Documentation] Access denied when database name exists but is not the good one for storage output [Tags] broker sql - Config Broker central - Broker Config Log central sql info - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-master-perfdata db_name centreon + Ctn Config Broker central + Ctn Broker Config Log central sql info + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-master-perfdata db_name centreon FOR ${i} IN RANGE 0 5 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List storage and sql streams do not have the same database configuration - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 20 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 Should Be True ... ${result} ... A log telling the impossibility to establish a connection between the storage stream and the database should appear. - Kindly Stop Broker + Ctn Kindly Stop Broker END BDB3 [Documentation] Access denied when database name does not exist for sql output [Tags] broker sql - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-master-sql db_name centreon1 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-master-sql db_name centreon1 FOR ${i} IN RANGE 0 5 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List global error: mysql_connection: error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No message about the database not connected. - Kindly Stop Broker + Ctn Kindly Stop Broker END BDB4 [Documentation] Access denied when database name does not exist for storage and sql outputs [Tags] broker sql - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-master-perfdata db_name centreon1 - Broker Config Output Set central central-broker-master-sql db_name centreon1 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-master-perfdata db_name centreon1 + Ctn Broker Config Output Set central central-broker-master-sql db_name centreon1 FOR ${i} IN RANGE 0 5 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 20 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 Should Be True ... ${result} ... No message about the fact that cbd is not correctly connected to the database. - Kindly Stop Broker + Ctn Kindly Stop Broker END BDB5 [Documentation] cbd does not crash if the storage/sql db_host is wrong [Tags] broker sql - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-master-perfdata db_host 1.2.3.4 - Broker Config Output Set central central-broker-master-sql db_host 1.2.3.4 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-master-perfdata db_host 1.2.3.4 + Ctn Broker Config Output Set central central-broker-master-sql db_host 1.2.3.4 FOR ${i} IN RANGE 0 5 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 50 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 50 Should Be True ${result} No message about the disconnection between cbd and the database - Kindly Stop Broker + Ctn Kindly Stop Broker END BDB6 [Documentation] cbd does not crash if the sql db_host is wrong [Tags] broker sql - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-master-sql db_host 1.2.3.4 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-master-sql db_host 1.2.3.4 FOR ${i} IN RANGE 0 5 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 20 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 Should Be True ${result} No message about the disconnection between cbd and the database - Kindly Stop Broker + Ctn Kindly Stop Broker END BDB7 [Documentation] access denied when database user password is wrong for perfdata/sql [Tags] broker sql - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-master-sql db_password centreon1 - Broker Config Output Set central central-broker-master-perfdata db_password centreon1 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-master-sql db_password centreon1 + Ctn Broker Config Output Set central central-broker-master-perfdata db_password centreon1 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List mysql_connection: error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 20 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker BDB8 [Documentation] access denied when database user password is wrong for perfdata/sql [Tags] broker sql - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-master-perfdata db_password centreon1 - Broker Config Output Set central central-broker-master-sql db_password centreon1 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-master-perfdata db_password centreon1 + Ctn Broker Config Output Set central central-broker-master-sql db_password centreon1 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List mysql_connection: error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 20 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker BDB9 [Documentation] access denied when database user password is wrong for sql [Tags] broker sql - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-master-sql db_password centreon1 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-master-sql db_password centreon1 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List mysql_connection: error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 20 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker BDB10 [Documentation] connection should be established when user password is good for sql/perfdata [Tags] broker sql - Config Broker central - Config Broker rrd - Config Broker module - Broker Config Log central sql debug + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Log central sql debug ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List sql stream initialization storage stream initialization - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker BEDB2 [Documentation] start broker/engine and then start MariaDB => connection is established [Tags] broker sql start-stop - Config Broker central - Config Broker rrd - Config Broker module - Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Engine ${1} ${start} Get Current Date - Stop Mysql - Start Broker - Start Engine + Ctn Stop Mysql + Ctn Start Broker + Ctn Start engine ${content} Create List error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40 Should Be True ${result} Message about the disconnection between cbd and the database is missing - Start Mysql - ${result} Check Broker Stats Exist central mysql manager waiting tasks in connection 0 60 + Ctn Start Mysql + ${result} Ctn Check Broker Stats Exist central mysql manager waiting tasks in connection 0 60 Should Be True ${result} Message about the connection to the database is missing. - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine BEDB3 [Documentation] start broker/engine, then stop MariaDB and then start it again. The gRPC API should give informations about SQL connections. [Tags] broker sql start-stop grpc - Config Broker central - Config Broker rrd - Config Broker module - Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Engine ${1} ${start} Get Current Date - Start Mysql - Start Broker - Start Engine + Ctn Start Mysql + Ctn Start Broker + Ctn Start engine FOR ${t} IN RANGE 60 - ${result} Check Sql Connections Count With Grpc 51001 ${3} + ${result} Ctn Check Sql Connections Count With Grpc 51001 ${3} IF ${result} BREAK END Should Be True ${result} gRPC does not return 3 connections as expected - Stop Mysql + Ctn Stop Mysql FOR ${t} IN RANGE 60 - ${result} Check All Sql connections Down With Grpc 51001 + ${result} Ctn Check All Sql Connections Down With Grpc 51001 IF ${result} BREAK END Should Be True ${result} Connections are not all down. - Start Mysql + Ctn Start Mysql FOR ${t} IN RANGE 60 - ${result} Check Sql Connections Count With Grpc 51001 ${3} + ${result} Ctn Check Sql Connections Count With Grpc 51001 ${3} IF ${result} BREAK END Should Be True ${result} gRPC does not return 3 connections as expected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine BEDB4 [Documentation] start broker/engine, then stop MariaDB and then start it again. The gRPC API should give informations about SQL connections. [Tags] broker sql start-stop grpc - Config Broker central - Config Broker rrd - Config Broker module - Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Engine ${1} ${start} Get Current Date - Stop Mysql - Start Broker - Start Engine + Ctn Stop Mysql + Ctn Start Broker + Ctn Start engine FOR ${t} IN RANGE 60 - ${result} Check All Sql connections Down With Grpc 51001 + ${result} Ctn Check All Sql Connections Down With Grpc 51001 IF ${result} BREAK END Should Be True ${result} Connections are not all down. - Start Mysql + Ctn Start Mysql FOR ${t} IN RANGE 60 - ${result} Check Sql Connections Count With Grpc 51001 ${3} + ${result} Ctn Check Sql Connections Count With Grpc 51001 ${3} IF ${result} BREAK END Should Be True ${result} gRPC does not return 3 connections as expected - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine BDBM1 [Documentation] start broker/engine and then start MariaDB => connection is established [Tags] broker sql start-stop @{lst} Create List 1 6 FOR ${c} IN @{lst} - Config Broker central - Broker Config Output Set central central-broker-master-sql connections_count ${c} - Broker Config Output Set central central-broker-master-perfdata connections_count ${c} - Config Broker rrd - Config Broker module - Config Engine ${1} - ${start} Get Round Current Date - Stop Mysql - Start Broker - Start Engine + Ctn Config Broker central + Ctn Broker Config Output Set central central-broker-master-sql connections_count ${c} + Ctn Broker Config Output Set central central-broker-master-perfdata connections_count ${c} + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Engine ${1} + ${start} Ctn Get Round Current Date + Ctn Stop Mysql + Ctn Start Broker + Ctn Start engine ${content} Create List error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 20 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 Should Be True ${result} Message about the disconnection between cbd and the database is missing - Start Mysql - ${result} Get Broker Stats Size central mysql manager + Ctn Start Mysql + ${result} Ctn Get Broker Stats Size central mysql manager Should Be True ... ${result} >= ${c} + 1 ... The stats file should contain at least ${c} + 1 connections to the database. - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine END BDBU1 [Documentation] Access denied when database name exists but is not the good one for unified sql output [Tags] broker sql unified_sql - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker rrd + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker rrd # We replace the usual centreon_storage database by centreon to make the wanted error - Broker Config Output Set central central-broker-unified-sql db_name centreon - Broker Config Log central sql trace - Broker Config Flush Log central 0 + Ctn Broker Config Output Set central central-broker-unified-sql db_name centreon + Ctn Broker Config Log central sql trace + Ctn Broker Config Flush Log central 0 FOR ${i} IN RANGE 0 5 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List Table 'centreon\..*' doesn't exist - ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} A message about some missing tables in 'centreon' database should appear - Kindly Stop Broker + Ctn Kindly Stop Broker END BDBU3 [Documentation] Access denied when database name does not exist for unified sql output [Tags] broker sql unified_sql - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-unified-sql db_name centreon1 + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-unified-sql db_name centreon1 FOR ${i} IN RANGE 0 5 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List global error: mysql_connection: error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} - Kindly Stop Broker + Ctn Kindly Stop Broker END BDBU5 [Documentation] cbd does not crash if the unified sql db_host is wrong [Tags] broker sql unified_sql - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-unified-sql db_host 1.2.3.4 + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-unified-sql db_host 1.2.3.4 FOR ${i} IN RANGE 0 5 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 50 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 50 Should Be True ${result} Cannot find the message telling cbd is not connected to the database. - Kindly Stop Broker + Ctn Kindly Stop Broker END BDBU7 [Documentation] Access denied when database user password is wrong for unified sql [Tags] broker sql unified_sql - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker rrd - Config Broker module - Broker Config Output Set central central-broker-unified-sql db_password centreon1 + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Output Set central central-broker-unified-sql db_password centreon1 ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List mysql_connection: error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 20 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 Should Be True ${result} Error concerning cbd not connected to the database is missing. - Kindly Stop Broker + Ctn Kindly Stop Broker BDBU10 [Documentation] Connection should be established when user password is good for unified sql [Tags] broker sql unified_sql - Config Broker central - Config Broker Sql Output central unified_sql - Config Broker rrd - Config Broker module - Broker Config Log central sql debug - Broker Config Log module0 sql debug + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Log central sql debug + Ctn Broker Config Log module0 sql debug ${start} Get Current Date - Start Broker + Ctn Start Broker ${content} Create List mysql_connection 0x[0-9a-f]* : commit - ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 40 + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start} ${content} 40 Should Be True ${result[0]} Log concerning a commit (connection ok) is missing. - Kindly Stop Broker + Ctn Kindly Stop Broker BDBMU1 [Documentation] start broker/engine with unified sql and then start MariaDB => connection is established [Tags] broker sql start-stop unified_sql @{lst} Create List 1 3 FOR ${c} IN @{lst} - Config Broker central - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql connections_count ${c} - Broker Config Output Set central central-broker-unified-sql retry_interval 5 - Config Broker rrd - Config Broker module - Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql connections_count ${c} + Ctn Broker Config Output Set central central-broker-unified-sql retry_interval 5 + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Engine ${1} ${start} Get Current Date - Stop Mysql - Start Broker - Start Engine + Ctn Stop Mysql + Ctn Start Broker + Ctn Start engine ${content} Create List mysql_connection: error while starting connection - ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 20 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 Should Be True ${result} Broker does not see any issue with the db while it is switched off - Start Mysql - ${result} Check Broker Stats Exist central mysql manager waiting tasks in connection 0 80 + Ctn Start Mysql + ${result} Ctn Check Broker Stats Exist central mysql manager waiting tasks in connection 0 80 Should Be True ${result} No stats on mysql manager found - ${result} Get Broker Stats Size central mysql manager ${60} + ${result} Ctn Get Broker Stats Size central mysql manager ${60} Should Be True ${result} >= ${c} + 1 Broker mysql manager stats do not show the ${c} connections - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop engine END diff --git a/tests/broker/start-stop.robot b/tests/broker/start-stop.robot index 0ec1df54cb7..f1bb03995d7 100644 --- a/tests/broker/start-stop.robot +++ b/tests/broker/start-stop.robot @@ -3,111 +3,111 @@ Documentation Centreon Broker only start/stop tests Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** BSS1 [Documentation] Start-Stop two instances of broker and no coredump [Tags] broker start-stop - Config Broker central - Config Broker rrd - Repeat Keyword 5 times Start Stop Service 0 + Ctn Config Broker central + Ctn Config Broker rrd + Repeat Keyword 5 times Ctn Start Stop Service 0 BSS2 [Documentation] Start/Stop 10 times broker with 300ms interval and no coredump [Tags] broker start-stop - Config Broker central - Repeat Keyword 10 times Start Stop Instance 300ms + Ctn Config Broker central + Repeat Keyword 10 times Ctn Start Stop Instance 300ms BSS3 [Documentation] Start-Stop one instance of broker and no coredump [Tags] broker start-stop - Config Broker central - Repeat Keyword 5 times Start Stop Instance 0 + Ctn Config Broker central + Repeat Keyword 5 times Ctn Start Stop Instance 0 BSS4 [Documentation] Start/Stop 10 times broker with 1sec interval and no coredump [Tags] broker start-stop - Config Broker central - Repeat Keyword 10 times Start Stop Instance 1s + Ctn Config Broker central + Repeat Keyword 10 times Ctn Start Stop Instance 1s BSS5 [Documentation] Start-Stop with reversed connection on TCP acceptor with only one instance and no deadlock [Tags] broker start-stop - Config Broker central - Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes - Broker Config Output Remove central centreon-broker-master-rrd host - Repeat Keyword 5 times Start Stop Instance 1s + Ctn Config Broker central + Ctn Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes + Ctn Broker Config Output Remove central centreon-broker-master-rrd host + Repeat Keyword 5 times Ctn Start Stop Instance 1s BSSU1 [Documentation] Start-Stop with unified_sql two instances of broker and no coredump [Tags] broker start-stop unified_sql - Config Broker central - Config Broker rrd - Config Broker Sql Output central unified_sql - Repeat Keyword 5 times Start Stop Service 0 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker Sql Output central unified_sql + Repeat Keyword 5 times Ctn Start Stop Service 0 BSSU2 [Documentation] Start/Stop with unified_sql 10 times broker with 300ms interval and no coredump [Tags] broker start-stop unified_sql - Config Broker central - Config Broker Sql Output central unified_sql - Repeat Keyword 10 times Start Stop Instance 300ms + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Repeat Keyword 10 times Ctn Start Stop Instance 300ms BSSU3 [Documentation] Start-Stop with unified_sql one instance of broker and no coredump [Tags] broker start-stop unified_sql - Config Broker central - Config Broker Sql Output central unified_sql - Repeat Keyword 5 times Start Stop Instance 0 + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Repeat Keyword 5 times Ctn Start Stop Instance 0 BSSU4 [Documentation] Start/Stop with unified_sql 10 times broker with 1sec interval and no coredump [Tags] broker start-stop unified_sql - Config Broker central - Config Broker Sql Output central unified_sql - Repeat Keyword 10 times Start Stop Instance 1s + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Repeat Keyword 10 times Ctn Start Stop Instance 1s BSSU5 [Documentation] Start-Stop with unified_sql with reversed connection on TCP acceptor with only one instance and no deadlock [Tags] broker start-stop unified_sql - Config Broker central - Config Broker Sql Output central unified_sql - Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes - Broker Config Output Remove central centreon-broker-master-rrd host - Repeat Keyword 5 times Start Stop Instance 1s + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes + Ctn Broker Config Output Remove central centreon-broker-master-rrd host + Repeat Keyword 5 times Ctn Start Stop Instance 1s START_STOP_CBD [Documentation] restart cbd with unified_sql services state must not be null after restart [Tags] broker start-stop unified_sql - Config Broker central - Config Broker module - Config Broker rrd - Config Broker module ${1} - Config BBDO3 nbEngine=1 - Config Engine ${1} ${50} ${20} - Config Broker Sql Output central unified_sql - - Clear Db services - Clear Db hosts + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Config BBDO3 nbEngine=1 + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker Sql Output central unified_sql + + Ctn Clear Db services + Ctn Clear Db hosts ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker # wait engine start ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # restart central broker - Stop Broker - Start Broker + Ctn Stop Broker + Ctn Start Broker Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -120,11 +120,11 @@ START_STOP_CBD Should Be Equal "${output}" "()" at least one host state is null END - [Teardown] Run Keywords Stop Engine AND Stop Broker + [Teardown] Run Keywords Ctn Stop engine AND Ctn Stop Broker *** Keywords *** -Start Stop Service +Ctn Start Stop Service [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-rrd.json alias=b2 @@ -140,7 +140,7 @@ Start Stop Service ... ${result.rc} == -15 or ${result.rc} == 0 ... Broker service badly stopped with code ${result.rc} -Start Stop Instance +Ctn Start Stop Instance [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Sleep ${interval} diff --git a/tests/ccc/ccc.robot b/tests/ccc/ccc.robot index 5b6d0a2ab57..7e8e90dde58 100644 --- a/tests/ccc/ccc.robot +++ b/tests/ccc/ccc.robot @@ -3,24 +3,24 @@ Documentation ccc tests with engine and broker Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** BECCC1 [Documentation] ccc without port fails with an error message [Tags] broker engine ccc - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Clear Retention ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s Start Process /usr/bin/ccc stderr=/tmp/output.txt FOR ${i} IN RANGE 10 @@ -30,27 +30,27 @@ BECCC1 Sleep 1s END Should Be Equal As Strings ${content.strip()} You must specify a port for the connection to the gRPC server - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker Remove File /tmp/output.txt BECCC2 [Documentation] ccc with -p 51001 connects to central cbd gRPC server. [Tags] broker engine protobuf bbdo ccc - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql store_in_resources yes - Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql store_in_resources yes + Ctn Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no + Ctn Clear Retention ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s Start Process /usr/bin/ccc -p 51001 stderr=/tmp/output.txt FOR ${i} IN RANGE 10 @@ -60,30 +60,30 @@ BECCC2 Sleep 1s END - ${version} Common.Get Collect Version + ${version} Common.Ctn Get Collect Version ${expected} Catenate Connected to a Centreon Broker ${version} gRPC server Should Be Equal As Strings ${content.strip()} ${expected} - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker Remove File /tmp/output.txt BECCC3 [Documentation] ccc with -p 50001 connects to centengine gRPC server. [Tags] broker engine protobuf bbdo - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql store_in_resources yes - Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql store_in_resources yes + Ctn Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no + Ctn Clear Retention ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s Start Process /usr/bin/ccc -p 50001 stderr=/tmp/output.txt FOR ${i} IN RANGE 10 @@ -92,30 +92,30 @@ BECCC3 IF len("${content.strip()}") > 0 BREAK Sleep 1s END - ${version} Common.Get Collect Version + ${version} Common.Ctn Get Collect Version ${expected} Catenate Connected to a Centreon Engine ${version} gRPC server Should Be Equal As Strings ${content.strip()} ${expected} - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker Remove File /tmp/output.txt BECCC4 [Documentation] ccc with -p 51001 -l returns the available functions from Broker gRPC server [Tags] broker engine protobuf bbdo ccc - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql store_in_resources yes - Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql store_in_resources yes + Ctn Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no + Ctn Clear Retention ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s Start Process /usr/bin/ccc -p 51001 -l stdout=/tmp/output.txt FOR ${i} IN RANGE 10 @@ -126,27 +126,27 @@ BECCC4 END ${contains} Evaluate "GetVersion" in """${content}""" and "RemovePoller" in """${content}""" Should Be True ${contains} The list of methods should contain GetVersion(Empty) - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker Remove File /tmp/output.txt BECCC5 [Documentation] ccc with -p 51001 -l GetVersion returns an error because we can't execute a command with -l. [Tags] broker engine protobuf bbdo ccc - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql store_in_resources yes - Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql store_in_resources yes + Ctn Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no + Ctn Clear Retention ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s Start Process /usr/bin/ccc -p 51001 -l GetVersion stderr=/tmp/output.txt FOR ${i} IN RANGE 10 @@ -157,27 +157,27 @@ BECCC5 END ${contains} Evaluate "The list argument expects no command" in """${content}""" Should Be True ${contains} When -l option is applied, we can't call a command. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker Remove File /tmp/output.txt BECCC6 [Documentation] ccc with -p 51001 GetVersion{} calls the GetVersion command [Tags] broker engine protobuf bbdo ccc - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql store_in_resources yes - Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql store_in_resources yes + Ctn Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no + Ctn Clear Retention ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s Start Process /usr/bin/ccc -p 51001 GetVersion{} stdout=/tmp/output.txt FOR ${i} IN RANGE 10 @@ -186,7 +186,7 @@ BECCC6 IF len("""${content.strip().split()}""") > 50 BREAK Sleep 1s END - ${version} Common.Get Collect Version + ${version} Common.Ctn Get Collect Version ${vers} Split String ${version} . ${mm} Evaluate """${vers}[0]""".lstrip("0") ${m} Evaluate """${vers}[1]""".lstrip("0") @@ -202,27 +202,27 @@ BECCC6 ... {\n \"major\": ${mm},\n \"minor\": ${m},\n \"patch\": ${p}\n} ... A version as json string should be returned END - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker Remove File /tmp/output.txt BECCC7 [Documentation] ccc with -p 51001 GetVersion{"idx":1} returns an error because the input message is wrong. [Tags] broker engine protobuf bbdo ccc - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql store_in_resources yes - Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql store_in_resources yes + Ctn Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no + Ctn Clear Retention ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s Start Process /usr/bin/ccc -p 51001 GetVersion{"idx":1} stderr=/tmp/output.txt FOR ${i} IN RANGE 10 @@ -235,27 +235,27 @@ BECCC7 ... ${content} ... Error during the execution of '/com.centreon.broker.Broker/GetVersion' method: ... GetVersion{"idx":1} should return an error because the input message is incompatible with the expected one. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker Remove File /tmp/output.txt BECCC8 [Documentation] ccc with -p 50001 EnableServiceNotifications{"names":{"host_name": "host_1", "service_name": "service_1"}} works and returns an empty message. [Tags] broker engine protobuf bbdo ccc - Config Engine ${1} - Config Broker central - Config Broker module - Config Broker rrd - Config BBDO3 1 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Broker Config Output Set central central-broker-unified-sql store_in_resources yes - Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no - Clear Retention + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config Broker rrd + Ctn Config BBDO3 1 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Output Set central central-broker-unified-sql store_in_resources yes + Ctn Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no + Ctn Clear Retention ${start} Get Current Date Sleep 1s - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine Sleep 3s Start Process ... /usr/bin/ccc @@ -269,6 +269,6 @@ BECCC8 Sleep 1s END Should Contain ${content} {} - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker Remove File /tmp/output.txt diff --git a/tests/connector_perl/connector_perl.robot b/tests/connector_perl/connector_perl.robot index cedaff9e154..ce25c86a109 100644 --- a/tests/connector_perl/connector_perl.robot +++ b/tests/connector_perl/connector_perl.robot @@ -3,25 +3,25 @@ Documentation centreon_connector_perl tests. Resource ../resources/import.resource -Suite Setup Start engine -Suite Teardown Stop engine +Suite Setup Ctn Start engine +Suite Teardown Ctn Stop engine *** Test Cases *** test use connector perl exist script [Documentation] test exist script [Tags] connector engine - Schedule Forced Host Check local_host_test_machine /tmp/test_connector_perl/rw/centengine.cmd + Ctn Schedule Forced Host Check local_host_test_machine /tmp/test_connector_perl/rw/centengine.cmd Sleep 5 seconds we wait engine forced checks - ${search_result} Check Search /tmp/test_connector_perl/log/centengine.debug test.pl + ${search_result} Ctn Check Search /tmp/test_connector_perl/log/centengine.debug test.pl Should Contain ${search_result} a dummy check check not found test use connector perl unknown script [Documentation] test unknown script [Tags] connector engine - Schedule Forced Host Check local_host_test_machine_bad_test /tmp/test_connector_perl/rw/centengine.cmd + Ctn Schedule Forced Host Check local_host_test_machine_bad_test /tmp/test_connector_perl/rw/centengine.cmd Sleep 5 seconds we wait engine forced checks - ${search_result} Check Search /tmp/test_connector_perl/log/centengine.debug test_titi.pl + ${search_result} Ctn Check Search /tmp/test_connector_perl/log/centengine.debug test_titi.pl Should Contain ... ${search_result} ... Embedded Perl error: failed to open Perl file '/tmp/test_connector_perl/test_titi.pl' @@ -32,25 +32,25 @@ test use connector perl multiple script [Tags] connector engine FOR ${idx} IN RANGE 2 12 ${host} Catenate SEPARATOR= local_host_test_machine. ${idx} - Schedule Forced Host Check ${host} /tmp/test_connector_perl/rw/centengine.cmd + Ctn Schedule Forced Host Check ${host} /tmp/test_connector_perl/rw/centengine.cmd END Sleep 10 seconds we wait engine forced checks FOR ${idx} IN RANGE 2 12 ${search_str} Catenate SEPARATOR= test.pl -H 127.0.0. ${idx} - ${search_result} Check Search /tmp/test_connector_perl/log/centengine.debug ${search_str} + ${search_result} Ctn Check Search /tmp/test_connector_perl/log/centengine.debug ${search_str} Should Contain ${search_result} a dummy check check not found END *** Keywords *** -Start engine +Ctn Start engine Create Directory /tmp/test_connector_perl/log/ Create Directory /tmp/test_connector_perl/rw/ Copy Files connector_perl/conf_engine/* /tmp/test_connector_perl/ Empty Directory /tmp/test_connector_perl/log/ - Kill Engine - Start Custom Engine /tmp/test_connector_perl/centengine.cfg engine_alias + Ctn Kill Engine + Ctn Start Custom Engine /tmp/test_connector_perl/centengine.cfg engine_alias Sleep 5 seconds we wait engine start -Stop engine - Stop Custom Engine engine_alias +Ctn Stop engine + Ctn Stop Custom Engine engine_alias diff --git a/tests/connector_ssh/connector_ssh.robot b/tests/connector_ssh/connector_ssh.robot index 41f69283749..5e93c5f44bb 100644 --- a/tests/connector_ssh/connector_ssh.robot +++ b/tests/connector_ssh/connector_ssh.robot @@ -3,79 +3,79 @@ Documentation centreon_connector_ssh tests. Resource ../resources/import.resource -Suite Setup Prepare ssh -Suite Teardown Clean Whitelist -Test Setup Stop Processes -Test Teardown Save SSH Logs If Failed +Suite Setup Ctn Prepare ssh +Suite Teardown Ctn Clean Whitelist +Test Setup Ctn Stop Processes +Test Teardown Ctn Save SSH Logs If Failed *** Test Cases *** TestBadUser [Documentation] test unknown user [Tags] connector engine - Clear Retention - Config Broker module ${1} - Config Engine ${1} - - Engine Config Set Value ${0} log_level_commands trace - Engine Config Set Value In Hosts ${0} host_1 _USER toto - Engine Config Replace Value In Hosts ${0} host_1 check_command ssh_linux_snmp - Engine Config Replace Value In Hosts ${0} host_1 address 127.0.0.10 - Engine Config Set Value In Hosts ${0} host_1 _PASSWORD titi - Engine Config Add Command + Ctn Clear Retention + Ctn Config Broker module ${1} + Ctn Config Engine ${1} + + Ctn Engine Config Set Value ${0} log_level_commands trace + Ctn Engine Config Set Value In Hosts ${0} host_1 _USER toto + Ctn Engine Config Replace Value In Hosts ${0} host_1 check_command ssh_linux_snmp + Ctn Engine Config Replace Value In Hosts ${0} host_1 address 127.0.0.10 + Ctn Engine Config Set Value In Hosts ${0} host_1 _PASSWORD titi + Ctn Engine Config Add Command ... ${0} ... ssh_linux_snmp ... $USER1$/check_by_ssh -H $HOSTADDRESS$ -l $_HOSTUSER$ -a $_HOSTPASSWORD$ -C "echo -n toto=$HOSTADDRESS$" ... SSH Connector - Start Engine + Ctn Start engine ${start} Get Current Date ${content} Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. ${start} Get Current Date - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd ${content} Create List fail to connect to toto@127.0.0.10 - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message fail to connect to toto@127.0.0.10 should be available. - Stop Engine + Ctn Stop engine TestBadPwd [Documentation] test bad password [Tags] connector engine - Clear Retention - Config Broker module ${1} - Config Engine ${1} - Engine Config Set Value ${0} log_level_commands trace - Engine Config Set Value In Hosts ${0} host_1 _USER testconnssh - Engine Config Replace Value In Hosts ${0} host_1 check_command ssh_linux_snmp - Engine Config Replace Value In Hosts ${0} host_1 address 127.0.0.11 - Engine Config Set Value In Hosts ${0} host_1 _PASSWORD titi - Engine Config Add Command + Ctn Clear Retention + Ctn Config Broker module ${1} + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_level_commands trace + Ctn Engine Config Set Value In Hosts ${0} host_1 _USER testconnssh + Ctn Engine Config Replace Value In Hosts ${0} host_1 check_command ssh_linux_snmp + Ctn Engine Config Replace Value In Hosts ${0} host_1 address 127.0.0.11 + Ctn Engine Config Set Value In Hosts ${0} host_1 _PASSWORD titi + Ctn Engine Config Add Command ... ${0} ... ssh_linux_snmp ... $USER1$/check_by_ssh -H $HOSTADDRESS$ -l $_HOSTUSER$ -a $_HOSTPASSWORD$ -C "echo -n toto=$HOSTADDRESS$" ... SSH Connector - Start Engine + Ctn Start engine ${start} Get Current Date ${content} Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. ${start} Get Current Date - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd ${content} Create List fail to connect to testconnssh@127.0.0.11 - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message fail to connect to testconnssh@127.0.0.11 should be available. - Stop Engine + Ctn Stop engine Test6Hosts [Documentation] as 127.0.0.x point to the localhost address we will simulate check on 6 hosts @@ -84,63 +84,63 @@ Test6Hosts Run cat ~testconnssh/.ssh/id_rsa.pub ~root/.ssh/id_rsa.pub > ~testconnssh/.ssh/authorized_keys # Run chown testconnssh: ~testconnssh/.ssh/authorized_keys # Run chmod 600 ~testconnssh/.ssh/authorized_keys - Clear Retention - Config Broker module ${1} - Config Engine ${1} - Engine Config Set Value ${0} log_level_commands trace - Engine Config Add Command + Ctn Clear Retention + Ctn Config Broker module ${1} + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_level_commands trace + Ctn Engine Config Add Command ... ${0} ... ssh_linux_snmp ... $USER1$/check_by_ssh -H $HOSTADDRESS$ -l $_HOSTUSER$ -a $_HOSTPASSWORD$ -C "echo -n toto=$HOSTADDRESS$" ... SSH Connector - ${run_env} Run Env - Engine Config Set Value In Hosts ${0} host_1 _USER testconnssh - Engine Config Replace Value In Hosts ${0} host_1 check_command ssh_linux_snmp - Engine Config Set Value In Hosts ${0} host_1 _IDENTITYFILE /home/testconnssh/.ssh/id_rsa - Engine Config Set Value In Hosts ${0} host_1 _PASSWORD passwd + ${run_env} Ctn Run Env + Ctn Engine Config Set Value In Hosts ${0} host_1 _USER testconnssh + Ctn Engine Config Replace Value In Hosts ${0} host_1 check_command ssh_linux_snmp + Ctn Engine Config Set Value In Hosts ${0} host_1 _IDENTITYFILE /home/testconnssh/.ssh/id_rsa + Ctn Engine Config Set Value In Hosts ${0} host_1 _PASSWORD passwd IF "${run_env}" == "docker" - Engine Config Replace Value In Hosts ${0} host_1 address 127.0.0.1 + Ctn Engine Config Replace Value In Hosts ${0} host_1 address 127.0.0.1 ELSE - Engine Config Replace Value In Hosts ${0} host_1 address ::1 + Ctn Engine Config Replace Value In Hosts ${0} host_1 address ::1 END FOR ${idx} IN RANGE 2 7 - Engine Config Set Value In Hosts ${0} host_${idx} _USER testconnssh - Engine Config Replace Value In Hosts ${0} host_${idx} check_command ssh_linux_snmp - Engine Config Replace Value In Hosts ${0} host_${idx} address 127.0.0.${idx} - Engine Config Set Value In Hosts ${0} host_${idx} _IDENTITYFILE /home/testconnssh/.ssh/id_rsa - Engine Config Set Value In Hosts ${0} host_${idx} _PASSWORD passwd + Ctn Engine Config Set Value In Hosts ${0} host_${idx} _USER testconnssh + Ctn Engine Config Replace Value In Hosts ${0} host_${idx} check_command ssh_linux_snmp + Ctn Engine Config Replace Value In Hosts ${0} host_${idx} address 127.0.0.${idx} + Ctn Engine Config Set Value In Hosts ${0} host_${idx} _IDENTITYFILE /home/testconnssh/.ssh/id_rsa + Ctn Engine Config Set Value In Hosts ${0} host_${idx} _PASSWORD passwd END - Start Engine + Ctn Start engine ${start} Get Current Date ${content} Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. ${start} Get Current Date FOR ${idx} IN RANGE 1 7 - Schedule Forced Host Check host_${idx} /tmp/var/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_${idx} /tmp/var/lib/centreon-engine/config0/rw/centengine.cmd END IF "${run_env}" == "docker" ${content} Create List output='toto=127.0.0.1' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message output='toto=127.0.0.1' should be available. ELSE ${content} Create List output='toto=::1' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message output='toto=::1' should be available. END FOR ${idx} IN RANGE 2 7 ${content} Create List output='toto=127.0.0.${idx} - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message output='toto=127.0.0.${idx}' should be available. END - Stop Engine + Ctn Stop engine TestWhiteList [Documentation] as 127.0.0.x point to the localhost address we will simulate check on 6 hosts @@ -149,74 +149,74 @@ TestWhiteList Run cat ~testconnssh/.ssh/id_rsa.pub ~root/.ssh/id_rsa.pub > ~testconnssh/.ssh/authorized_keys # Run chown testconnssh: ~testconnssh/.ssh/authorized_keys # Run chmod 600 ~testconnssh/.ssh/authorized_keys - Clear Retention - Config Broker module ${1} - Config Engine ${1} - Engine Config Set Value ${0} log_level_commands trace - Engine Config Add Command + Ctn Clear Retention + Ctn Config Broker module ${1} + Ctn Config Engine ${1} + Ctn Engine Config Set Value ${0} log_level_commands trace + Ctn Engine Config Add Command ... ${0} ... ssh_linux_snmp ... $USER1$/check_by_ssh -H $HOSTADDRESS$ -l $_HOSTUSER$ -a $_HOSTPASSWORD$ -C "echo -n toto=$HOSTADDRESS$" ... SSH Connector - ${run_env} Run Env - Engine Config Set Value In Hosts ${0} host_1 _USER testconnssh - Engine Config Replace Value In Hosts ${0} host_1 check_command ssh_linux_snmp - Engine Config Set Value In Hosts ${0} host_1 _IDENTITYFILE /home/testconnssh/.ssh/id_rsa - Engine Config Set Value In Hosts ${0} host_1 _PASSWORD passwd + ${run_env} Ctn Run Env + Ctn Engine Config Set Value In Hosts ${0} host_1 _USER testconnssh + Ctn Engine Config Replace Value In Hosts ${0} host_1 check_command ssh_linux_snmp + Ctn Engine Config Set Value In Hosts ${0} host_1 _IDENTITYFILE /home/testconnssh/.ssh/id_rsa + Ctn Engine Config Set Value In Hosts ${0} host_1 _PASSWORD passwd IF "${run_env}" == "docker" - Engine Config Replace Value In Hosts ${0} host_1 address 127.0.0.1 + Ctn Engine Config Replace Value In Hosts ${0} host_1 address 127.0.0.1 ELSE - Engine Config Replace Value In Hosts ${0} host_1 address ::1 + Ctn Engine Config Replace Value In Hosts ${0} host_1 address ::1 END Create Directory /etc/centreon-engine-whitelist ${whitelist_content} Catenate ... {"whitelist":{"regex":["/tmp/var/lib/centreon-engine/check.pl [1-9] 1.0.0.0"]}} Create File /etc/centreon-engine-whitelist/test ${whitelist_content} - Start Engine + Ctn Start engine ${start} Get Current Date ${content} Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. # ssh_linux_snmp forbidden ${start} Get Current Date - Schedule Forced Host Check host_1 + Ctn Schedule Forced Host Check host_1 ${content} Create List ... host_1: this command cannot be executed because of security restrictions on the poller. A whitelist has been defined, and it does not include this command. - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message 'command rejected by whitelis' should be available. # ssh_linuw allowed ${whitelist_content} Catenate ... {"whitelist":{"regex":["/usr/lib64/nagios/plugins/check_by_ssh .+"]}} Create File /etc/centreon-engine-whitelist/test2 ${whitelist_content} - Reload Engine + Ctn Reload Engine ${start} Get Current Date - Schedule Forced Host Check host_1 + Ctn Schedule Forced Host Check host_1 ${content} Create List 'toto=127.0.0.1' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 IF "${run_env}" == "docker" ${content} Create List 'toto=127.0.0.1' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message 'toto=127.0.0.1' should be available. ELSE ${content} Create List 'toto=::1' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message 'toto=::1' should be available. END - Stop Engine + Ctn Stop engine *** Keywords *** -Prepare ssh +Ctn Prepare ssh [Documentation] in order to test ssh connector, we need to create a user, his password and his Keyword Run useradd -m -d /home/testconnssh testconnssh Remove File ~testconnssh/.ssh/authorized_keys @@ -227,16 +227,16 @@ Prepare ssh Run echo testconnssh:passwd | chpasswd Run su testconnssh -c "ssh-keygen -q -t rsa -N '' -f ~testconnssh/.ssh/id_rsa" Run ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa - Clean Before Suite + Ctn Clean Before Suite -Save SSH Logs If Failed - Run Keyword If Test Failed Save SSH Logs +Ctn Save SSH Logs If Failed + Run Keyword If Test Failed Ctn Save SSH Logs -Save SSH Logs - Save Logs +Ctn Save SSH Logs + Ctn Save Logs ${failDir} Catenate SEPARATOR= failed/ ${Test Name} Copy File ${ENGINE_LOG}/config0/connector_ssh.log ${failDir} -Clean Whitelist - Clean After Suite +Ctn Clean Whitelist + Ctn Clean After Suite Remove File /etc/centreon-engine-whitelist/test diff --git a/tests/engine/forced_checks.robot b/tests/engine/forced_checks.robot index 21026230857..276089affa3 100644 --- a/tests/engine/forced_checks.robot +++ b/tests/engine/forced_checks.robot @@ -3,42 +3,42 @@ Documentation Centreon Engine forced checks tests Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** EFHC1 [Documentation] Engine is configured with hosts and we force checks on one 5 times on bbdo2 [Tags] engine external_cmd log-v2 - Config Engine ${1} + Ctn Config Engine ${1} # We force the check command of host_1 to return 2 as status. - Config Host Command Status ${0} checkh1 2 - Config Broker central - Config Broker rrd - Config Broker module ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value ${0} log_level_events info - Engine Config Set Value ${0} log_flush_period 0 - - Clear Retention - Clear Db hosts + Ctn Config Host Command Status ${0} checkh1 2 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value ${0} log_level_events info + Ctn Engine Config Set Value ${0} log_flush_period 0 + + Ctn Clear Retention + Ctn Clear Db hosts ${start} Get Current Date - Start Engine - Start Broker - ${result} Check Host Status host_1 4 1 False + Ctn Start engine + Ctn Start Broker + ${result} Ctn Check Host Status host_1 4 1 False Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Process Host Check Result host_1 0 host_1 UP + Ctn Process Host Check Result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END ${content} Create List @@ -49,39 +49,39 @@ EFHC1 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result} Check Host Status host_1 1 1 False + ${result} Ctn Check Host Status host_1 1 1 False Should Be True ${result} host_1 should be down/hard - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EFHC2 [Documentation] Engine is configured with hosts and we force check on one 5 times on bbdo2 [Tags] engine external_cmd log-v2 - Config Engine ${1} + Ctn Config Engine ${1} # We force the check command of host_1 to return 2 as status. - Config Host Command Status ${0} checkh1 2 - Config Broker central - Config Broker rrd - Config Broker module ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - - Clear Retention + Ctn Config Host Command Status ${0} checkh1 2 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + + Ctn Clear Retention ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Process Host Check Result host_1 0 host_1 UP + Ctn Process Host Check Result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END ${content} Create List @@ -92,46 +92,46 @@ EFHC2 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result} Check Host Status host_1 1 1 False + ${result} Ctn Check Host Status host_1 1 1 False Should Be True ${result} host_1 should be down/hard - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EFHCU1 [Documentation] Engine is configured with hosts and we force checks on one 5 times on bbdo3. Bbdo3 has no impact on this behavior. resources table is cleared before starting broker. [Tags] engine external_cmd - Config Engine ${1} + Ctn Config Engine ${1} # We force the check command of host_1 to return 2 as status. - Config Host Command Status ${0} checkh1 2 - Config Broker central - Config Broker rrd - Config Broker module ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Broker Config Log module0 neb debug - Config Broker Sql Output central unified_sql - Broker Config Log central sql debug - Config BBDO3 1 - - Clear Retention - Clear Db resources + Ctn Config Host Command Status ${0} checkh1 2 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Broker Config Log module0 neb debug + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Log central sql debug + Ctn Config BBDO3 1 + + Ctn Clear Retention + Ctn Clear Db resources ${start} Get Current Date - Start Engine - Start Broker - ${result} Check Host Status host_1 4 1 True + Ctn Start engine + Ctn Start Broker + ${result} Ctn Check Host Status host_1 4 1 True Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Process Host Check Result host_1 0 host_1 UP + Ctn Process Host Check Result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END ${content} Create List @@ -142,45 +142,45 @@ EFHCU1 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result} Check Host Status host_1 1 1 True + ${result} Ctn Check Host Status host_1 1 1 True Should Be True ${result} host_1 should be down/hard - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EFHCU2 [Documentation] Engine is configured with hosts and we force checks on one 5 times on bbdo3. Bbdo3 has no impact on this behavior. [Tags] engine external_cmd - Config Engine ${1} + Ctn Config Engine ${1} # We force the check command of host_1 to return 2 as status. - Config Host Command Status ${0} checkh1 2 - Config Broker central - Config Broker rrd - Config Broker module ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Broker Config Log module0 neb debug - Config Broker Sql Output central unified_sql - Broker Config Log central sql debug - Config BBDO3 1 - - Clear Retention + Ctn Config Host Command Status ${0} checkh1 2 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Broker Config Log module0 neb debug + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Log central sql debug + Ctn Config BBDO3 1 + + Ctn Clear Retention ${start} Get Current Date - Start Engine - Start Broker - ${result} Check Host Status host_1 4 1 True + Ctn Start engine + Ctn Start Broker + ${result} Ctn Check Host Status host_1 4 1 True Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Process Host Check Result host_1 0 host_1 UP + Ctn Process Host Check Result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} - Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Ctn Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END ${content} Create List @@ -191,84 +191,84 @@ EFHCU2 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result} Check Host Status host_1 1 1 True + ${result} Ctn Check Host Status host_1 1 1 True Should Be True ${result} host_1 should be down/hard - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EMACROS [Documentation] macros ADMINEMAIL and ADMINPAGER are replaced in check outputs [Tags] engine external_cmd macros - Config Engine ${1} - Config Broker central - Config Broker rrd - Config Broker module ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value 0 log_level_checks trace True - Engine Config Change Command + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value 0 log_level_checks trace True + Ctn Engine Config Change Command ... 0 ... \\d+ ... /bin/echo "ResourceFile: $RESOURCEFILE$ - LogFile: $LOGFILE$ - AdminEmail: $ADMINEMAIL$ - AdminPager: $ADMINPAGER$" - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Schedule Forced Svc Check host_1 service_1 + Ctn Schedule Forced Svc Check host_1 service_1 Sleep 5s ${content} Create List ... ResourceFile: /tmp/etc/centreon-engine/config0/resource.cfg - LogFile: /tmp/var/log/centreon-engine/config0/centengine.log - AdminEmail: titus@bidibule.com - AdminPager: admin - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} AdminEmail: titus@bidibule.com - AdminPager: admin not found in log. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EMACROS_NOTIF [Documentation] macros ADMINEMAIL and ADMINPAGER are replaced in notification commands [Tags] engine external_cmd macros - Config Engine ${1} - Config Broker central - Config Broker rrd - Config Broker module ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value 0 log_level_checks trace True - Engine Config Add Value 0 cfg_file ${EtcRoot}/centreon-engine/config0/contacts.cfg - Engine Config Add Command + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value 0 log_level_checks trace True + Ctn Engine Config Add Value 0 cfg_file ${EtcRoot}/centreon-engine/config0/contacts.cfg + Ctn Engine Config Add Command ... 0 ... command_notif ... /bin/sh -c '/bin/echo "ResourceFile: $RESOURCEFILE$ - LogFile: $LOGFILE$ - AdminEmail: $ADMINEMAIL$ - AdminPager: $ADMINPAGER$" >> /tmp/notif_toto.txt' - Engine Config Set Value In Services 0 service_1 contacts John_Doe - Engine Config Set Value In Services 0 service_1 notification_options w,c,r - Engine Config Set Value In Services 0 service_1 notifications_enabled 1 - Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif - Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif + Ctn Engine Config Set Value In Services 0 service_1 contacts John_Doe + Ctn Engine Config Set Value In Services 0 service_1 notification_options w,c,r + Ctn Engine Config Set Value In Services 0 service_1 notifications_enabled 1 + Ctn Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Ctn Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif Remove File /tmp/notif_toto.txt - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. FOR ${i} IN RANGE 3 - Process Service Check Result host_1 service_1 2 critical + Ctn Process Service Check Result host_1 service_1 2 critical END Wait Until Created /tmp/notif_toto.txt 30s @@ -277,40 +277,40 @@ EMACROS_NOTIF ... /tmp/notif_toto.txt ... ResourceFile: /tmp/etc/centreon-engine/resource.cfg - LogFile: /tmp/var/log/centreon-engine/centengine.log - AdminEmail: titus@bidibule.com - AdminPager: admin - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker EMACROS_SEMICOLON [Documentation] Macros with a semicolon are used even if they contain a semicolon. [Tags] engine external_cmd macros MON-15765 - Config Engine ${1} - Config Broker central - Config Broker rrd - Config Broker module ${1} - Engine Config Set Value ${0} log_legacy_enabled ${0} - Engine Config Set Value ${0} log_v2_enabled ${1} - Engine Config Set Value 0 log_level_checks trace True - Engine Config Set Value In Hosts 0 host_1 _KEY2 VAL1;val3; - Engine Config Change Command + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module ${1} + Ctn Engine Config Set Value ${0} log_legacy_enabled ${0} + Ctn Engine Config Set Value ${0} log_v2_enabled ${1} + Ctn Engine Config Set Value 0 log_level_checks trace True + Ctn Engine Config Set Value In Hosts 0 host_1 _KEY2 VAL1;val3; + Ctn Engine Config Change Command ... 0 ... \\d+ ... /bin/echo "KEY2=$_HOSTKEY2$" - Clear Retention + Ctn Clear Retention ${start} Get Current Date - Start Engine - Start Broker + Ctn Start engine + Ctn Start Broker ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Schedule Forced Svc Check host_1 service_1 + Ctn Schedule Forced Svc Check host_1 service_1 Sleep 5s ${content} Create List KEY2=VAL1;val3; - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} VAL1;val3; not found in log. - Stop Engine - Kindly Stop Broker + Ctn Stop engine + Ctn Kindly Stop Broker diff --git a/tests/engine/perl-connectors.robot b/tests/engine/perl-connectors.robot index b679ee185aa..cc9cd1d5e69 100644 --- a/tests/engine/perl-connectors.robot +++ b/tests/engine/perl-connectors.robot @@ -3,27 +3,27 @@ Documentation Centreon Engine test perl connectors Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** EPC1 [Documentation] Check with perl connector [Tags] engine start-stop - Config Engine ${1} - Config Broker module - Engine Config Set Value ${0} log_level_commands trace + Ctn Config Engine ${1} + Ctn Config Broker module + Ctn Engine Config Set Value ${0} log_level_commands trace ${start} Get Current Date - Start Engine + Ctn Start engine ${content} Create List connector::run: connector='Perl Connector' - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Missing a message talking about 'Perl Connector' ${content} Create List connector::data_is_available - ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 20 + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 20 Should Be True ${result} Missing a message telling data is available from the Perl connector - Stop Engine + Ctn Stop engine diff --git a/tests/engine/start-stop.robot b/tests/engine/start-stop.robot index b9ec2acf737..a0a76b034b0 100644 --- a/tests/engine/start-stop.robot +++ b/tests/engine/start-stop.robot @@ -3,44 +3,44 @@ Documentation Centreon Engine only start/stop tests Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** ESS1 [Documentation] Start-Stop (0s between start/stop) 5 times one instance of engine and no coredump [Tags] engine start-stop - Config Engine ${1} - Config Broker module - Repeat Keyword 5 times Start Stop Instances 0 + Ctn Config Engine ${1} + Ctn Config Broker module + Repeat Keyword 5 times Ctn Start Stop Instances 0 ESS2 [Documentation] Start-Stop (300ms between start/stop) 5 times one instance of engine and no coredump [Tags] engine start-stop - Config Engine ${1} - Config Broker module - Repeat Keyword 5 times Start Stop Instances 300ms + Ctn Config Engine ${1} + Ctn Config Broker module + Repeat Keyword 5 times Ctn Start Stop Instances 300ms ESS3 [Documentation] Start-Stop (0s between start/stop) 5 times three instances of engine and no coredump [Tags] engine start-stop - Config Engine ${3} - Config Broker module ${3} - Repeat Keyword 5 times Start Stop Instances 300ms + Ctn Config Engine ${3} + Ctn Config Broker module ${3} + Repeat Keyword 5 times Ctn Start Stop Instances 300ms ESS4 [Documentation] Start-Stop (300ms between start/stop) 5 times three instances of engine and no coredump [Tags] engine start-stop - Config Engine ${3} - Config Broker module ${3} - Repeat Keyword 5 times Start Stop Instances 300ms + Ctn Config Engine ${3} + Ctn Config Broker module ${3} + Repeat Keyword 5 times Ctn Start Stop Instances 300ms *** Keywords *** -Start Stop Instances +Ctn Start Stop Instances [Arguments] ${interval} - Start Engine + Ctn Start engine Sleep ${interval} - Stop Engine + Ctn Stop engine diff --git a/tests/migration/migration.robot b/tests/migration/migration.robot index 3b408687f32..b2b39f2fd3f 100644 --- a/tests/migration/migration.robot +++ b/tests/migration/migration.robot @@ -3,9 +3,9 @@ Documentation Centreon Broker and Engine are configured in bbdo2 with sql/ Resource ../resources/import.resource -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes *** Test Cases *** @@ -14,93 +14,93 @@ MIGRATION [Tags] broker engine services protobuf Log To Console Pure legacy mode - Config Engine ${3} ${50} ${20} - Config Broker rrd - Config Broker central - Config Broker module ${3} - Broker Config Log central sql debug - Broker Config Log central core error - Broker Config Log rrd rrd trace - Clear Retention + Ctn Config Engine ${3} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${3} + Ctn Broker Config Log central sql debug + Ctn Broker Config Log central core error + Ctn Broker Config Log rrd rrd trace + Ctn Clear Retention ${start} Get Current Date - Start Broker - Start Engine + Ctn Start Broker + Ctn Start engine ${contentCentral} Create List SQL: processing service status event - ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 Should Be True ${result} No service status processed by the sql output for 60s ${contentRRD} Create List RRD: output::write - ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 60 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 60 Should Be True ${result} No metric sent to rrd cbd for 30s - Config Broker Sql Output central unified_sql + Ctn Config Broker Sql Output central unified_sql ${start} Get Current Date Log To Console Move to BBDO 2.0.0 with unified_sql - Kindly Stop Broker - Start Broker - Stop Engine - Start Engine + Ctn Kindly Stop Broker + Ctn Start Broker + Ctn Stop engine + Ctn Start engine Sleep 2s ${contentCentral} Create List SQL: processing service status event - ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 Should Be True ${result} No service status processed by the unified_sql output for 60s ${contentRRD} Create List RRD: output::write - ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 Should Be True ${result} No metric sent to rrd cbd by unified_sql for 30s - Config BBDO3 3 + Ctn Config BBDO3 3 ${start} Get Current Date Log To Console Move to BBDO 3.0.0 with unified_sql - Kindly Stop Broker - Start Broker - Stop Engine - Start Engine + Ctn Kindly Stop Broker + Ctn Start Broker + Ctn Stop engine + Ctn Start engine Sleep 2s ${contentCentral} Create List status check result output: - ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 Should Be True ${result} No pb service status processed by the unified_sql output with BBDO3 for 60s ${contentRRD} Create List RRD: output::write - ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 Should Be True ${result} No metric sent to rrd cbd by unified_sql for 30s - Broker Config Remove Item module0 bbdo_version - Broker Config Remove Item module1 bbdo_version - Broker Config Remove Item module2 bbdo_version - Broker Config Remove Item central bbdo_version - Broker Config Remove Item rrd bbdo_version + Ctn Broker Config Remove Item module0 bbdo_version + Ctn Broker Config Remove Item module1 bbdo_version + Ctn Broker Config Remove Item module2 bbdo_version + Ctn Broker Config Remove Item central bbdo_version + Ctn Broker Config Remove Item rrd bbdo_version ${start} Get Current Date Log To Console Move back to BBDO 2.0.0 with unified_sql - Kindly Stop Broker - Start Broker - Stop Engine - Start Engine + Ctn Kindly Stop Broker + Ctn Start Broker + Ctn Stop engine + Ctn Start engine Sleep 2s ${contentCentral} Create List SQL: processing service status event - ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 Should Be True ${result} No service status processed by the unified_sql output for 60s ${contentRRD} Create List RRD: output::write - ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 Should Be True ${result} No metric sent to rrd cbd by unified_sql for 30s Log To Console Move back to BBDO 2.0.0 with sql/storage - Config Broker Sql Output central sql/perfdata - Kindly Stop Broker - Start Broker - Stop Engine - Start Engine + Ctn Config Broker Sql Output central sql/perfdata + Ctn Kindly Stop Broker + Ctn Start Broker + Ctn Stop engine + Ctn Start engine Sleep 2s ${contentCentral} Create List SQL: processing service status event - ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 Should Be True ${result} No service status processed by the sql output for 200s ${contentRRD} Create List RRD: output::write - ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 + ${result} Ctn Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 Should Be True ${result} No metric sent to rrd cbd for 30s - [Teardown] Stop Engine Broker And Save Logs + [Teardown] Ctn Stop Engine Broker And Save Logs diff --git a/tests/resources/Bench.py b/tests/resources/Bench.py index c4a12d35220..96a9ece707b 100644 --- a/tests/resources/Bench.py +++ b/tests/resources/Bench.py @@ -12,8 +12,8 @@ from cpuinfo import get_cpu_info from robot.api import logger from dateutil import parser as date_parser -from Common import get_collect_version -from Common import is_using_direct_grpc +from Common import ctn_get_collect_version +from Common import ctn_is_using_direct_grpc class delta_process_stat: @@ -50,16 +50,16 @@ def sub_duration(self, duration_left, duration_right): return ret -def diff_process_stat(process_stat1, process_stat2): +def ctn_diff_process_stat(process_stat1, process_stat2): return delta_process_stat(process_stat1, process_stat2) -def add_value_to_delta_process_stat(delta, key, value): +def ctn_add_value_to_delta_process_stat(delta, key, value): """! add an attribute to an object""" setattr(delta, key, value) -def get_last_bench_result(log: str, id: int, name_to_find: str): +def ctn_get_last_bench_result(log: str, id: int, name_to_find: str): """! extract last bench trace in broker log file @log path of the log file @param id id field of the bench event @@ -87,7 +87,7 @@ def get_last_bench_result(log: str, id: int, name_to_find: str): return None -def get_last_bench_result_with_timeout(log: str, id: int, name_to_find: str, timeout: int): +def ctn_get_last_bench_result_with_timeout(log: str, id: int, name_to_find: str, timeout: int): """! extract last bench trace in broker log file @log path of the log file @param id id field of the bench event @@ -97,7 +97,7 @@ def get_last_bench_result_with_timeout(log: str, id: int, name_to_find: str, tim """ limit = time.time() + timeout while time.time() < limit: - json_obj = get_last_bench_result(log, id, name_to_find) + json_obj = ctn_get_last_bench_result(log, id, name_to_find) if json_obj is not None: return json_obj time.sleep(5) @@ -105,7 +105,7 @@ def get_last_bench_result_with_timeout(log: str, id: int, name_to_find: str, tim return None -def calc_bench_delay(bench_event_result, bench_muxer_begin: str, bench_muxer_begin_function: str, bench_muxer_end: str, bench_muxer_end_function: str): +def ctn_calc_bench_delay(bench_event_result, bench_muxer_begin: str, bench_muxer_begin_function: str, bench_muxer_end: str, bench_muxer_end_function: str): """! calc a duration between two time points of a bench event json object @param bench_event_result bench result json object @param bench_muxer_begin name of the muxer owned to the first time point (accepts regexp) @@ -125,7 +125,7 @@ def calc_bench_delay(bench_event_result, bench_muxer_begin: str, bench_muxer_beg return time_end - time_begin -def store_result_in_unqlite(file_path: str, test_name: str, broker_or_engine: str, resources_consumed: delta_process_stat, end_process_stat, bench_event_result, bench_muxer_begin: str, bench_muxer_begin_function: str, bench_muxer_end: str, bench_muxer_end_function: str, other_bench_data: dict = None): +def ctn_store_result_in_unqlite(file_path: str, test_name: str, broker_or_engine: str, resources_consumed: delta_process_stat, end_process_stat, bench_event_result, bench_muxer_begin: str, bench_muxer_begin_function: str, bench_muxer_end: str, bench_muxer_end_function: str, other_bench_data: dict = None): """! store a bench result and process stat difference in an unqlite file it also stores git information @param file_path path of the unqlite file @@ -155,14 +155,14 @@ def store_result_in_unqlite(file_path: str, test_name: str, broker_or_engine: s row['nb_core'] = info["count"] row['memory_size'] = psutil.virtual_memory().total row['memory_used'] = end_process_stat.vm_size - row['event_propagation_delay'] = calc_bench_delay( + row['event_propagation_delay'] = ctn_calc_bench_delay( bench_event_result, bench_muxer_begin, bench_muxer_begin_function, bench_muxer_end, bench_muxer_end_function).total_seconds() if other_bench_data is not None: for key, value in other_bench_data.items(): row[key] = value - version = get_collect_version() + version = ctn_get_collect_version() version = version[0:version.rfind(".")] + ".x" row['origin'] = version @@ -180,7 +180,7 @@ def store_result_in_unqlite(file_path: str, test_name: str, broker_or_engine: s row['commit'] = repo.head.commit.hexsha row['t'] = time.time() row['branch'] = repo.head.name - if is_using_direct_grpc(): + if ctn_is_using_direct_grpc(): test_name += "_grpc" db = UnQLite(file_path) benchs = db.collection( @@ -192,7 +192,7 @@ def store_result_in_unqlite(file_path: str, test_name: str, broker_or_engine: s return True -def upload_database_to_s3(file_path: str): +def ctn_upload_database_to_s3(file_path: str): """! upload a file to s3 @param file_path path of the file on the disk """ @@ -213,7 +213,7 @@ def upload_database_to_s3(file_path: str): return False -def download_database_from_s3(file_path: str): +def ctn_download_database_from_s3(file_path: str): """! upload a file to s3 @param file_path path of the file on the disk @bucket s3 bucket diff --git a/tests/resources/Broker.py b/tests/resources/Broker.py index 12f1143316b..8626ae3b3de 100755 --- a/tests/resources/Broker.py +++ b/tests/resources/Broker.py @@ -404,7 +404,7 @@ def _apply_conf(name, callback): f.write(json.dumps(conf, indent=2)) -def config_broker(name: str, poller_inst: int = 1): +def ctn_config_broker(name: str, poller_inst: int = 1): """ Configure a broker instance for test. Write the configuration files. @@ -456,10 +456,10 @@ def config_broker(name: str, poller_inst: int = 1): with open(broker_name, "w") as f: f.write(json.dumps(conf, indent=2)) if default_bbdo_version is not None: - broker_config_add_item( + ctn_broker_config_add_item( f"{name}{i}", "bbdo_version", default_bbdo_version) if default_transport == "grpc": - config_broker_bbdo_output( + ctn_config_broker_bbdo_output( f"{name}{i}", "bbdo_client", "5669", "grpc", "localhost") else: @@ -468,21 +468,21 @@ def config_broker(name: str, poller_inst: int = 1): DB_HOST, DB_PORT, DB_USER, DB_PASS, DB_NAME_STORAGE, VAR_ROOT)) if default_bbdo_version is not None: if default_bbdo_version >= "3.0.0" and (name == "central" or name == "central_map"): - config_broker_sql_output(name, 'unified_sql') - broker_config_add_item( + ctn_config_broker_sql_output(name, 'unified_sql') + ctn_broker_config_add_item( name, "bbdo_version", default_bbdo_version) if default_transport == "grpc": if name == "central" or name == "central_map": - config_broker_bbdo_input( + ctn_config_broker_bbdo_input( name, "bbdo_server", "5669", "grpc") - config_broker_bbdo_output( + ctn_config_broker_bbdo_output( name, "bbdo_client", "5670", "grpc", "localhost") else: - config_broker_bbdo_input( + ctn_config_broker_bbdo_input( name, "bbdo_server", "5670", "grpc") -def change_broker_tcp_output_to_grpc(name: str): +def ctn_change_broker_tcp_output_to_grpc(name: str): """ Update broker configuration to use a gRPC output instead of a TCP one. @@ -500,7 +500,7 @@ def output_to_grpc(conf): _apply_conf(name, output_to_grpc) -def add_path_to_rrd_output(name: str, path: str): +def ctn_add_path_to_rrd_output(name: str, path: str): """ Set the path for the rrd output. If no rrd output is defined, this function does nothing. @@ -518,7 +518,7 @@ def rrd_output(conf): _apply_conf(name, rrd_output) -def change_broker_tcp_input_to_grpc(name: str): +def ctn_change_broker_tcp_input_to_grpc(name: str): """ Update the broker configuration to use gRPC input instead of a TCP one. If no tcp input is found, no replacement is done. @@ -546,7 +546,7 @@ def _add_broker_crypto(json_dict, add_cert: bool, only_ca_cert: bool): json_dict["private_key"] = "/tmp/server_1234.key" -def add_broker_tcp_input_grpc_crypto(name: str, add_cert: bool, reversed: bool): +def ctn_add_broker_tcp_input_grpc_crypto(name: str, add_cert: bool, reversed: bool): """ Add some crypto to broker gRPC input. @@ -568,7 +568,7 @@ def _crypto_modifier(conf): _apply_conf(name, _crypto_modifier) -def add_broker_tcp_output_grpc_crypto(name: str, add_cert: bool, reversed: bool): +def ctn_add_broker_tcp_output_grpc_crypto(name: str, add_cert: bool, reversed: bool): """ Add grpc crypto to broker tcp output @@ -590,7 +590,7 @@ def _crypto_modifier(conf): _apply_conf(name, _crypto_modifier) -def add_host_to_broker_output(name: str, output_name: str, host_ip: str): +def ctn_add_host_to_broker_output(name: str, output_name: str, host_ip: str): """ Add a host to some broker output. This is useful for a grpc or tcp client where we want where to connect to. @@ -613,7 +613,7 @@ def modifier(conf): _apply_conf(name, modifier) -def add_host_to_broker_input(name: str, input_name: str, host_ip: str): +def ctn_add_host_to_broker_input(name: str, input_name: str, host_ip: str): """ Add host to some broker input. This is useful for a grpc or tcp client where we want to set where to connect to. @@ -636,7 +636,7 @@ def modifier(conf): _apply_conf(name, modifier) -def remove_host_from_broker_output(name: str, output_name: str): +def ctn_remove_host_from_broker_output(name: str, output_name: str): """ Remove the host entry from a broker output given by its name. @@ -658,7 +658,7 @@ def modifier(conf): _apply_conf(name, modifier) -def remove_host_from_broker_input(name: str, input_name: str): +def ctn_remove_host_from_broker_input(name: str, input_name: str): """ Remove the host entry from a broker input given by its name. @@ -680,7 +680,7 @@ def modifier(conf): _apply_conf(name, modifier) -def change_broker_compression_output(config_name: str, output_name: str, compression_value: str): +def ctn_change_broker_compression_output(config_name: str, output_name: str, compression_value: str): """ Change the compression option of a broker output. @@ -702,7 +702,7 @@ def compression_modifier(conf): _apply_conf(config_name, compression_modifier) -def change_broker_compression_input(config_name: str, input_name: str, compression_value: str): +def ctn_change_broker_compression_input(config_name: str, input_name: str, compression_value: str): """ Change the compression option of a broker input. @@ -724,7 +724,7 @@ def compression_modifier(conf): _apply_conf(config_name, compression_modifier) -def config_broker_remove_rrd_output(name): +def ctn_config_broker_remove_rrd_output(name): """ Remove rrd output from a broker configuration @@ -755,7 +755,7 @@ def config_broker_remove_rrd_output(name): f.write(json.dumps(conf, indent=2)) -def config_broker_bbdo_input(name, stream, port, proto, host=None): +def ctn_config_broker_bbdo_input(name, stream, port, proto, host=None): """ Configure Broker BBDO input. It can be a client or a server. We provide a port number and a protocol that is grpc or tcp. @@ -809,7 +809,7 @@ def config_broker_bbdo_input(name, stream, port, proto, host=None): f.write(json.dumps(conf, indent=2)) -def config_broker_bbdo_output(name, stream, port, proto, host=None): +def ctn_config_broker_bbdo_output(name, stream, port, proto, host=None): """ Configure Broker BBDO output. It can be a client or a server. We provide a port number and a protocol that is grpc or tcp. @@ -828,7 +828,7 @@ def config_broker_bbdo_output(name, stream, port, proto, host=None): """ if stream != "bbdo_server" and stream != "bbdo_client": raise Exception( - "config_broker_bbdo_output() function only accepts stream in ('bbdo_server', 'bbdo_client')") + "ctn_config_broker_bbdo_output() function only accepts stream in ('bbdo_server', 'bbdo_client')") if stream == "bbdo_client" and host is None: raise Exception("A bbdo_client must specify a host to connect to") @@ -863,7 +863,7 @@ def config_broker_bbdo_output(name, stream, port, proto, host=None): f.write(json.dumps(conf, indent=2)) -def config_broker_sql_output(name, output, queries_per_transaction: int = 20000): +def ctn_config_broker_sql_output(name, output, queries_per_transaction: int = 20000): """ Configure the broker sql output. @@ -948,7 +948,7 @@ def config_broker_sql_output(name, output, queries_per_transaction: int = 20000) f.write(json.dumps(conf, indent=2)) -def broker_config_clear_outputs_except(name, ex: list): +def ctn_broker_config_clear_outputs_except(name, ex: list): """ Remove all the outputs of the broker configuration except those of types given in the ex list. @@ -980,7 +980,7 @@ def broker_config_clear_outputs_except(name, ex: list): f.write(json.dumps(conf, indent=2)) -def config_broker_victoria_output(): +def ctn_config_broker_victoria_output(): """ Configure broker to add a Victoria output. If some old VictoriaMetrics outputs exist, they are removed. @@ -1011,7 +1011,7 @@ def config_broker_victoria_output(): f.write(json.dumps(conf, indent=2)) -def broker_config_add_item(name, key, value): +def ctn_broker_config_add_item(name, key, value): """ Add an item to the broker configuration @@ -1039,7 +1039,7 @@ def broker_config_add_item(name, key, value): f.write(json.dumps(conf, indent=2)) -def broker_config_remove_item(name, key): +def ctn_broker_config_remove_item(name, key): """ Remove an item from the broker configuration @@ -1066,7 +1066,7 @@ def broker_config_remove_item(name, key): f.write(json.dumps(conf, indent=2)) -def broker_config_add_lua_output(name, output, luafile): +def ctn_broker_config_add_lua_output(name, output, luafile): """ Add a lua output to the broker configuration. @@ -1099,7 +1099,7 @@ def broker_config_add_lua_output(name, output, luafile): f.write(json.dumps(conf, indent=2)) -def broker_config_output_set(name, output, key, value): +def ctn_broker_config_output_set(name, output, key, value): """ Set an attribute value in a broker output. @@ -1129,7 +1129,7 @@ def broker_config_output_set(name, output, key, value): f.write(json.dumps(conf, indent=2)) -def broker_config_output_set_json(name, output, key, value): +def ctn_broker_config_output_set_json(name, output, key, value): """ Set an attribute value in a broker output. The value is given as a json string. @@ -1160,7 +1160,7 @@ def broker_config_output_set_json(name, output, key, value): f.write(json.dumps(conf, indent=2)) -def broker_config_output_remove(name, output, key): +def ctn_broker_config_output_remove(name, output, key): """ Remove a key from an output of the broker configuration. @@ -1193,7 +1193,7 @@ def broker_config_output_remove(name, output, key): f.write(json.dumps(conf, indent=2)) -def broker_config_input_set(name, inp, key, value): +def ctn_broker_config_input_set(name, inp, key, value): """ Set an attribute in an input of a broker configuration. @@ -1226,7 +1226,7 @@ def broker_config_input_set(name, inp, key, value): f.write(json.dumps(conf, indent=2)) -def broker_config_input_remove(name, inp, key): +def ctn_broker_config_input_remove(name, inp, key): """ Remove a key from an input of the broker configuration. @@ -1252,7 +1252,7 @@ def broker_config_input_remove(name, inp, key): f.write(json.dumps(conf, indent=2)) -def broker_config_log(name, key, value): +def ctn_broker_config_log(name, key, value): """ Configure broker log level. @@ -1280,7 +1280,7 @@ def broker_config_log(name, key, value): f.write(json.dumps(conf, indent=2)) -def broker_config_flush_log(name, value): +def ctn_broker_config_flush_log(name, value): """ Configure the flush interval of the broker loggers. This value is in seconds, with 0, every logs are flushed. @@ -1307,7 +1307,7 @@ def broker_config_flush_log(name, value): f.write(json.dumps(conf, indent=2)) -def broker_config_source_log(name, value): +def ctn_broker_config_source_log(name, value): """ Configure if logs should contain the source file and its line number. @@ -1334,7 +1334,7 @@ def broker_config_source_log(name, value): f.write(json.dumps(conf, indent=2)) -def check_broker_stats_exist(name, key1, key2, timeout=TIMEOUT): +def ctn_check_broker_stats_exist(name, key1, key2, timeout=TIMEOUT): """ Return True if the Broker stats file contain keys pair (key1,key2). key2 must be a daughter key of key1. @@ -1377,7 +1377,7 @@ def check_broker_stats_exist(name, key1, key2, timeout=TIMEOUT): return False -def get_broker_stats_size(name, key, timeout=TIMEOUT): +def ctn_get_broker_stats_size(name, key, timeout=TIMEOUT): """ Return the number of items under the given key in the stats file. @@ -1421,7 +1421,7 @@ def get_broker_stats_size(name, key, timeout=TIMEOUT): return retval -def get_broker_stats(name: str, expected: str, timeout: int, *keys): +def ctn_get_broker_stats(name: str, expected: str, timeout: int, *keys): """ Read a value from the broker stats file following the given keys. If the value is the expected one, return True. @@ -1473,7 +1473,7 @@ def json_get(json_dict, keys: tuple, index: int): return False -def get_not_existing_indexes(count: int): +def ctn_get_not_existing_indexes(count: int): """ Gets count indexes that does not exist in the centreon_storage.index_data table. @@ -1518,7 +1518,7 @@ def get_not_existing_indexes(count: int): return ids_db -def get_indexes_to_delete(count: int): +def ctn_get_indexes_to_delete(count: int): """ Gets count indexes from centreon_storage.index_data that really exist. @@ -1564,7 +1564,7 @@ def get_indexes_to_delete(count: int): return retval -def delete_all_rrd_metrics(): +def ctn_delete_all_rrd_metrics(): """ Remove all rrd metrics files. """ @@ -1574,7 +1574,7 @@ def delete_all_rrd_metrics(): os.remove(entry.path) -def check_rrd_info(metric_id: int, key: str, value, timeout: int = 60): +def ctn_check_rrd_info(metric_id: int, key: str, value, timeout: int = 60): """ Execute rrdtool info and check one value of the returned informations @@ -1603,7 +1603,7 @@ def check_rrd_info(metric_id: int, key: str, value, timeout: int = 60): return False -def get_metrics_for_service(service_id: int, metric_name: str = "%", timeout: int = 60): +def ctn_get_metrics_for_service(service_id: int, metric_name: str = "%", timeout: int = 60): """ Try to get the metric IDs of a service. @@ -1647,7 +1647,7 @@ def get_metrics_for_service(service_id: int, metric_name: str = "%", timeout: in return None -def get_not_existing_metrics(count: int): +def ctn_get_not_existing_metrics(count: int): """ Return a list of metrics that does not exist. @@ -1691,7 +1691,7 @@ def get_not_existing_metrics(count: int): return retval -def get_metrics_to_delete(count: int): +def ctn_get_metrics_to_delete(count: int): """ Get count metrics from availables ones. @@ -1725,7 +1725,7 @@ def get_metrics_to_delete(count: int): return inter[:count] -def create_metrics(count: int): +def ctn_create_metrics(count: int): """ Create count metrics from available ones. @@ -1774,7 +1774,7 @@ def create_metrics(count: int): connection.commit() -def run_reverse_bam(duration, interval): +def ctn_run_reverse_bam(duration, interval): """ Launch the map_client.py script that simulates map. @@ -1789,7 +1789,7 @@ def run_reverse_bam(duration, interval): os.killpg(os.getpgid(pro.pid), signal.SIGKILL) -def start_map(): +def ctn_start_map(): """ Launch the map_client_types.py script that simulates map. """ @@ -1798,7 +1798,7 @@ def start_map(): shell=True, stdout=subp.DEVNULL, stdin=subp.DEVNULL) -def clear_map_logs(): +def ctn_clear_map_logs(): """ Reset the content of the /tmp/map-output.log file. """ @@ -1806,7 +1806,7 @@ def clear_map_logs(): f.write("") -def check_map_output(categories_str, expected_events, timeout: int = TIMEOUT): +def ctn_check_map_output(categories_str, expected_events, timeout: int = TIMEOUT): """ Check the content of the /tmp/map-output.log file. This file contains informations on categories/elements of each received event. A list of categories and event types are given to this function, so it can check if the file @@ -1865,7 +1865,7 @@ def check_map_output(categories_str, expected_events, timeout: int = TIMEOUT): return retval -def get_map_output(): +def ctn_get_map_output(): """ The map_client_types.py script writes on STDOUT. This function allows to get this output. @@ -1876,7 +1876,7 @@ def get_map_output(): return map_process.communicate()[0] -def stop_map(): +def ctn_stop_map(): """ Stop the script simulating map. Works with map_client_type. """ @@ -1901,7 +1901,7 @@ def stop_map(): logger.console("map_client_type stopped") -def get_indexes_to_rebuild(count: int, nb_day=180): +def ctn_get_indexes_to_rebuild(count: int, nb_day=180): """ Get count indexes that are available to rebuild. @@ -1958,7 +1958,7 @@ def get_indexes_to_rebuild(count: int, nb_day=180): return retval -def add_duplicate_metrics(): +def ctn_add_duplicate_metrics(): """ Add a value at the middle of the first day of each metric @@ -1988,12 +1988,12 @@ def add_duplicate_metrics(): return retval -def check_for_NaN_metric(add_duplicate_metrics_ret): +def ctn_check_for_NaN_metric(add_duplicate_metrics_ret): """ Check that metrics are not a NaN during one day Args: - add_duplicate_metrics_ret (): an array of pair