diff --git a/.github/actions/delivery/action.yml b/.github/actions/delivery/action.yml index c49c92126a9..ae50e008a75 100644 --- a/.github/actions/delivery/action.yml +++ b/.github/actions/delivery/action.yml @@ -19,6 +19,12 @@ inputs: stability: description: "The package stability (stable, testing, unstable)" required: true + release_type: + description: "Type of release (hotfix, release)" + required: true + release_cloud: + description: "Release context (cloud or not cloud)" + required: true runs: using: "composite" @@ -49,6 +55,8 @@ runs: - if: ${{ startsWith(inputs.distrib, 'el') }} name: Publish RPMs run: | + set -eux + FILES="*.${{ env.extfile }}" echo "[DEBUG] - Version: ${{ inputs.version }}" @@ -64,8 +72,17 @@ runs: exit 1 fi + # DEBUG + echo "[DEBUG] - Version: ${{ inputs.version }}" + echo "[DEBUG] - Distrib: ${{ inputs.distrib }}" + echo "[DEBUG] - module_name: ${{ inputs.module_name }}" + echo "[DEBUG] - release_cloud: ${{ inputs.release_cloud }}" + echo "[DEBUG] - release_type: ${{ inputs.release_type }}" + + # Create ARCH dirs mkdir noarch x86_64 + # Get ARCH target for files to deliver and regroupe them by ARCH for FILE in $FILES; do echo "[DEBUG] - File: $FILE" @@ -76,13 +93,30 @@ runs: mv "$FILE" "$ARCH" done - for ROOT_REPO_PATH in "rpm-standard" "rpm-standard-internal"; do + # Build upload target path based on release_cloud and release_type values + # if cloud, deliver to testing- + # if non-cloud, delivery to testing as usual + # CLOUD + HOTFIX + REPO STANDARD INTERNAL OR CLOUD + RELEASE + REPO STANDARD INTERNAL + if [[ ${{ inputs.release_cloud }} -eq 1 && ${{ inputs.release_type }} == "hotfix" ]] || [[ ${{ inputs.release_cloud }} -eq 1 && ${{ inputs.release_type }} == "release" ]]; then + ROOT_REPO_PATHS="rpm-standard-internal" + UPLOAD_REPO_PATH="${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}-${{ inputs.release_type }}/$ARCH/RPMS/${{ inputs.module_name }}/" + # NON-CLOUD + (HOTFIX OR RELEASE) + REPO STANDARD + elif [[ ${{ inputs.release_cloud }} -eq 0 ]]; then + ROOT_REPO_PATHS="rpm-standard" + UPLOAD_REPO_PATH="${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" + else + echo "Invalid combination of release_type and release_cloud" + exit 1 + fi + + # Deliver based on inputs + for ROOT_REPO_PATH in "$ROOT_REPO_PATHS"; do for ARCH in "noarch" "x86_64"; do if [ "$(ls -A $ARCH)" ]; then if [ "${{ inputs.stability }}" == "stable" ]; then - jf rt upload "$ARCH/*.rpm" "$ROOT_REPO_PATH/${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/" --flat + echo "[DEBUG] - Stability is ${{ inputs.stability }}, not delivering." else - jf rt upload "$ARCH/*.rpm" "$ROOT_REPO_PATH/${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --sync-deletes="$ROOT_REPO_PATH/${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --flat + jf rt upload "$ARCH/*.rpm" "$ROOT_REPO_PATH/$UPLOAD_REPO_PATH" --sync-deletes="$ROOT_REPO_PATH/$UPLOAD_REPO_PATH" --flat fi fi done diff --git a/.github/actions/promote-to-stable/action.yml b/.github/actions/promote-to-stable/action.yml index 7cde8de7240..7d953df3807 100644 --- a/.github/actions/promote-to-stable/action.yml +++ b/.github/actions/promote-to-stable/action.yml @@ -22,11 +22,20 @@ inputs: repository_name: description: "The repository name" required: true + github_ref_name: + description: "Release base ref name for push event" + required: true + release_type: + description: "Type of release (hotfix, release)" + required: true + release_cloud: + description: "Release context (cloud or not cloud)" + required: true runs: using: "composite" steps: - - uses: jfrog/setup-jfrog-cli@901bb9632db90821c2d3f076012bdeaf66598555 # v3.4.1 + - uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0 env: JF_URL: https://centreon.jfrog.io JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }} @@ -34,14 +43,40 @@ runs: - name: Promote RPM packages to stable if: ${{ startsWith(inputs.distrib, 'el') }} run: | - set -x + set -eux + + # DEBUG echo "[DEBUG] - Major version: ${{ inputs.major_version }}" echo "[DEBUG] - Minor version: ${{ inputs.minor_version }}" echo "[DEBUG] - Distrib: ${{ inputs.distrib }}" + echo "[DEBUG] - release_cloud: ${{ inputs.release_cloud }}" + echo "[DEBUG] - release_type: ${{ inputs.release_type }}" + # Cloud specific promote + # delivery by default to onprem, override to internal if base branch is master + if [[ ${{ inputs.github_base_ref }} == "master" ]]; then + ROOT_REPO_PATH="rpm-standard-internal" + else + ROOT_REPO_PATH="rpm-standard" + fi + + # Search for testing packages candidate for promote for ARCH in "noarch" "x86_64"; do - echo "[DEBUG] - Get artifactory path of $ARCH testing artifacts to promote to stable." - SRC_PATHS=$(jf rt s --include-dirs rpm-standard/${{ inputs.major_version }}/${{ inputs.distrib }}/testing/$ARCH/${{ inputs.module_name }}/*.rpm | jq -r '.[].path') + + # Build search path based on release_cloud and release_type values + # if cloud, search in testing- path + # if non-cloud, search in the testing usual path + if [[ ${{ inputs.release_cloud }} -eq 1 && ${{ inputs.release_type }} == "hotfix" ]] || [[ ${{ inputs.release_cloud }} -eq 1 && ${{ inputs.release_type }} == "release" ]]; then + SEARCH_REPO_PATH="${{ inputs.major_version }}/${{ inputs.distrib }}/testing-${{ inputs.release_type }}/$ARCH/${{ inputs.module_name }}" + elif [[ ${{ inputs.release_cloud }} -eq 0 ]]; then + SEARCH_REPO_PATH="${{ inputs.major_version }}/${{ inputs.distrib }}/testing/$ARCH/${{ inputs.module_name }}" + else + echo "Invalid combination of release_type and release_cloud" + fi + + echo "[DEBUG] - Get path of $ARCH testing artifacts to promote to stable." + SRC_PATHS=$(jf rt search --include-dirs $ROOT_REPO_PATH/$SEARCH_REPO_PATH/*.rpm | jq -r '.[].path') + if [[ ${SRC_PATHS[@]} ]]; then for SRC_PATH in ${SRC_PATHS[@]}; do echo "[DEBUG] - Source path found: $SRC_PATH" @@ -50,12 +85,13 @@ runs: echo "[DEBUG] - No source path found." continue fi - echo "[DEBUG] - Build $ARCH artifactory target path." - TARGET_PATH="rpm-standard/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/" + + # Build target path based on ARCH + echo "[DEBUG] - Build $ARCH target path." + TARGET_PATH="$ROOT_REPO_PATH/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/" echo "[DEBUG] - Target path: $TARGET_PATH" - echo "[INFO] - Build INTERNAL $ARCH target path." - TARGET_PATH_INTERNAL="rpm-standard-internal/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/" - echo "[INFO] - Target internal path: $TARGET_PATH_INTERNAL" + + # Download candidates for promote echo "[DEBUG] - Promoting $ARCH testing artifacts to stable." for ARTIFACT in ${SRC_PATHS[@]}; do echo "[DEBUG] - Promoting $ARTIFACT to stable on artifactory." @@ -63,12 +99,17 @@ runs: echo "[DEBUG] - Downloading $ARTIFACT from TESTING." jf rt download $ARTIFACT --flat done + + # Upload previously downloaded candidates to TARGET_PATH for ARTIFACT_DL in $(dir|grep -E "*.rpm"); do echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH." jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --flat done + + # Cleanup before next round of candidates rm -f *.rpm done + shell: bash - name: Promote DEB packages to stable @@ -103,8 +144,9 @@ runs: for ARTIFACT_DL in $(dir|grep -E "*.deb"); do ARCH=$(echo $ARTIFACT_DL | cut -d '_' -f3 | cut -d '.' -f1) echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH." - jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "${{ inputs.distrib }}/main/$ARCH" + jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "${{ inputs.distrib }}/main/$ARCH" --flat done rm -f *.deb + shell: bash diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml index c1da256ea6f..3b1f84a66cf 100644 --- a/.github/actions/release/action.yml +++ b/.github/actions/release/action.yml @@ -1,6 +1,9 @@ -name: "tag version" -description: "Tag package" +name: "release action" +description: "Create git release tags, github releases, jira version and push release communication." inputs: + github_ref_name: + description: "Github ref name" + required: true jira_api_token: description: "Token to authenticate to Jira" required: true @@ -10,6 +13,9 @@ inputs: jira_project_id: description: "Jira project id to create release" required: true + jira_webhook_url: + description: "Jira release webhook" + required: true jira_base_url: description: "Jira base url" required: true @@ -17,50 +23,226 @@ inputs: runs: using: "composite" steps: - - name: Publish RPMS to Repositories + - name: Checkout sources + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Get released versions for components run: | - NEW_VERSION="" - MAJOR_VERSION=$(echo $GITHUB_REF_NAME | grep -oP '([0-9]{2}\.[0-9]{2})') - echo "Major version: $MAJOR_VERSION" - HOTFIX=$(echo $GITHUB_REF_NAME | grep -oP '(hotfix|)') - echo "Hotfix: $HOTFIX" - BETA=$(echo $GITHUB_REF_NAME | grep -oP '(beta|)') - echo "Beta: $BETA" - RELEASE_ID=$(git log -1 --pretty=%B | grep -oP '(#[0-9]{4,}#)' | grep -oP '([0-9]+)') - echo "Release Id: $RELEASE_ID" - - OLDV=$(git tag --sort=-v:refname --list "centreon-collect-$MAJOR_VERSION.*" | head -n 1) - echo "Old version: $OLDV" + set -eux - git config --global user.email "release@centreon.com" - git config --global user.name "Centreon" + # Variables + COMPONENTS_COLLECT=("centreon-collect") + CURRENT_STABLE_BRANCH_MAJOR_VERSION="" + declare -a TMP_STABLE_TAGS=() + declare -a NEW_STABLE_TAGS=() + declare -a PREVIOUS_STABLE_TAGS=() + SCOPE_VERSION="COLLECT" + MINOR_VERSION_FILE_PATH=".version" - if [ -z "$OLDV" ]; then - echo "No existing version, starting at $MAJOR_VERSION.0" - NEW_VERSION="$MAJOR_VERSION.0" - git tag -a "centreon-collect-$NEW_VERSION" -m "version $NEW_VERSION" - git push --follow-tags + # Get current stable branch name + # If MASTER, use root .version + # Else use branch name + if [[ "${{ inputs.github_ref_name }}" == "master" ]]; then + CURRENT_STABLE_BRANCH_MAJOR_VERSION=$(grep -E "MAJOR" .version | cut -d '=' -f2) else - OLD_MINOR_VERSION=$(echo $OLDV | grep -oP '([0-9]+$)') - NEW_MINOR_VERSION=$(echo $((OLD_MINOR_VERSION + 1))) - NEW_VERSION=$MAJOR_VERSION.$NEW_MINOR_VERSION - git tag -a "centreon-collect-$NEW_VERSION" -m "version $NEW_VERSION" - git push --follow-tags + CURRENT_STABLE_BRANCH_MAJOR_VERSION=$(echo ${{ inputs.github_ref_name }} | cut -d '.' -f1,2) fi + echo "Current stable branch major version: $CURRENT_STABLE_BRANCH_MAJOR_VERSION" + + # Get previous and new version tags for components + for component in ${COMPONENTS_COLLECT[@]}; do + MAJOR_VERSION=$(grep -E "MAJOR" .version | cut -d '=' -f2) + MINOR_VERSION=$(grep -E "MINOR" .version | cut -d '=' -f2) + # Previous stable tags array + PREVIOUS_STABLE_TAGS+=($(git tag -l --sort=-version:refname "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION*" | head -n 1)) + # New stable tags array + TMP_STABLE_TAGS+=("$component-$MAJOR_VERSION.$MINOR_VERSION") + done + echo "Previous releases were: ${PREVIOUS_STABLE_TAGS[*]}" + echo "Temporary new releases are: ${TMP_STABLE_TAGS[*]}" + # Building final NEW_STABLE_TAGS with the new version tags only + # Iterate over elements of TMP_STABLE_TAGS + for new_tag in "${TMP_STABLE_TAGS[@]}"; do + found=false + # Iterate over elements of PREVIOUS_STABLE_TAGS + for old_tag in "${PREVIOUS_STABLE_TAGS[@]}"; do + # Compare elements + if [ "$new_tag" == "$old_tag" ]; then + found=true + break + fi + done + # If element not found in PREVIOUS_STABLE_TAGS, add it to NEW_STABLE_TAGS + if ! $found; then + NEW_STABLE_TAGS+=("$new_tag") + fi + done + + echo "New tags to be published from new release that were not in previous releases:" + printf '%s\n' "${NEW_STABLE_TAGS[@]}" + + # Make NEW_STABLE_TAGS available for other steps + echo "NEW_STABLE_TAGS=${NEW_STABLE_TAGS[*]}" >> "$GITHUB_ENV" + echo "CURRENT_STABLE_BRANCH_MAJOR_VERSION=$CURRENT_STABLE_BRANCH_MAJOR_VERSION" >> "$GITHUB_ENV" + echo "SCOPE_VERSION=$SCOPE_VERSION" >> "$GITHUB_ENV" + shell: bash + + - name: Add new release tags to stable branch + run: | + set -eux + + # Add new stable tags to stable branch + echo "Configuring git." + git config --global user.email "release@centreon.com" + git config --global user.name "Centreon" + + # Rebuild NEW_STABLE_TAGS as an array + for i in ${NEW_RELEASE_TAGS[@]}; do + NEW_RELEASE_TAGS+=("$i") + done + + # Create release tags on git for each release components + # Abort if no tags or existing tag + echo "Creating release tags." + for TAG in ${NEW_STABLE_TAGS[@]}; do + if [ -z $(git tag --list "$TAG" | head -n 1) ] && [ -n $TAG ]; then + git tag -a "$TAG" -m "$TAG" + git push --follow-tags + echo "::notice::Tagging stable branch with $TAG." + else + echo "::error::Release tag $TAG already exists, exiting." + exit 1 + fi + done + shell: bash + + - name: Create GITHUB releases from new release tags + run: | + set -eux - if [ "$HOTFIX" == "hotfix" ]; then - TYPE=Hotfix + # Install gh cli + echo "Installing GH CLI." + if ! command -v gh &> /dev/null; then + echo "Installing GH CLI." + 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-get update + sudo apt-get install gh -y else - TYPE=Release + echo "GH CLI is already installed." fi - VERSION_DATA="{\"archived\":false,\"releaseDate\":\"$(date +%Y-%m-%d)\",\"name\":\"centreon-collect-$NEW_VERSION\",\"description\":\"$TYPE:$RELEASE_ID\",\"projectId\":${{ inputs.jira_project_id }},\"released\":false}" + # Rebuild NEW_STABLE_TAGS as an array + for i in ${NEW_STABLE_TAGS[@]}; do + NEW_RELEASE_TAGS+=("$i") + done + + # Create GITHUB release for each release components + # Abort if no tags + echo "Creating GITHUB releases." + for TAG in ${NEW_STABLE_TAGS[@]}; do + if [ -n $TAG ]; then + echo "Creating GITHUB release with title $TAG for tag $TAG." + gh release create $TAG --target "${{ inputs.github_ref_name }}" --title "$TAG" --verify-tag + else + echo "::error::Release tag $TAG was empty, exiting." + exit 1 + done + shell: bash + env: + GH_TOKEN: ${{ github.token }} + + - name: Create stable JIRA versions from new release tags + run: | + set -eux + + # 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") + done + + # Create new JIRA versions (old way of doing it) + # TODO: add a future capacity to determine wether the release is hotfix or standard (using TYPE) + # OR: rely on jira automation to do it (less hassle on github side, and jira knows jira best) + + # Build JSON vars for JIRA_RELEASE_DATA + JIRA_RELEASE_ARCHIVED="false" + JIRA_RELEASE_DESCRIPTION="" + JIRA_RELEASE_DATE="$(date +%Y-%m-%d)" + JIRA_RELEASE_NAME="" + JIRA_PROJECT_ID="${{ inputs.jira_project_id }}" + JIRA_RELEASE_RELEASED="false" + + # Create JIRA version for each released component + echo "Creating JIRA releases." + for TAG in ${NEW_RELEASE_TAGS[@]}; do + if [ -n $TAG ]; then + echo "::notice::Creating JIRA release $TAG based on git release tag $TAG." + # Build JSON with release information for JIRA API + JIRA_RELEASE_DATA=$(jq -nc \ + --arg archived "$JIRA_RELEASE_ARCHIVED" \ + --arg description "$TAG" \ + --arg releaseDate "$JIRA_RELEASE_DATE" \ + --arg name "$TAG" \ + --arg projectId "$JIRA_PROJECT_ID" \ + --arg released "$JIRA_RELEASE_RELEASED" \ + '$ARGS.named' ) + # Send to JIRA API release + echo "Sending to JIRA API release: $JIRA_RELEASE_DATA" + curl --fail --request POST \ + --url 'https://${{ inputs.jira_base_url }}/rest/api/3/version' \ + --user '${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}' \ + --header 'Accept: application/json' \ + --header 'Content-Type: application/json' \ + --data "$JIRA_RELEASE_DATA" + else + echo "::error::Release tag $TAG was empty, exiting." + exit 1 + fi + done + shell: bash + + - name: Trigger release communication for new releases + run: | + set -eux + + MAJOR_VERSION=$CURRENT_STABLE_BRANCH_MAJOR_VERSION + + # Webhook url + JIRA_INCOMING_WEBHOOK="${{ inputs.jira_webhook_url }}" + + # Rebuild NEW_STABLE_TAGS as an array (required to build a proper json) + for i in ${NEW_STABLE_TAGS[@]}; do + if [ -n "$i" ]; then + NEW_RELEASE_TAGS+=("$i") + else + echo "::error::Release tag $i was empty, exiting." + exit 1 + fi + done + + # Build JSON structure with released versions + JSON_TAGS=$(jq -n '{componentList:$ARGS.positional}' --args "${NEW_RELEASE_TAGS[@]}") + JSON_VERSION_INFO=$(jq -n --arg majorVersion "$MAJOR_VERSION" --arg scopeVersion "$SCOPE_VERSION" '$ARGS.named' ) + RELEASE_JSON=$(echo "$JSON_VERSION_INFO" | jq -c --argjson json_tags "$JSON_TAGS" '. += $json_tags') + + # DEBUG + echo "JSON_TAGS: \r\n$JSON_TAGS" + echo "JSON_VERSION_INFO: $JSON_VERSION_INFO" + echo "Sending to JIRA automation: \r\n$RELEASE_JSON" - curl --fail --request POST \ - --url '${{ inputs.jira_base_url }}/rest/api/3/version' \ - --user '${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}' \ - --header 'Accept: application/json' \ - --header 'Content-Type: application/json' \ - --data ''$VERSION_DATA'' + # Call jira webhook to trigger the communication workflow + # and provide versions data for communication + curl \ + "$JIRA_INCOMING_WEBHOOK" \ + -X POST \ + -H 'Content-type: application/json' \ + --data "$RELEASE_JSON" shell: bash diff --git a/.github/docker/Dockerfile.centreon-collect-alma8 b/.github/docker/Dockerfile.centreon-collect-alma8 index 0d2f11180bb..0b5c0b15452 100644 --- a/.github/docker/Dockerfile.centreon-collect-alma8 +++ b/.github/docker/Dockerfile.centreon-collect-alma8 @@ -40,7 +40,7 @@ dnf install -y cmake \ rrdtool-devel \ selinux-policy-devel \ yum-utils \ - perl \ + perl-interpreter \ rpm-build \ zstd diff --git a/.github/docker/Dockerfile.centreon-collect-alma9 b/.github/docker/Dockerfile.centreon-collect-alma9 index cdac5e7adb7..744abb45260 100644 --- a/.github/docker/Dockerfile.centreon-collect-alma9 +++ b/.github/docker/Dockerfile.centreon-collect-alma9 @@ -34,7 +34,7 @@ dnf --best install -y cmake \ rrdtool-devel \ selinux-policy-devel \ yum-utils \ - perl \ + perl-interpreter \ rpm-build \ procps-ng \ zstd \ diff --git a/.github/docker/Dockerfile.centreon-collect-alma9-test b/.github/docker/Dockerfile.centreon-collect-alma9-test index 31f5df22062..9212df5b289 100644 --- a/.github/docker/Dockerfile.centreon-collect-alma9-test +++ b/.github/docker/Dockerfile.centreon-collect-alma9-test @@ -32,7 +32,7 @@ dnf --best install -y \ python3-pip \ perl-Thread-Queue \ rrdtool \ - perl \ + perl-interpreter \ procps-ng \ zstd \ psmisc \ diff --git a/.github/docker/Dockerfile.centreon-collect-debian-bullseye b/.github/docker/Dockerfile.centreon-collect-debian-bullseye index 2e26996dd74..ceebb4c65e5 100644 --- a/.github/docker/Dockerfile.centreon-collect-debian-bullseye +++ b/.github/docker/Dockerfile.centreon-collect-debian-bullseye @@ -32,7 +32,8 @@ apt-get -y install cmake \ fakeroot \ strace \ locales \ - zstd + zstd \ + perl-base apt-get clean diff --git a/.github/docker/Dockerfile.centreon-collect-debian-bullseye-test b/.github/docker/Dockerfile.centreon-collect-debian-bullseye-test index bcd3259e271..82c701db1d8 100644 --- a/.github/docker/Dockerfile.centreon-collect-debian-bullseye-test +++ b/.github/docker/Dockerfile.centreon-collect-debian-bullseye-test @@ -32,7 +32,8 @@ apt-get -y install curl \ rrdcached \ zstd \ psmisc \ - sudo + sudo \ + perl-base localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 diff --git a/.github/workflows/centreon-collect.yml b/.github/workflows/centreon-collect.yml index e8108e95c5a..e631745e800 100644 --- a/.github/workflows/centreon-collect.yml +++ b/.github/workflows/centreon-collect.yml @@ -130,6 +130,8 @@ jobs: artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} cache_key: cache-${{ github.sha }}-rpmbuild-centreon-collect-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }} stability: ${{ needs.get-version.outputs.stability }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} deliver-deb: if: ${{ contains(fromJson('["testing", "stable"]'), needs.get-version.outputs.stability) }} @@ -154,6 +156,8 @@ jobs: artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} cache_key: cache-${{ github.sha }}-debbuild-centreon-collect-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }} stability: ${{ needs.get-version.outputs.stability }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} promote: needs: [get-version] @@ -177,3 +181,6 @@ jobs: minor_version: ${{ needs.get-version.outputs.patch }} stability: ${{ needs.get-version.outputs.stability }} repository_name: standard + github_ref_name: ${{ github.ref_name }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml index 738c5bd6586..bf783a2923e 100644 --- a/.github/workflows/get-version.yml +++ b/.github/workflows/get-version.yml @@ -22,6 +22,12 @@ on: environment: description: "branch stability (stable, testing, unstable, canary)" value: ${{ jobs.get-version.outputs.environment }} + release_type: + description: "type of release (hotfix, release)" + value: ${{ jobs.get-version.outputs.release_type }} + release_cloud: + description: "context of release (cloud or not cloud)" + value: ${{ jobs.get-version.outputs.release_cloud }} jobs: get-version: @@ -34,9 +40,25 @@ jobs: release: ${{ steps.get_version.outputs.release }} stability: ${{ steps.get_version.outputs.stability }} environment: ${{ steps.get_version.outputs.env }} + release_type: ${{ steps.get_version.outputs.release_type }} + release_cloud: ${{ steps.get_version.outputs.release_cloud}} steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: install gh cli on self-hosted runner + run: | + if ! command -v gh &> /dev/null; then + echo "Installing GH CLI." + type -p curl >/dev/null || (sudo apt update && sudo apt 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 + else + echo "GH CLI is already installed." + fi + shell: bash - id: get_version run: | @@ -55,12 +77,49 @@ jobs: BRANCHNAME="$GITHUB_HEAD_REF" fi + echo "BRANCHNAME is: $BRANCHNAME" + + # Set default release values + GITHUB_RELEASE_CLOUD=0 + GITHUB_RELEASE_TYPE=$(echo $BRANCHNAME |cut -d '-' -f 1) + case "$BRANCHNAME" in - master | [2-9][0-9].[0-9][0-9].x | release* | hotfix*) + master | [2-9][0-9].[0-9][0-9].x) echo "release=1" >> $GITHUB_OUTPUT + echo "release_cloud=$GITHUB_RELEASE_CLOUD" >> $GITHUB_OUTPUT + echo "release_type=$GITHUB_RELEASE_TYPE" >> $GITHUB_OUTPUT + ;; + release* | hotfix*) + # Handle workflow_dispatch run triggers and run a dispatch ONLY for cloud release + GITHUB_RELEASE_BRANCH_BASE_REF_NAME="$(gh pr view $BRANCHNAME -q .baseRefName --json headRefName,baseRefName,state)" + echo "GITHUB_RELEASE_BRANCH_BASE_REF_NAME is: $GITHUB_RELEASE_BRANCH_BASE_REF_NAME" + GITHUB_RELEASE_BRANCH_PR_STATE="$(gh pr view $BRANCHNAME -q .state --json headRefName,baseRefName,state)" + echo "GITHUB_RELEASE_BRANCH_PR_STATE is: $GITHUB_RELEASE_BRANCH_PR_STATE" + + # Check if the release context (cloud and hotfix or cloud and release) + if [[ "$GITHUB_RELEASE_BRANCH_BASE_REF_NAME" == "master" ]] && [[ "$GITHUB_RELEASE_BRANCH_PR_STATE" == "OPEN" ]]; then + # Get release pull request ID + GITHUB_RELEASE_BRANCH_PR_NUMBER="$(gh pr view $BRANCHNAME -q .[] --json number)" + # Set release cloud to 1 (0=not-cloud, 1=cloud) + GITHUB_RELEASE_CLOUD=1 + # Debug + echo "GITHUB_RELEASE_TYPE is: $GITHUB_RELEASE_TYPE" + echo "GITHUB_RELEASE_BRANCH_PR_NUMBER is: $GITHUB_RELEASE_BRANCH_PR_NUMBER" + echo "GITHUB_RELEASE_CLOUD is: $GITHUB_RELEASE_CLOUD" + # Github ouputs + echo "release=`echo $GITHUB_RELEASE_BRANCH_PR_NUMBER`.`date +%s`.`echo ${{ github.sha }} | cut -c -7`" >> $GITHUB_OUTPUT + echo "release_type=$GITHUB_RELEASE_TYPE" >> $GITHUB_OUTPUT + echo "release_cloud=$GITHUB_RELEASE_CLOUD" >> $GITHUB_OUTPUT + else + echo "release=1" >> $GITHUB_OUTPUT + echo "release_cloud=$GITHUB_RELEASE_CLOUD" >> $GITHUB_OUTPUT + echo "release_type=$GITHUB_RELEASE_TYPE" >> $GITHUB_OUTPUT + fi ;; *) echo "release=`date +%s`.`echo ${{ github.sha }} | cut -c -7`" >> $GITHUB_OUTPUT + echo "release_cloud=$GITHUB_RELEASE_CLOUD" >> $GITHUB_OUTPUT + echo "release_type=$GITHUB_RELEASE_TYPE" >> $GITHUB_OUTPUT ;; esac @@ -85,3 +144,5 @@ jobs: echo "env=$VERSION-$ENV" >> $GITHUB_OUTPUT echo "GH_ENV: $VERSION-$ENV" shell: bash + env: + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/libzmq.yml b/.github/workflows/libzmq.yml index 10f5ae053fe..bbaded08f75 100644 --- a/.github/workflows/libzmq.yml +++ b/.github/workflows/libzmq.yml @@ -156,6 +156,8 @@ jobs: artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} cache_key: ${{ github.run_id }}-${{ github.sha }}-rpm-libzmq-${{ matrix.distrib }}-${{ matrix.arch }} stability: ${{ needs.get-version.outputs.stability }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} deliver-deb: if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-version.outputs.stability) }} @@ -183,6 +185,8 @@ jobs: artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} cache_key: ${{ github.run_id }}-${{ github.sha }}-deb-libzmq-${{ matrix.distrib }}-${{ matrix.arch }} stability: ${{ needs.get-version.outputs.stability }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} promote: needs: [get-version] @@ -206,3 +210,6 @@ jobs: minor_version: ${{ needs.get-version.outputs.patch }} stability: ${{ needs.get-version.outputs.stability }} repository_name: standard + github_ref_name: ${{ github.ref_name }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} diff --git a/.github/workflows/release-collect.yml b/.github/workflows/release-collect.yml deleted file mode 100644 index ed2cecbf068..00000000000 --- a/.github/workflows/release-collect.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: Create collect jira version - -on: - pull_request_target: - types: - - closed - branches: - - master - - "[2-9][0-9].[0-9][0-9].x" - paths: - - "centreon-collect/**" - - "!centreon-collect/ci/**" - - "!centreon-collect/tests/**" - workflow_dispatch: - -env: - module: "collect" - -jobs: - release: - if: github.event.pull_request.merged == true - runs-on: ubuntu-22.04 - steps: - - name: Checkout sources - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - fetch-depth: 0 - - - name: Release - id: release - uses: ./.github/actions/release - with: - jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }} - jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }} - jira_project_id: ${{ secrets.JIRA_PROJECT_ID }} - jira_base_url: ${{ secrets.JIRA_BASE_URL }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..e20fa63d9d6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +--- +name: Release + +on: + pull_request: + types: + - closed + branches: + - master + - "[2-9][0-9].[0-9][0-9].x" + paths-ignore: + - ".github/**" + - ".jira/**" + - "tests/**" + - ".deepsource.toml" + - ".veracode-exclusions" + - "README.md" + - "sonar-project.properties" + workflow_dispatch: + +jobs: + release: + 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: + fetch-depth: 0 + + - name: Release + id: release + uses: ./.github/actions/release + with: + github_ref_name: ${{ github.base_ref }} + jira_project_id: ${{ secrets.JIRA_PROJECT_ID }} + jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }} + jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }} + jira_base_url: ${{ secrets.JIRA_BASE_URL }} + jira_webhook_url: ${{ secrets.JIRA_RELEASE_WEBHOOK }} diff --git a/.github/workflows/robot-nightly.yml b/.github/workflows/robot-nightly.yml index a62a1497693..afb472d71cc 100644 --- a/.github/workflows/robot-nightly.yml +++ b/.github/workflows/robot-nightly.yml @@ -95,6 +95,8 @@ jobs: artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} cache_key: cache-${{ github.sha }}-rpmbuild-centreon-collect-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }} stability: ${{ needs.get-version.outputs.stability }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} deliver-deb: if: ${{ contains(fromJson('["unstable"]'), needs.get-version.outputs.stability) }} @@ -118,3 +120,5 @@ jobs: artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }} cache_key: cache-${{ github.sha }}-debbuild-centreon-collect-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }} stability: ${{ needs.get-version.outputs.stability }} + release_type: ${{ needs.get-version.outputs.release_type }} + release_cloud: ${{ needs.get-version.outputs.release_cloud }} diff --git a/.version b/.version index c135e9c81ab..7edc6dec2c0 100644 --- a/.version +++ b/.version @@ -1,2 +1,2 @@ MAJOR=23.04 -MINOR=10 +MINOR=11 diff --git a/CMakeLists.txt b/CMakeLists.txt index aa80be6018e..79d809443e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,7 +116,7 @@ endif() # Version. set(COLLECT_MAJOR 23) set(COLLECT_MINOR 04) -set(COLLECT_PATCH 10) +set(COLLECT_PATCH 11) set(COLLECT_VERSION "${COLLECT_MAJOR}.${COLLECT_MINOR}.${COLLECT_PATCH}") add_definitions(-DCENTREON_CONNECTOR_VERSION=\"${COLLECT_VERSION}\") diff --git a/packaging/debian/control b/packaging/debian/control index eac6351053e..b49d24728d8 100644 --- a/packaging/debian/control +++ b/packaging/debian/control @@ -15,7 +15,8 @@ Build-Depends: debhelper-compat (=12), python3, python3-pip, libperl-dev, - libgcrypt20-dev + libgcrypt20-dev, + perl-base Standards-Version: 4.5.0 Homepage: https://wwww.centreon.com diff --git a/packaging/rpm/centreon-collect.spec b/packaging/rpm/centreon-collect.spec index 6e23c7aa703..a1ca95b85a8 100644 --- a/packaging/rpm/centreon-collect.spec +++ b/packaging/rpm/centreon-collect.spec @@ -32,7 +32,7 @@ BuildRequires: gnutls-devel >= 3.3.29 BuildRequires: libgcrypt-devel BuildRequires: lua-devel BuildRequires: make -BuildRequires: perl +BuildRequires: perl-interpreter BuildRequires: perl-ExtUtils-Embed BuildRequires: perl-devel BuildRequires: rrdtool-devel diff --git a/tests/bam/bam_pb.robot b/tests/bam/bam_pb.robot index 9faf93b8415..3c1fa016230 100644 --- a/tests/bam/bam_pb.robot +++ b/tests/bam/bam_pb.robot @@ -10,51 +10,51 @@ Library String Library ../resources/Broker.py Library ../resources/Engine.py -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 *** BAPBSTATUS [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 also check stats output [Tags] broker downtime engine bam - Clear Commands Status - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Broker Config Log central sql 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 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql 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 + 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. # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Repeat Keyword 3 times Ctn Process Service Check Result 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 Connect To Database pymysql ${DBNameConf} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -65,509 +65,509 @@ BAPBSTATUS # 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' # 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 - [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 - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Broker Config Log central sql trace - Config BBDO3 ${1} - Config Engine ${1} - - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Clear Commands Status + Ctn Clear Retention + 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 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"), ("host_16", "service_303")] }} - Create BA With Services test best ${svc} - Add Bam Config To Broker central + Ctn Create Ba With Services test best ${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 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 - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Repeat Keyword 3 times Ctn Process Service Check Result 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 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA ba_1 is not OK as expected # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_303 2 output critical for 314 + Repeat Keyword 3 times Ctn Process Service Check Result host_16 service_303 2 output critical for 314 - ${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 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected # 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 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA ba_1 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 - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Broker Config Log central sql trace - Config BBDO3 ${1} - Config Engine ${1} + Ctn Clear Commands Status + Ctn Clear Retention + 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 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. - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central - ${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% Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 2 ... output critical for service_302 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_303 ... 1 ... output warning for service_303 - ${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_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 1 60 + ${result} Ctn Check Ba Status With Timeout test 1 60 Should Be True ${result} The BA ba_1 is not WARNING as expected # service_302 critical service_303 critical => ba critical 80% Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 2 ... output critical for service_302 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected # 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 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA ba_1 is not OK as expected # both warning => ba ok Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 1 ... output warning for service_302 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA ba_1 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_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 - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Broker Config Log central sql trace - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} + Ctn Clear Commands Status + Ctn Clear Retention + 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 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. - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central - ${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. # one serv critical => ba ok Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA test is not OK as expected # two serv critical => ba warning Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 2 ... output critical for service_302 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test 1 30 Should Be True ${result} The BA test is not WARNING as expected # two serv critical and child ba critical => mother ba critical Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 2 ... output critical for service_302 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_303 ... 2 ... output critical for service_303 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test_child 2 30 Should Be True ${result} The BA test_child is not CRITICAL as expected - ${result} check_ba_status_with_timeout test 2 30 + ${result} Ctn Check Ba Status With Timeout test 2 30 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 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 - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Broker Config Log central sql trace - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} + Ctn Clear Commands Status + Ctn Clear Retention + 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 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. - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central - ${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. # One service CRITICAL => The BA is still OK Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA test is not OK as expected # Two services CRITICAL => The BA passes to WARNING Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 2 ... output critical for service_302 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test 1 60 Should Be True ${result} The test BA is not in WARNING as expected # Two services CRITICAL and also the child BA => The mother BA passes to CRITICAL Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 2 ... output critical for service_302 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_303 ... 2 ... output critical for service_303 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test_child 2 30 Should Be True ${result} The BA test_child is not CRITICAL as expected - ${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 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 BA_BOOL_KPI [Documentation] With bbdo version 3.0.1, a BA of type 'worst' with 1 boolean kpi [Tags] broker engine bam - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Broker Config Log central sql trace - 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 - - ${id_ba__sid} create_ba test worst 100 100 - 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 bam trace + Ctn Broker Config Log central sql trace + 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 + + ${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 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 1 ... output warning for service_302 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 +# Ctn Schedule Forced Svc Check _Module_BAM_1 ba_1 + ${result} Ctn Check Ba Status With Timeout test 2 30 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 - Clear Commands Status - Clear Retention + Ctn Clear Commands Status + Ctn Clear Retention Remove File /tmp/all_lua_event.log - Config Engine ${1} - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central bam trace - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql - Clone Engine Config To DB - Add Bam Config To Broker central + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Broker central - 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 @@ -579,39 +579,39 @@ 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 - Clear Commands Status - Clear Retention + Ctn Clear Commands Status + Ctn Clear Retention Remove File /tmp/all_lua_event.log - Config Engine ${1} - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central bam trace - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - - Clone Engine Config To DB - Add Bam Config To Broker central - Add Bam Config To Engine + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Broker central + Ctn Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create BA With Services test worst ${svc} + 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 @@ -623,39 +623,39 @@ 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 - Clear Commands Status - Clear Retention + Ctn Clear Commands Status + Ctn Clear Retention Remove File /tmp/all_lua_event.log - Config Engine ${1} - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central bam trace - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - - Clear Db mod_bam_reporting_relations_ba_bv - Clone Engine Config To DB - Add Bam Config To Engine + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + + Ctn Clear Db mod_bam_reporting_relations_ba_bv + 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} + Ctn Create Ba With Services test worst ${svc} - Add Bam Config To Broker central + Ctn Add Bam Config To Broker central - 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 @@ -672,37 +672,37 @@ 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 - Clear Commands Status - Clear Retention + Ctn Clear Commands Status + Ctn Clear Retention Remove File /tmp/all_lua_event.log - Config Engine ${1} - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central bam trace - Broker Config Log central lua trace - Broker Config Log central core trace - broker_config_source_log central 1 - Config Broker Sql Output central unified_sql - - Clone Engine Config To DB + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central lua trace + Ctn Broker Config Log central core trace + Ctn Broker Config Source Log central 1 + Ctn Config Broker Sql Output central unified_sql + + Ctn Clone Engine Config To Db # Add Bam Config To Engine - Add Bam Config To Broker central + Ctn Add Bam Config To Broker central - 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 @@ -714,35 +714,35 @@ 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 - Clear Commands Status - Clear Retention + Ctn Clear Commands Status + Ctn Clear Retention Remove File /tmp/all_lua_event.log - Config Engine ${1} - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central bam trace - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - broker_config_source_log central 1 - - Clone Engine Config To DB - Add Bam Config To Broker central - Add Bam Config To Engine + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Source Log central 1 + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Broker central + Ctn Add Bam Config To Engine @{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]} @@ -761,39 +761,39 @@ 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 - Clear Commands Status - Clear Retention + Ctn Clear Commands Status + Ctn Clear Retention Remove File /tmp/all_lua_event.log - Config Engine ${1} - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central bam trace - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - broker_config_source_log central 1 - - Clone Engine Config To DB - Add Bam Config To Broker central - Add Bam Config To Engine + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Broker Config Source Log central 1 + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Broker central + Ctn Add Bam Config To Engine @{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 - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + Repeat Keyword 3 times Ctn Process Service Check Result 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} @@ -811,29 +811,29 @@ 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 - Clear Commands Status - Clear Retention - - Config Engine ${1} - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central bam trace - Broker Config Log central core trace - broker_config_source_log central 1 - Config Broker Sql Output central unified_sql - - Clone Engine Config To DB - Add Bam Config To Broker central - Add Bam Config To Engine + Ctn Clear Commands Status + Ctn Clear Retention + + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central core trace + Ctn Broker Config Source Log central 1 + Ctn Config Broker Sql Output central unified_sql + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Broker central + Ctn Add Bam Config To Engine @{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 @@ -843,18 +843,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 - Repeat Keyword 3 times Process Service Check Result 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 + Repeat Keyword 3 times Ctn Process Service Check Result 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 @@ -872,29 +872,29 @@ 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 - Clear Commands Status - Clear Retention - - Config Engine ${1} - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central bam trace - Broker Config Log central core trace - broker_config_source_log central 1 - Config Broker Sql Output central unified_sql - - Clone Engine Config To DB - Add Bam Config To Broker central - Add Bam Config To Engine + Ctn Clear Commands Status + Ctn Clear Retention + + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central core trace + Ctn Broker Config Source Log central 1 + Ctn Config Broker Sql Output central unified_sql + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Broker central + Ctn Add Bam Config To Engine @{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 @@ -902,8 +902,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 @@ -917,32 +917,32 @@ 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 - Clear Commands Status - Clear Retention + Ctn Clear Commands Status + Ctn Clear Retention Remove File /tmp/all_lua_event.log - Config Engine ${1} - Config Broker central - Config Broker module - Config BBDO3 ${1} - Broker Config Log central bam trace - Broker Config Log central lua trace - Broker Config Log central core trace - broker_config_source_log central 1 - Config Broker Sql Output central unified_sql - - Clone Engine Config To DB - Add Bam Config To Broker central - - Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua - - Start Broker True - Start Engine + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Config BBDO3 ${1} + Ctn Broker Config Log central bam trace + Ctn Broker Config Log central lua trace + Ctn Broker Config Log central core trace + Ctn Broker Config Source Log central 1 + Ctn Config Broker Sql Output central unified_sql + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Broker central + + Ctn Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua + + 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 @@ -958,159 +958,159 @@ 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 - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Broker Config Log central sql trace - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} + Ctn Clear Commands Status + Ctn Clear Retention + 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 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. - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central - ${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 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA test is not OK as expected # one serv critical => ba warning Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test 1 30 Should Be True ${result} The BA test is not WARNING as expected # two services critical => ba ok Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test 2 30 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 + ${result} Ctn Check Ba Status With Timeout test 0 30 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 - Clear Commands Status - Clear Retention - Config Broker module - Config Broker central - Config Broker rrd - Broker Config Log central bam trace - Broker Config Log central sql trace - Broker Config Source Log central 1 - Config BBDO3 ${1} - Config Engine ${1} + Ctn Clear Commands Status + Ctn Clear Retention + 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 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. - Clone Engine Config To DB - Add Bam Config To Engine - Add Bam Config To Broker central + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + Ctn Add Bam Config To Broker central - ${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 + ${result} Ctn Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA test is not OK as expected # one serv critical => ba warning Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test 1 30 Should Be True ${result} The BA test is not WARNING as expected # two services critical => ba ok Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout test 2 30 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 + ${result} Ctn Check Ba Status With Timeout test 0 30 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_CHANGED @@ -1119,57 +1119,57 @@ BA_CHANGED ... by a boolean rule kpi. When cbd is reloaded, the BA is ... well updated. [Tags] MON-34895 - Bam Init + Ctn Bam Init @{svc} Set Variable ${{ [("host_16", "service_302")] }} - ${ba} Create Ba With Services test worst ${svc} + ${ba} Ctn Create Ba With Services test worst ${svc} - 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. # Both services ${state} => The BA parent is ${state} - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... 0 ... output OK for service 302 - - ${result} Check Ba Status With Timeout test 0 30 - Dump Ba On Error ${result} ${ba[0]} + + ${result} Ctn Check Ba Status With Timeout test 0 30 + Ctn Dump Ba On Error ${result} ${ba[0]} Should Be True ${result} The BA test is not OK as expected - Remove Service Kpi ${ba[0]} host_16 service_302 - Add Boolean Kpi + Ctn Remove Service Kpi ${ba[0]} host_16 service_302 + Ctn Add Boolean Kpi ... ${ba[0]} ... {host_16 service_302} {IS} {OK} ... False ... 100 - Reload Broker + Ctn Reload Broker Remove File /tmp/ba.dot - Broker Get Ba 51001 ${ba[0]} /tmp/ba.dot + Ctn Broker Get Ba 51001 ${ba[0]} /tmp/ba.dot Wait Until Created /tmp/ba.dot ${result} Grep File /tmp/ba.dot Boolean exp Should Not Be Empty ${result} - Add Boolean Kpi + Ctn Add Boolean Kpi ... ${ba[0]} ... {host_16 service_303} {IS} {WARNING} ... False ... 100 - Reload Broker + Ctn Reload Broker Remove File /tmp/ba.dot - Broker Get Ba 51001 ${ba[0]} /tmp/ba.dot + Ctn Broker Get Ba 51001 ${ba[0]} /tmp/ba.dot Wait Until Created /tmp/ba.dot ${result} Grep File /tmp/ba.dot BOOL Service (16, 303) Should Not Be Empty ${result} - [Teardown] Run Keywords Stop engine AND Kindly Stop Broker + [Teardown] Run Keywords Ctn Stop Engine AND Ctn Kindly Stop Broker BA_IMPACT_IMPACT @@ -1179,24 +1179,24 @@ BA_IMPACT_IMPACT ... parent should be critical. When they are not impacting, ... the parent should be ok. [Tags] MON-34895 - Bam Init + Ctn Bam Init - ${parent_ba} Create Ba parent impact 20 99 + ${parent_ba} Ctn Create Ba parent impact 20 99 @{svc1} Set Variable ${{ [("host_16", "service_302")] }} - ${child1_ba} Create Ba child1 impact 20 99 - Add Service Kpi host_16 service_302 ${child1_ba[0]} 100 2 3 - ${child2_ba} Create Ba child2 impact 20 99 - Add Service Kpi host_16 service_303 ${child2_ba[0]} 100 2 3 + ${child1_ba} Ctn Create Ba child1 impact 20 99 + Ctn Add Service Kpi host_16 service_302 ${child1_ba[0]} 100 2 3 + ${child2_ba} Ctn Create Ba child2 impact 20 99 + Ctn Add Service Kpi host_16 service_303 ${child2_ba[0]} 100 2 3 - Add Ba Kpi ${child1_ba[0]} ${parent_ba[0]} 90 2 3 - Add Ba Kpi ${child2_ba[0]} ${parent_ba[0]} 10 2 3 + Ctn Add Ba Kpi ${child1_ba[0]} ${parent_ba[0]} 90 2 3 + Ctn Add Ba Kpi ${child2_ba[0]} ${parent_ba[0]} 10 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. FOR ${state} ${value} IN @@ -1205,58 +1205,58 @@ BA_IMPACT_IMPACT ... OK 0 ... CRITICAL 2 # Both services ${state} => The BA parent is ${state} - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_302 ... ${value} ... output ${state} for service 302 - Process Service Result Hard + Ctn Process Service Result Hard ... host_16 ... service_303 ... ${value} ... output ${state} for service 302 - ${result} Check Service Status With Timeout host_16 service_302 ${value} 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_302 ${value} 60 HARD Should Be True ${result} The service (host_16,service_302) is not ${state} as expected - ${result} Check Service Status With Timeout host_16 service_303 ${value} 60 HARD + ${result} Ctn Check Service Status With Timeout host_16 service_303 ${value} 60 HARD Should Be True ${result} The service (host_16,service_303) is not ${state} as expected - ${result} Check Ba Status With Timeout child1 ${value} 30 - Dump Ba On Error ${result} ${child1_ba[0]} + ${result} Ctn Check Ba Status With Timeout child1 ${value} 30 + Ctn Dump Ba On Error ${result} ${child1_ba[0]} Should Be True ${result} The BA child1 is not ${state} as expected - ${result} Check Ba Status With Timeout child2 ${value} 30 - Dump Ba On Error ${result} ${child2_ba[0]} + ${result} Ctn Check Ba Status With Timeout child2 ${value} 30 + Ctn Dump Ba On Error ${result} ${child2_ba[0]} Should Be True ${result} The BA child2 is not ${state} as expected - ${result} Check Ba Status With Timeout parent ${value} 30 - Dump Ba On Error ${result} ${parent_ba[0]} + ${result} Ctn Check Ba Status With Timeout parent ${value} 30 + Ctn Dump Ba On Error ${result} ${parent_ba[0]} Should Be True ${result} The BA parent is not ${state} as expected Remove Files /tmp/parent1.dot /tmp/parent2.dot - Broker Get Ba 51001 ${parent_ba[0]} /tmp/parent1.dot + Ctn Broker Get Ba 51001 ${parent_ba[0]} /tmp/parent1.dot Wait Until Created /tmp/parent1.dot ${start} Get Current Date - Reload Broker + Ctn Reload Broker ${content} Create List Inherited downtimes and BA states restored - ${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} It seems that no cache has been restored into BAM. - Broker Get Ba 51001 ${parent_ba[0]} /tmp/parent2.dot + Ctn Broker Get Ba 51001 ${parent_ba[0]} /tmp/parent2.dot Wait Until Created /tmp/parent2.dot - ${result} Compare Dot Files /tmp/parent1.dot /tmp/parent2.dot + ${result} Ctn Compare Dot Files /tmp/parent1.dot /tmp/parent2.dot Should Be True ${result} The BA changed during Broker reload. END - [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 @@ -1266,23 +1266,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 7b5612ee465..d764b954c1d 100644 --- a/tests/bam/boolean_rules.robot +++ b/tests/bam/boolean_rules.robot @@ -10,232 +10,232 @@ Library String Library ../resources/Broker.py Library ../resources/Engine.py -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__sid} Create Ba ba-worst worst 70 80 - 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} 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 ba-worst worst 70 80 + 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 + + ${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. # 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 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... 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 + ${result} Ctn Check Ba Status With Timeout ba-worst 2 30 Should Be True ${result} The 'ba-worst' BA is not CRITICAL as expected - ${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} 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 - ${result} Check Service Resource 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 Ba Status With Timeout ba-worst 0 30 + ${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. Should Be True ${result} The 'ba-worst' BA is not OK as expected - ${result} Check Ba Status With Timeout boolean-ba 0 30 + ${result} Ctn Check Ba Status With Timeout boolean-ba 0 30 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 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 2 ... output critical for service_302 - ${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} 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 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 2 ... output critical for service_302 - ${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} 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 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_302 ... 2 @@ -244,7 +244,7 @@ BABOOORREL # 303 is set to critical => {host_16 service_303} {IS} {OK} is then False Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_303 ... 2 @@ -253,87 +253,87 @@ BABOOORREL # 304 is set to ok => {host_16 service_304} {IS} {OK} is then True Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_16 ... service_304 ... 0 ... output ok for service_304 - ${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} 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} - Restart Engine - Reload Broker + Ctn Restart 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 Ba Status With Timeout boolean-ba 0 30 + ${result} Ctn Check Ba Status With Timeout boolean-ba 0 30 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} - Restart Engine - Reload Broker + Ctn Restart 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 Ba Status With Timeout boolean-ba 2 30 + ${result} Ctn Check Ba Status With Timeout boolean-ba 2 30 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} Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_1 ... service_${i} ... 2 @@ -341,26 +341,26 @@ BABOOCOMPL END FOR ${i} IN RANGE ${1} ${21} ${2} - ${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 Repeat Keyword ... 3 times - ... Process Service Check Result + ... Ctn Process Service Check Result ... host_1 ... service_${i} ... 0 ... output ok for service_${i} END - ${result} Check Ba Status With Timeout boolean-ba 0 30 + ${result} Ctn Check Ba Status With Timeout boolean-ba 0 30 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 ecdb9cdad13..18df180f59e 100644 --- a/tests/bam/inherited_downtime.robot +++ b/tests/bam/inherited_downtime.robot @@ -1,362 +1,362 @@ *** Settings *** -Resource ../resources/resources.robot -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup BAM Setup -Test Teardown Save logs If Failed +Resource ../resources/resources.robot +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn BAM Setup +Test Teardown Ctn Save Logs If Failed -Documentation Centreon Broker and BAM -Library Process -Library DatabaseLibrary -Library DateTime -Library OperatingSystem -Library ../resources/Broker.py -Library ../resources/Engine.py +Documentation Centreon Broker and BAM +Library Process +Library DatabaseLibrary +Library DateTime +Library OperatingSystem +Library ../resources/Broker.py +Library ../resources/Engine.py *** 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} - - Clone Engine Config To DB - 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 - # Command of service_314 is set to critical - ${cmd_1}= Get Command Id 314 - Log To Console service_314 has command id ${cmd_1} - Set Command Status ${cmd_1} 2 - Start Broker - ${start}= Get Current Date - 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 - Should Be True ${result} msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. - - # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 HARD - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=The service (host_16, service_314) is in downtime and should not. - - ${result}= Check Downtimes With Timeout 0 60 - Should Be True ${result} msg=We should have no more running downtimes - - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 - Should Be True ${result} msg=The BA ba_1 is in downtime as it should not - - Stop Engine - Kindly Stop Broker + [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 + 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} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + + @{svc}= Set Variable ${{ [("host_16", "service_314")] }} + 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}= Ctn Get Command Id 314 + Log To Console service_314 has command id ${cmd_1} + Ctn Set Command Status ${cmd_1} 2 + Ctn Start Broker + ${start}= Get Current Date + Ctn Start Engine + # Let's wait for the initial service states. + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; + ${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 + Repeat Keyword 3 times Ctn Process Service Check Result 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}= 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 + 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}= 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 + 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}= Ctn Check Downtimes With Timeout 0 60 + Should Be True ${result} We should have no more running downtimes + + ${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 + + 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} - - Clone Engine Config To DB - 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 - # Command of service_314 is set to critical - ${cmd_1}= Get Command Id 314 - Log To Console service_314 has command id ${cmd_1} - Set Command Status ${cmd_1} 2 - Start Broker - ${start}= Get Current Date - 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 - Should Be True ${result} msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. - - # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be - - ${result}= Check Downtimes With Timeout 2 60 - Should Be True ${result} msg=We should have one running downtime - - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 - Should Be True ${result} msg=The BA ba_1 is not in downtime as it should - - FOR ${i} IN RANGE 2 - # Engine is restarted - Stop Engine - ${start}= Get Current Date - 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 - Should Be True ${result} msg=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 - log to console Broker is started - 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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=The service (host_16, service_314) is in downtime and should not. - ${result}= Check Downtimes With Timeout 0 60 - Should Be True ${result} msg=We should have no more downtime - - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 - Should Be True ${result} msg=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 + [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 + 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} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + + @{svc}= Set Variable ${{ [("host_16", "service_314")] }} + 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}= Ctn Get Command Id 314 + Log To Console service_314 has command id ${cmd_1} + Ctn Set Command Status ${cmd_1} 2 + Ctn Start Broker + ${start}= Get Current Date + Ctn Start Engine + # Let's wait for the initial service states. + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; + ${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 + Repeat Keyword 3 times Ctn Process Service Check Result 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}= 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 + 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}= Ctn Check Downtimes With Timeout 2 60 + Should Be True ${result} We should have one running downtime + + ${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 + Ctn Stop Engine + ${start}= Get Current Date + Ctn Start Engine + # Let's wait for the initial service states. + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; + ${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}) + Ctn Kindly Stop Broker + log to console Broker is started + Ctn Start Broker + END + + # There are still two downtimes: the one on the ba and the one on the kpi. + ${result}= Ctn Check Downtimes With Timeout 2 60 + Should Be True ${result} We should have two downtimes + + # The downtime is deleted + 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}= Ctn Check Downtimes With Timeout 0 60 + Should Be True ${result} We should have no more downtime + + ${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) + 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 - - @{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 - - # Command of service_313 is set to ok - ${cmd_1}= Get Command Id 313 - Log To Console service_313 has command id ${cmd_1} - Set Command Status ${cmd_1} 0 - - # Command of service_314 is set to critical - ${cmd_2}= Get Command Id 314 - Log To Console service_314 has command id ${cmd_2} - Set Command Status ${cmd_2} 2 - - Start Broker - ${start}= Get Current Date - 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 - Should Be True ${result} msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. - - # KPI set to ok - Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 - ${result}= Check Service Status With Timeout host_16 service_313 0 60 - Should Be True ${result} msg=The service (host_16,service_313) is not OK as expected - - # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=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 - Should Be True ${result} msg=We should have one downtime - - ${result}= Check Ba Status With Timeout test 0 60 - Should Be True ${result} msg=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 - - ${result}= Check Service Downtime With Timeout host_16 service_314 0 60 - Should Be True ${result} msg=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 - Should Be True ${result} msg=We should have no more running downtimes - - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=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 + [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 + 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")] }} + 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}= Ctn Get Command Id 313 + Log To Console service_313 has command id ${cmd_1} + Ctn Set Command Status ${cmd_1} 0 + + # Command of service_314 is set to critical + ${cmd_2}= Ctn Get Command Id 314 + Log To Console service_314 has command id ${cmd_2} + Ctn Set Command Status ${cmd_2} 2 + + Ctn Start Broker + ${start}= Get Current Date + Ctn Start Engine + # Let's wait for the initial service states. + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; + ${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 + Repeat Keyword 3 times Ctn Process Service Check Result 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 + Repeat Keyword 3 times Ctn Process Service Check Result 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}= 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 + 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. + + 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}= 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}= 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 + Ctn Delete Service Downtime host_16 service_314 + + ${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}= Ctn Check Downtimes With Timeout 1 60 + Should Be True ${result} We should have one downtime + + ${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 + 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) does not contain 0 downtime as it should + Log to console No more downtime applied to service_314. + + ${result}= Ctn Check Downtimes With Timeout 0 60 + Should Be True ${result} We should have no more running downtimes + + ${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) + + 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} - - Clone Engine Config To DB - 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 - # Command of service_314 is set to critical - ${cmd_1}= 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 - Log To Console service_314 has command id ${cmd_2} - Set Command Status ${cmd_2} 2 - Start Broker - ${start}= Get Current Date - 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 - Should Be True ${result} msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. - - # KPI set to ok - Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 - ${result}= Check Service Status With Timeout host_16 service_313 0 60 - Should Be True ${result} msg=The service (host_16,service_313) is not OK as expected - - # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=We should have no more running downtimes - - # The second downtime finishes - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=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 + [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 + 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} + + Ctn Clone Engine Config To Db + Ctn Add Bam Config To Engine + + @{svc}= Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} + 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}= Ctn Get Command Id 313 + Log To Console service_314 has command id ${cmd_1} + Ctn Set Command Status ${cmd_1} 0 + ${cmd_2}= Ctn Get Command Id 314 + Log To Console service_314 has command id ${cmd_2} + Ctn Set Command Status ${cmd_2} 2 + Ctn Start Broker + ${start}= Get Current Date + Ctn Start Engine + # Let's wait for the initial service states. + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; + ${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 + Repeat Keyword 3 times Ctn Process Service Check Result 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 + Repeat Keyword 3 times Ctn Process Service Check Result 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} 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 + 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. + + 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} 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} 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} 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} 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} Ctn Check Downtimes With Timeout 0 60 + Should Be True ${result} We should have no more running downtimes + + # The second downtime finishes + ${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) + + Ctn Stop Engine + Ctn Kindly Stop Broker *** Keywords *** -BAM Setup - Stop Processes - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - ${date}= Get Current Date result_format=epoch +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} - Execute SQL String UPDATE downtimes SET deletion_time=${date}, actual_end_time=${date} WHERE actual_end_time is null + Execute SQL String UPDATE downtimes SET deletion_time=${date}, actual_end_time=${date} WHERE actual_end_time is null diff --git a/tests/bam/pb_inherited_downtime.robot b/tests/bam/pb_inherited_downtime.robot index 846a33a3e7e..62bef539965 100644 --- a/tests/bam/pb_inherited_downtime.robot +++ b/tests/bam/pb_inherited_downtime.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and BAM with bbdo version 3.0.1 Library Process @@ -18,349 +18,349 @@ Library ../resources/Engine.py 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} msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 HARD + Repeat Keyword 3 times Ctn Process Service Check Result 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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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 - 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 - 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 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 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} msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 + Repeat Keyword 3 times Ctn Process Service Check Result 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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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 - 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 - 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 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 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} msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok - Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 - ${result}= Check Service Status With Timeout host_16 service_313 0 60 + Repeat Keyword 3 times Ctn Process Service Check Result 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} msg=The service (host_16,service_313) is not OK as expected # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 + Repeat Keyword 3 times Ctn Process Service Check Result 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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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 - 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 - 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 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 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} msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok - Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 - ${result}= Check Service Status With Timeout host_16 service_313 0 60 + Repeat Keyword 3 times Ctn Process Service Check Result 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} msg=The service (host_16,service_313) is not OK as expected # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 + Repeat Keyword 3 times Ctn Process Service Check Result 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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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 60 + ${result}= Ctn Check Ba Status With Timeout test 2 60 Should Be True ${result} msg=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/networkFailure.robot b/tests/broker-database/networkFailure.robot index 755676553f0..e5db1d31133 100644 --- a/tests/broker-database/networkFailure.robot +++ b/tests/broker-database/networkFailure.robot @@ -1,8 +1,8 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker database connection failure Library Process @@ -16,183 +16,183 @@ Library ../resources/Engine.py 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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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]} msg=timeout after network to be restablished (network failure duration : ${interval}) - Kindly Stop Broker - Stop Engine + Ctn Kindly Stop Broker + Ctn Stop Engine *** Variables *** diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index 7563229847d..798746a68a6 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine progressively add services Library DatabaseLibrary @@ -19,246 +19,246 @@ Library ../resources/Common.py 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} msg=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} msg=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} msg=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 msg=No acknowledgement on service (1, 1). # Service_1 is set back to OK. - Repeat Keyword 3 times Process Service Check Result host_1 service_1 0 (1;1) is OK - ${result}= Check Service Status With Timeout host_1 service_1 ${0} 60 HARD + Repeat Keyword 3 times Ctn Process Service Check Result 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} msg=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} msg=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} msg=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} msg=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} msg=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 msg=No acknowledgement on service (1, 1). # Service_1 is set back to OK. - Repeat Keyword 3 times Process Service Check Result host_1 service_1 0 (1;1) is OK - ${result}= Check Service Resource Status With Timeout host_1 service_1 ${0} 60 HARD + Repeat Keyword 3 times Ctn Process Service Check Result 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} msg=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} msg=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} msg=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} msg=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} msg=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 msg=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} msg=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} msg=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} msg=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} msg=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 msg=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} msg=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} msg=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} msg=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} msg=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 msg=No acknowledgement on service (1, 1). # Service_1 is set to WARNING. - Repeat Keyword 3 times Process Service Check Result host_1 service_1 1 (1;1) is WARNING - ${result}= Check Service Status With Timeout host_1 service_1 ${1} 60 HARD + Repeat Keyword 3 times Ctn Process Service Check Result 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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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 msg=No acknowledgement on service (1, 1). # Service_1 is set to WARNING. - Repeat Keyword 3 times Process Service Check Result host_1 service_1 1 (1;1) is WARNING - ${result}= Check Service Status With Timeout host_1 service_1 ${1} 60 HARD + Repeat Keyword 3 times Ctn Process Service Check Result 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} msg=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} msg=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} msg=Acknowledgement ${ack_id} should be deleted. diff --git a/tests/broker-engine/anomaly-detection.robot b/tests/broker-engine/anomaly-detection.robot index c8cefbfeb93..a3eaff3caa7 100644 --- a/tests/broker-engine/anomaly-detection.robot +++ b/tests/broker-engine/anomaly-detection.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine anomaly detection @@ -19,337 +19,336 @@ Library ../resources/Common.py *** 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 - 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 + [Tags] Broker Engine Anomaly + 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 + 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_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 - ${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 + [Tags] Broker Engine Anomaly + 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]] + 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 - ${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 + [Tags] Broker Engine Anomaly + 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]] + 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 - ${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 + [Tags] Broker Engine Anomaly + 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]] + 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 - ${predict_data} Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] - Create Anomaly Threshold File V2 /tmp/anomaly_threshold.json ${1} ${serv_id} metric 55.0 ${predict_data} - Clear Retention - Start Engine - Sleep 5s - Stop Engine - ${retention_sensitivity} Grep Retention ${0} sensitivity=0.00 + [Tags] Engine Anomaly Retention + 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]] + Ctn Create Anomaly Threshold File V2 /tmp/anomaly_threshold.json ${1} ${serv_id} metric 55.0 ${predict_data} + Ctn Clear Retention + Ctn Start Engine + Sleep 5s + 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 - ${predict_data} Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] - Create Anomaly Threshold File V2 /tmp/anomaly_threshold.json ${1} ${serv_id} metric 55.0 ${predict_data} - Clear Retention - Start Engine - Sleep 5s - Stop Engine - ${retention_sensitivity} Grep Retention ${0} sensitivity=4.00 + [Tags] Engine Anomaly Retention + 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]] + Ctn Create Anomaly Threshold File V2 /tmp/anomaly_threshold.json ${1} ${serv_id} metric 55.0 ${predict_data} + Ctn Clear Retention + Ctn Start Engine + Sleep 5s + 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 - ${predict_data} Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] - Create Anomaly Threshold File V2 /tmp/anomaly_threshold.json ${1} ${serv_id} metric 55.0 ${predict_data} - Clear Retention - Start Engine - Sleep 5s - Update Ano Sensitivity ${use_grpc} host_1 anomaly_1001 4.55 - Sleep 1s - Stop Engine - ${retention_sensitivity} Grep Retention ${0} sensitivity=4.55 + [Tags] Engine Anomaly Retention extcmd + FOR ${use_grpc} IN RANGE 1 2 + 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]] + Ctn Create Anomaly Threshold File V2 /tmp/anomaly_threshold.json ${1} ${serv_id} metric 55.0 ${predict_data} + Ctn Clear Retention + Ctn Start Engine + Sleep 5s + Ctn Update Ano Sensitivity ${use_grpc} host_1 anomaly_1001 4.55 + Sleep 1s + 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 - 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 - ${serv_id} 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 + [Tags] Broker Engine Anomaly bbdo + 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 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 + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] + 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} msg=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} msg=The table 'resources' should contain rows of types SERVICE, HOST and ANOMALY_DETECTION. 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 - 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 - ${serv_id} 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 + [Tags] Broker Engine Anomaly + 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 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 + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] + 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} msg=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} msg=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} msg=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 - 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 - ${serv_id} 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 + [Tags] Broker Engine Anomaly + 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 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 + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] + 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} msg=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} msg=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} msg=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} msg=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 - 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 - ${serv_id} 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 + [Tags] Broker Engine Anomaly + 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 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 + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] + 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} msg=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} msg=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} msg=anomaly service must be in downtime - Sleep 2s - ${result} Check Service Downtime With Timeout host_1 service_1 1 60 + Sleep 2s + ${result} Ctn Check Service Downtime With Timeout host_1 service_1 1 60 Should Be True ${result} msg=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 - 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 - ${serv_id} 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 + [Tags] Broker Engine Anomaly + 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 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 + ${serv_id} Ctn Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] + 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} msg=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} msg=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} msg=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} msg=anomaly service must be in simple downtime - - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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-35579 - 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 diff --git a/tests/broker-engine/bbdo-protobuf.robot b/tests/broker-engine/bbdo-protobuf.robot index 7517f24a5e2..1f2172328b1 100644 --- a/tests/broker-engine/bbdo-protobuf.robot +++ b/tests/broker-engine/bbdo-protobuf.robot @@ -12,148 +12,148 @@ Library ../resources/Broker.py Library ../resources/Common.py Library ../resources/specific-duplication.py -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} msg=Message about not matching bbdo versions not available - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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} msg=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 - 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 - 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 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 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 - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 - 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 - 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 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 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 - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 - 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 - 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 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 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 - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item central bbdo_version 3.0.0 - Broker Config Log central sql trace - Config Broker Sql Output central unified_sql - Config Broker Remove RRD Output central - 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 Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item central bbdo_version 3.0.0 + Ctn Broker Config Log central sql trace + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker Remove Rrd Output central + 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} msg="responsive":true not found - Stop Engine + Ctn Stop Engine FOR ${i} IN RANGE ${60} ${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":false @@ -161,22 +161,22 @@ BEPBRI1 Sleep 1s END Should Not Be Empty ${grep_res} msg="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} msg=No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -189,5 +189,5 @@ BEPBCVS END Should Be Equal As Strings ${output} (('VAL1',), ('VAL_SERV1',)) - Stop Engine - Kindly Stop Broker True + Ctn Stop Engine + Ctn Kindly Stop Broker True diff --git a/tests/broker-engine/compression.robot b/tests/broker-engine/compression.robot index a02757c4174..3bd5e8b193e 100644 --- a/tests/broker-engine/compression.robot +++ b/tests/broker-engine/compression.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine communication with or without compression Library Process @@ -18,24 +18,24 @@ Library ../resources/Common.py 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} msg=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" @@ -44,10 +44,10 @@ BECC1 Insert Into List ${content2} ${-1} 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 8f92910653e..79b4aae8d39 100644 --- a/tests/broker-engine/delete-poller.robot +++ b/tests/broker-engine/delete-poller.robot @@ -11,30 +11,30 @@ Library ../resources/Engine.py Library ../resources/Broker.py Library ../resources/Common.py -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 - Clear Instances - Start Broker - Start Engine + Ctn Clear Instances + 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} @@ -45,20 +45,20 @@ 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 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller3' Sleep 1s @@ -66,27 +66,27 @@ EBDP1 END Should Be Equal As Strings ${output} () - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 - Clear Instances + 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 + Ctn Clear Instances ${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} @@ -107,24 +107,24 @@ 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 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s @@ -133,32 +133,32 @@ EBDP2 END Should Be Equal As Strings ${output} () - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 - Clear Instances + 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 + Ctn Clear Instances ${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} @@ -180,24 +180,24 @@ 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 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s @@ -206,27 +206,27 @@ EBDP_GRPC2 END Should Be Equal As Strings ${output} () - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 - Broker Config Output Set central central-broker-unified-sql instance_timeout 10 - Clear Instances + 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 Output Set central central-broker-unified-sql instance_timeout 10 + Ctn Clear Instances ${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} @@ -248,17 +248,17 @@ 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. - ${result} Wait For Listen On Range 51001 51001 cbd 60 + ${result} Ctn Wait For Listen On Range 51001 51001 cbd 60 Should Be True ${result} gRPC api not started on cbd FOR ${index} IN RANGE 60 ${output} Query SELECT running, deleted, outdated FROM instances WHERE name='Poller2' @@ -272,7 +272,7 @@ EBDP3 ... "${output[0][0]}" == "0" or "${output[0][1]}" == "1" or "${output[0][2]}" == "1" ... Poller2 should be not running or deleted or outdated. ${remove_time} Get Current Date - Remove Poller 51001 Poller2 + Ctn Remove Poller 51001 Poller2 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id, running, deleted, outdated FROM instances WHERE name='Poller2' @@ -282,29 +282,29 @@ EBDP3 END Should Be Equal As Strings ${output} () - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 - Clear Instances + 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 + Ctn Clear Instances ${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} @@ -317,26 +317,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 @@ -344,17 +344,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 @@ -362,36 +362,36 @@ 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 - Clear Instances + 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 + Ctn Clear Instances ${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} @@ -402,29 +402,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' @@ -436,20 +436,20 @@ 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 - Clear Instances + 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 Clear Instances ${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} @@ -471,24 +471,24 @@ 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 FOR ${index} IN RANGE 60 @@ -499,27 +499,27 @@ EBDP6 END Should Be Equal As Strings ${output} () - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 - Broker Config Output Set central central-broker-unified-sql instance_timeout 10 - Clear Instances + 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 Output Set central central-broker-unified-sql instance_timeout 10 + Ctn Clear Instances ${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} @@ -541,14 +541,14 @@ 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. FOR ${index} IN RANGE 60 @@ -563,15 +563,15 @@ EBDP7 ... "${output[0][0]}" == "0" or "${output[0][1]}" == "1" or "${output[0][2]}" == "1" ... Poller2 should be not running or deleted or outdated. ${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, running, deleted, outdated FROM instances WHERE instance_id=3 @@ -584,22 +584,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} @@ -612,28 +612,28 @@ EBDP8 # We want the poller 3 event handled by broker before stopping broker ${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 3 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 since broker is switched off. 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 ... callbacks: 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 @@ -641,11 +641,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 @@ -653,20 +653,20 @@ EBDP8 END Should Be Equal As Strings ${output} () The Poller3 should be removed from the DB. - 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 in engine logs. ${content} Create List service status (40, 781) thrown away because host 40 is not known by any poller - ${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 *** Keywords *** -Clear Instances +Ctn Clear Instances Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} ${output} Query DELETE FROM instances diff --git a/tests/broker-engine/downtimes.robot b/tests/broker-engine/downtimes.robot index c5c554acfae..8debc501860 100644 --- a/tests/broker-engine/downtimes.robot +++ b/tests/broker-engine/downtimes.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine progressively add services Library Process @@ -19,280 +19,280 @@ Library ../resources/Common.py 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 - - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item module1 bbdo_version 3.0.0 - Broker Config Add Item module2 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 - 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 Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item module1 bbdo_version 3.0.0 + Ctn Broker Config Add Item module2 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 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. # It's time to schedule downtimes - Schedule host fixed downtime ${0} host_1 ${3600} + Ctn Schedule Host Fixed Downtime ${0} host_1 ${3600} - ${result} check number of downtimes ${21} ${start} ${60} + ${result} Ctn Check Number Of Downtimes ${21} ${start} ${60} Should be true ${result} We should have 21 downtimes (1 host + 20 services) enabled. # It's time to delete downtimes - Delete host downtimes ${0} host_1 + Ctn Delete Host Downtimes ${0} host_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 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-36711 - 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 f2f6059713a..ff011170375 100644 --- a/tests/broker-engine/external-commands.robot +++ b/tests/broker-engine/external-commands.robot @@ -1,1289 +1,1289 @@ *** Settings *** -Resource ../resources/resources.robot -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save logs If Failed - -Documentation Centreon Broker and Engine progressively add services -Library DatabaseLibrary -Library Process -Library OperatingSystem -Library DateTime -Library Collections -Library ../resources/Engine.py -Library ../resources/Broker.py -Library ../resources/Common.py +Resource ../resources/resources.robot +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed + +Documentation Centreon Broker and Engine progressively add services +Library DatabaseLibrary +Library Process +Library OperatingSystem +Library DateTime +Library Collections +Library ../resources/Engine.py +Library ../resources/Broker.py +Library ../resources/Common.py *** 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} - 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 300 - Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10.0,),)" - END - Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 + [Tags] Broker Engine services extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 300 + Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10.0,),)" + END + Should Be Equal As Strings ${output} ((10.0,),) + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15.0,),)" - END - Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 + [Tags] Broker Engine services extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15.0,),)" + END + Should Be Equal As Strings ${output} ((15.0,),) + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10.0,),)" - END - Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Normal Host Check Interval ${use_grpc} host_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT check_interval FROM hosts WHERE name='host_1' + ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10.0,),)" + END + Should Be Equal As Strings ${output} ((10.0,),) + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15.0,),)" - END - Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 + [Tags] Broker Engine host extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Normal Host Check Interval ${use_grpc} host_1 15 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT check_interval FROM hosts WHERE name='host_1' + ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15.0,),)" + END + Should Be Equal As Strings ${output} ((15.0,),) + 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} - 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15.0,),)" - END - Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_RETRY_SVC_CHECK_INTERVAL on bbdo3.0 + [Tags] Broker Engine services extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Retry Svc Check Interval ${use_grpc} host_1 service_1 15 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + ${output}= Query SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15.0,),)" + END + Should Be Equal As Strings ${output} ((15.0,),) + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10.0,),)" - END - Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_RETRY_SVC_CHECK_INTERVAL on bbdo2.0 + [Tags] Broker Engine services extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Retry Svc Check Interval ${use_grpc} host_1 service_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + ${output}= Query SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10.0,),)" + END + Should Be Equal As Strings ${output} ((10.0,),) + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT retry_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT retry_interval FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15.0,),)" - END - Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_RETRY_HOST_CHECK_INTERVAL on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Retry Host Check Interval ${use_grpc} host_1 15 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT retry_interval FROM hosts WHERE name='host_1' + ${output}= Query SELECT retry_interval FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15.0,),)" + END + Should Be Equal As Strings ${output} ((15.0,),) + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT retry_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT retry_interval FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10.0,),)" - END - Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_RETRY_HOST_CHECK_INTERVAL on bbdo2.0 + [Tags] Broker Engine host extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Retry Host Check Interval ${use_grpc} host_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT retry_interval FROM hosts WHERE name='host_1' + ${output}= Query SELECT retry_interval FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10.0,),)" + END + Should Be Equal As Strings ${output} ((10.0,),) + 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} - 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15,),)" - END - Should Be Equal As Strings ${output} ((15,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT max_check_attempts FROM resources WHERE name='service_1' AND parent_name='host_1' - ${output}= Query SELECT max_check_attempts FROM resources WHERE name='service_1' AND parent_name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15,),)" - END - Should Be Equal As Strings ${output} ((15,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_MAX_SVC_CHECK_ATTEMPTS on bbdo3.0 + [Tags] Broker Engine services extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Max Svc Check Attempts ${use_grpc} host_1 service_1 15 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + ${output}= Query SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15,),)" + END + Should Be Equal As Strings ${output} ((15,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT max_check_attempts FROM resources WHERE name='service_1' AND parent_name='host_1' + ${output}= Query SELECT max_check_attempts FROM resources WHERE name='service_1' AND parent_name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15,),)" + END + Should Be Equal As Strings ${output} ((15,),) + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10,),)" - END - Should Be Equal As Strings ${output} ((10,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_MAX_SVC_CHECK_ATTEMPTS on bbdo2.0 + [Tags] Broker Engine services extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Max Svc Check Attempts ${use_grpc} host_1 service_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + ${output}= Query SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10,),)" + END + Should Be Equal As Strings ${output} ((10,),) + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT max_check_attempts FROM hosts WHERE name='host_1' - ${output}= Query SELECT max_check_attempts FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15,),)" - END - Should Be Equal As Strings ${output} ((15,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT max_check_attempts FROM resources WHERE name='host_1' - ${output}= Query SELECT max_check_attempts FROM resources WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15,),)" - END - Should Be Equal As Strings ${output} ((15,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_MAX_HOST_CHECK_ATTEMPTS on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Max Host Check Attempts ${use_grpc} host_1 15 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT max_check_attempts FROM hosts WHERE name='host_1' + ${output}= Query SELECT max_check_attempts FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15,),)" + END + Should Be Equal As Strings ${output} ((15,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT max_check_attempts FROM resources WHERE name='host_1' + ${output}= Query SELECT max_check_attempts FROM resources WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15,),)" + END + Should Be Equal As Strings ${output} ((15,),) + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT max_check_attempts FROM hosts WHERE name='host_1' - ${output}= Query SELECT max_check_attempts FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10,),)" - END - Should Be Equal As Strings ${output} ((10,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_MAX_HOST_CHECK_ATTEMPTS on bbdo2.0 + [Tags] Broker Engine host extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Max Host Check Attempts ${use_grpc} host_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT max_check_attempts FROM hosts WHERE name='host_1' + ${output}= Query SELECT max_check_attempts FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10,),)" + END + Should Be Equal As Strings ${output} ((10,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT check_period FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_period FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "(('24x6',),)" - END - Should Be Equal As Strings ${output} (('24x6',),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_HOST_CHECK_TIMEPERIOD on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Host Check Timeperiod ${use_grpc} host_1 24x6 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT check_period FROM hosts WHERE name='host_1' + ${output}= Query SELECT check_period FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "(('24x6',),)" + END + Should Be Equal As Strings ${output} (('24x6',),) + + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT check_period FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_period FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "(('24x6',),)" - END - Should Be Equal As Strings ${output} (('24x6',),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_HOST_CHECK_TIMEPERIOD on bbdo2.0 + [Tags] Broker Engine host extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Host Check Timeperiod ${use_grpc} host_1 24x6 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT check_period FROM hosts WHERE name='host_1' + ${output}= Query SELECT check_period FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "(('24x6',),)" + END + Should Be Equal As Strings ${output} (('24x6',),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT notification_period FROM hosts WHERE name='host_1' - ${output}= Query SELECT notification_period FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "(('24x7',),)" - END - Should Be Equal As Strings ${output} (('24x7',),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_HOST_NOTIFICATION_TIMEPERIOD on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Host Notification Timeperiod ${use_grpc} host_1 24x7 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT notification_period FROM hosts WHERE name='host_1' + ${output}= Query SELECT notification_period FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "(('24x7',),)" + END + Should Be Equal As Strings ${output} (('24x7',),) + + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT notification_period FROM hosts WHERE name='host_1' - ${output}= Query SELECT notification_period FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "(('24x6',),)" - END - Should Be Equal As Strings ${output} (('24x6',),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_HOST_NOTIFICATION_TIMEPERIOD on bbdo2.0 + [Tags] Broker Engine host extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Host Notification Timeperiod ${use_grpc} host_1 24x6 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT notification_period FROM hosts WHERE name='host_1' + ${output}= Query SELECT notification_period FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "(('24x6',),)" + END + Should Be Equal As Strings ${output} (('24x6',),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "(('24x6',),)" - END - Should Be Equal As Strings ${output} (('24x6',),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_SVC_CHECK_TIMEPERIOD on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Svc Check Timeperiod ${use_grpc} host_1 service_1 24x6 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "(('24x6',),)" + END + Should Be Equal As Strings ${output} (('24x6',),) + + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "(('24x7',),)" - END - Should Be Equal As Strings ${output} (('24x7',),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_SVC_CHECK_TIMEPERIOD on bbdo2.0 + [Tags] Broker Engine host extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Svc Check Timeperiod ${use_grpc} host_1 service_1 24x7 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "(('24x7',),)" + END + Should Be Equal As Strings ${output} (('24x7',),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "(('24x7',),)" - END - Should Be Equal As Strings ${output} (('24x7',),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_SVC_NOTIFICATION_TIMEPERIOD on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Svc Notification Timeperiod ${use_grpc} host_1 service_1 24x7 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "(('24x7',),)" + END + Should Be Equal As Strings ${output} (('24x7',),) + + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "(('24x6',),)" - END - Should Be Equal As Strings ${output} (('24x6',),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_SVC_NOTIFICATION_TIMEPERIOD on bbdo2.0 + [Tags] Broker Engine host extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Change Svc Notification Timeperiod ${use_grpc} host_1 service_1 24x6 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "(('24x6',),)" + END + Should Be Equal As Strings ${output} (('24x6',),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - 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 - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - 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' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_AND_CHILD_NOTIFICATIONS and ENABLE_HOST_AND_CHILD_NOTIFICATIONS on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Disable Host And Child Notifications ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT notify FROM hosts WHERE name='host_1' + ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' + ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' + ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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 - 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 - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - 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' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_AND_CHILD_NOTIFICATIONS and ENABLE_HOST_AND_CHILD_NOTIFICATIONS on bbdo2.0 + [Tags] Broker Engine host extcmd + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Disable Host And Child Notifications ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT notify FROM hosts WHERE name='host_1' + ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Check ${use_grpc} host_1 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT active_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT active_checks_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' - ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Enable Host Check ${use_grpc} host_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT active_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT active_checks_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' - ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_CHECK and ENABLE_HOST_CHECK on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Disable Host Check ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT active_checks FROM hosts WHERE name='host_1' + ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT active_checks_enabled FROM resources WHERE name='host_1' + ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' + ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT active_checks_enabled FROM resources WHERE name='host_1' + ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' + ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + 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 - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Check ${use_grpc} host_1 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT active_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' - ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Enable Host Check ${use_grpc} host_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT active_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' - ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_CHECK and ENABLE_HOST_CHECK on bbdo2.0 + [Tags] Broker Engine host extcmd + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Disable Host Check ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT active_checks FROM hosts WHERE name='host_1' + ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' + ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' + ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - FOR ${use_grpc} IN RANGE 0 1 - Clear Retention - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT event_handler_enabled FROM hosts WHERE name='host_1' - ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - 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' - ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_EVENT_HANDLER and ENABLE_HOST_EVENT_HANDLER on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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 + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Disable Host Event Handler ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT event_handler_enabled FROM hosts WHERE name='host_1' + ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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 - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT event_handler_enabled FROM hosts WHERE name='host_1' - ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - 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' - ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_EVENT_HANDLER and ENABLE_HOST_EVENT_HANDLER on bbdo2.0 + [Tags] Broker Engine host extcmd + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Disable Host Event Handler ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT event_handler_enabled FROM hosts WHERE name='host_1' + ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT flap_detection FROM hosts WHERE name='host_1' - ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - 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' - ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_FLAP_DETECTION and ENABLE_HOST_FLAP_DETECTION on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Disable Host Flap Detection ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT flap_detection FROM hosts WHERE name='host_1' + ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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 - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT flap_detection FROM hosts WHERE name='host_1' - ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - 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' - ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_FLAP_DETECTION and ENABLE_HOST_FLAP_DETECTION on bbdo2.0 + [Tags] Broker Engine host extcmd + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Disable Host Flap Detection ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT flap_detection FROM hosts WHERE name='host_1' + ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Notifications ${use_grpc} host_1 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Enable Host Notifications ${use_grpc} host_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_NOTIFICATIONS and ENABLE_HOST_NOTIFICATIONS on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + Ctn Disable Host Notifications ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT notify FROM hosts WHERE name='host_1' + ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' + ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + Ctn Enable Host Notifications ${use_grpc} host_1 + + FOR ${index} IN RANGE 30 + Log To Console SELECT notify FROM hosts WHERE name='host_1' + ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' + ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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 0aea16540b6..fa34aa785db 100644 --- a/tests/broker-engine/external-commands2.robot +++ b/tests/broker-engine/external-commands2.robot @@ -1,1346 +1,1346 @@ *** Settings *** -Resource ../resources/resources.robot -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save logs If Failed - -Documentation Centreon Broker and Engine progressively add services -Library DatabaseLibrary -Library Process -Library OperatingSystem -Library DateTime -Library Collections -Library ../resources/Engine.py -Library ../resources/Broker.py -Library ../resources/Common.py +Resource ../resources/resources.robot +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed + +Documentation Centreon Broker and Engine progressively add services +Library DatabaseLibrary +Library Process +Library OperatingSystem +Library DateTime +Library Collections +Library ../resources/Engine.py +Library ../resources/Broker.py +Library ../resources/Common.py *** 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Notifications ${use_grpc} host_1 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Enable Host Notifications ${use_grpc} host_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_NOTIFICATIONS and ENABLE_HOST_NOTIFICATIONS on bbdo2.0 + [Tags] Broker Engine host extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Disable Host Notifications ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT notify FROM hosts WHERE name='host_1' + ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + Ctn Enable Host Notifications ${use_grpc} host_1 + + FOR ${index} IN RANGE 30 + Log To Console SELECT notify FROM hosts WHERE name='host_1' + ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT active_checks_enabled FROM resources WHERE name='service_1' - ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Enable Host Svc Checks ${use_grpc} host_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT active_checks_enabled FROM resources WHERE name='service_1' - ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_SVC_CHECKS and ENABLE_HOST_SVC_CHECKS on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Disable Host Svc Checks ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT active_checks_enabled FROM resources WHERE name='service_1' + ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + Ctn Enable Host Svc Checks ${use_grpc} host_1 + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT active_checks_enabled FROM resources WHERE name='service_1' + ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + 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 - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Enable Host Svc Checks ${use_grpc} host_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_SVC_CHECKS and ENABLE_HOST_SVC_CHECKS on bbdo2.0 + [Tags] Broker Engine host extcmd + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Disable Host Svc Checks ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + Ctn Enable Host Svc Checks ${use_grpc} host_1 + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Enable Host Svc Notifications ${use_grpc} host_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_SVC_NOTIFICATIONS and ENABLE_HOST_SVC_NOTIFICATIONS on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Disable Host Svc Notifications ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + Ctn Enable Host Svc Notifications ${use_grpc} host_1 + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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 - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Enable Host Svc Notifications ${use_grpc} host_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_HOST_SVC_NOTIFICATIONS and ENABLE_HOST_SVC_NOTIFICATIONS on bbdo2.0 + [Tags] Broker Engine host extcmd + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Disable Host Svc Notifications ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + Ctn Enable Host Svc Notifications ${use_grpc} host_1 + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT passive_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT passive_checks_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - 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' - ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT passive_checks_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_PASSIVE_HOST_CHECKS and ENABLE_PASSIVE_HOST_CHECKS on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Disable Passive Host Checks ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT passive_checks FROM hosts WHERE name='host_1' + ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT passive_checks_enabled FROM resources WHERE name='host_1' + ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT passive_checks_enabled FROM resources WHERE name='host_1' + ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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 - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT passive_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - 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' - ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_PASSIVE_HOST_CHECKS and ENABLE_PASSIVE_HOST_CHECKS on bbdo2.0 + [Tags] Broker Engine host extcmd + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Disable Passive Host Checks ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT passive_checks FROM hosts WHERE name='host_1' + ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT passive_checks_enabled FROM resources WHERE name='service_1' - ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Enable Passive Svc Checks ${use_grpc} host_1 service_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - FOR ${index} IN RANGE 30 - Log To Console SELECT passive_checks_enabled FROM resources WHERE name='service_1' - ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_PASSIVE_SVC_CHECKS and ENABLE_PASSIVE_SVC_CHECKS on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Disable Passive Svc Checks ${use_grpc} host_1 service_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT passive_checks_enabled FROM resources WHERE name='service_1' + ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + Ctn Enable Passive Svc Checks ${use_grpc} host_1 service_1 + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + FOR ${index} IN RANGE 30 + Log To Console SELECT passive_checks_enabled FROM resources WHERE name='service_1' + ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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 - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Enable Passive Svc Checks ${use_grpc} host_1 service_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command DISABLE_PASSIVE_SVC_CHECKS and ENABLE_PASSIVE_SVC_CHECKS on bbdo2.0 + [Tags] Broker Engine host extcmd + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Disable Passive Svc Checks ${use_grpc} host_1 service_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + Ctn Enable Passive Svc Checks ${use_grpc} host_1 service_1 + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT obsess_over_host FROM hosts WHERE name='host_1' - ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - 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' - ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command START_OBSESSING_OVER_HOST and STOP_OBSESSING_OVER_HOST on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Stop Obsessing Over Host ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT obsess_over_host FROM hosts WHERE name='host_1' + ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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 - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT obsess_over_host FROM hosts WHERE name='host_1' - ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - 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' - ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command START_OBSESSING_OVER_HOST and STOP_OBSESSING_OVER_HOST on bbdo2.0 + [Tags] Broker Engine host extcmd + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Stop Obsessing Over Host ${use_grpc} host_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT obsess_over_host FROM hosts WHERE name='host_1' + ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + 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' + ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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} - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - Config Broker Sql Output central unified_sql - Clear Retention - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Start Obsessing Over Svc ${use_grpc} host_1 service_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command START_OBSESSING_OVER_SVC and STOP_OBSESSING_OVER_SVC on bbdo3.0 + [Tags] Broker Engine host extcmd + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker rrd + Ctn Config Broker central + Ctn Config Broker module ${1} + 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 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Stop Obsessing Over Svc ${use_grpc} host_1 service_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + Ctn Start Obsessing Over Svc ${use_grpc} host_1 service_1 + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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 - FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((0,),)" - END - Should Be Equal As Strings ${output} ((0,),) - - Start Obsessing Over Svc ${use_grpc} host_1 service_1 - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((1,),)" - END - Should Be Equal As Strings ${output} ((1,),) - - Stop Engine - Kindly Stop Broker - END + [Documentation] external command START_OBSESSING_OVER_SVC and STOP_OBSESSING_OVER_SVC on bbdo2.0 + [Tags] Broker Engine host extcmd + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Stop Obsessing Over Svc ${use_grpc} host_1 service_1 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((0,),)" + END + Should Be Equal As Strings ${output} ((0,),) + + Ctn Start Obsessing Over Svc ${use_grpc} host_1 service_1 + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((1,),)" + END + Should Be Equal As Strings ${output} ((1,),) + + 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 - 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 300 - Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10.0,),)" - END - Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 and grpc + [Tags] Broker Engine services extcmd + 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 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 300 + Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10.0,),)" + END + Should Be Equal As Strings ${output} ((10.0,),) + 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 - 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 - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15.0,),)" - END - Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 and grpc + [Tags] Broker Engine services extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; + ${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. + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15.0,),)" + END + Should Be Equal As Strings ${output} ((15.0,),) + 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 - 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 core error - Broker Config Log central sql debug - Broker Config Log module0 neb trace - 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 - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10.0,),)" - END - Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 and grpc + [Tags] Broker Engine host extcmd + 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 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; + ${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. + Ctn Change Normal Host Check Interval ${use_grpc} host_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT check_interval FROM hosts WHERE name='host_1' + ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10.0,),)" + END + Should Be Equal As Strings ${output} ((10.0,),) + 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 - 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 - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15.0,),)" - END - Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 and grpc + [Tags] Broker Engine host extcmd + 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; + ${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. + Ctn Change Normal Host Check Interval ${use_grpc} host_1 15 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT check_interval FROM hosts WHERE name='host_1' + ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15.0,),)" + END + Should Be Equal As Strings ${output} ((15.0,),) + 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 - 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 - 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 - ${start}= Get Current Date - Sleep 1s - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 300 - Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10.0,),)" - END - Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 and reversed gRPC + [Tags] Broker Engine services extcmd bbdo3 + 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 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Sleep 1s + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 300 + Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10.0,),)" + END + Should Be Equal As Strings ${output} ((10.0,),) + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15.0,),)" - END - Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 and grpc reversed + [Tags] Broker Engine services extcmd + 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 + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15.0,),)" + END + Should Be Equal As Strings ${output} ((15.0,),) + 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 - 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 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10.0,),)" - END - Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 and grpc reversed + [Tags] Broker Engine host extcmd + 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 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 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 + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Change Normal Host Check Interval ${use_grpc} host_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT check_interval FROM hosts WHERE name='host_1' + ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10.0,),)" + END + Should Be Equal As Strings ${output} ((10.0,),) + 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 30 - Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((15.0,),)" - END - Should Be Equal As Strings ${output} ((15.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 and grpc reversed + [Tags] Broker Engine host extcmd + 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 + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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 + Ctn Change Normal Host Check Interval ${use_grpc} host_1 15 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 30 + Log To Console SELECT check_interval FROM hosts WHERE name='host_1' + ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((15.0,),)" + END + Should Be Equal As Strings ${output} ((15.0,),) + 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 - 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 - 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 - ${start}= Get Current Date - Start Broker - 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 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 300 - Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((10.0,),)" - END - Should Be Equal As Strings ${output} ((10.0,),) - Stop Engine - Kindly Stop Broker - END + [Documentation] external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 and compressed grpc + [Tags] Broker Engine services extcmd + 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 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 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} + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${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. + Ctn Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 300 + Log To Console SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + ${output}= Query SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((10.0,),)" + END + Should Be Equal As Strings ${output} ((10.0,),) + 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 - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. - 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 - Should Be True ${result} msg=command argument notification_option must be an integer between 0 and 7. - Stop Engine - Kindly Stop Broker + [Documentation] external command SEND_CUSTOM_HOST_NOTIFICATION with option_number=1 should work + [Tags] Broker Engine host extcmd Notification atoi + 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 + Ctn Start Broker + Ctn Start Engine + ${content} Create List check_for_external_commands + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. + 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} 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. + 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 - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. - 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 - Should Be True ${result} msg=command argument notification_option must be an integer between 0 and 7. - Stop Engine - Kindly Stop Broker + [Documentation] external command SEND_CUSTOM_HOST_NOTIFICATION with option_number>7 should fail + [Tags] Broker Engine host extcmd Notification atoi + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List check_for_external_commands + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. + 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}= 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. + 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 - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. - ${date}= Get Current Date result_format=epoch - 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 - Should Be True ${result} msg=command argument duration must be an integer >= 0. - Stop Engine - Kindly Stop Broker + [Documentation] external command SCHEDULE SERVICE DOWNTIME with duration<0 should fail + [Tags] Broker Engine host extcmd atoi + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List check_for_external_commands + ${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 + Ctn Schedule Service Downtime host_1 service_1 -1 + ${content}= Create List Error: could not schedule downtime : duration + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} command argument duration must be an integer >= 0. + 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 - ${start}= Get Current Date exclude_millis=True - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. - ADD HOST COMMENT host_1 1 user comment - ${content}= Create List ADD_HOST_COMMENT - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=the comment with id:1 was not added. - ${com_id}= Find Internal Id ${start} True 30 - Should Be True ${com_id}>0 msg=Comment id should be a positive integer. - DEL HOST COMMENT ${com_id} - ${result}= Find Internal Id ${start} False 30 - Should Be True ${result} msg=the comment with id:${com_id} was not deleted. - Stop Engine - Kindly Stop Broker + [Documentation] external command ADD_HOST_COMMENT and DEL_HOST_COMMENT should work + [Tags] Broker Engine host extcmd atoi + 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 + Ctn Start Broker + Ctn Start Engine + ${content} Create List check_for_external_commands + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. + Ctn Add Host Comment host_1 1 user comment + ${content} Create List ADD_HOST_COMMENT + ${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} Ctn Find Internal Id ${start} True 30 + Should Be True ${com_id}>0 Comment id should be a positive integer. + 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. + 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 - ${start}= Get Current Date - Sleep 1s - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. - ADD HOST COMMENT host_1 1 user comment - ${content}= Create List ADD_HOST_COMMENT - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=the comment with id:1 was not added. - ${com_id}= Find Internal Id ${start} True 30 - DEL HOST COMMENT -1 - ${content}= Create List Error: could not delete comment : comment_id - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=comment_id must be an unsigned integer. - ${result}= Find Internal Id ${start} True 30 - Should Be True ${result} msg=comment with id:-1 was deleted. - Stop Engine - Kindly Stop Broker + [Documentation] external command DEL_HOST_COMMENT with comment_id<0 should fail + [Tags] Broker Engine host extcmd atoi + 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 + Ctn Start Broker + Ctn Start Engine + ${content} Create List check_for_external_commands + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. + Ctn Add Host Comment host_1 1 user comment + ${content} Create List ADD_HOST_COMMENT + ${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} Ctn Find Internal Id ${start} True 30 + Ctn Del Host Comment -1 + ${content}= Create List Error: could not delete comment : comment_id + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} comment_id must be an unsigned integer. + ${result}= Ctn Find Internal Id ${start} True 30 + Should Be True ${result} comment with id:-1 was deleted. + 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 - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=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 - ${content}= Create List ADD_SVC_COMMENT - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=command argument persistent_flag must be 0 or 1. - Stop Engine - Kindly Stop Broker + [Documentation] external command ADD_SVC_COMMENT with persistent=0 should work + [Tags] Broker Engine host extcmd atoi + 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 + Ctn Start Broker + Ctn Start Engine + ${content} Create List check_for_external_commands + ${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 + Ctn Add Svc Comment host_1 service_1 0 user comment + ${content} Create List ADD_SVC_COMMENT + ${result} Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} command argument persistent_flag must be 0 or 1. + 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 - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item central bbdo_version 3.0.0 - Config Broker Sql Output central unified_sql - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. - ${date}= Get Current Date result_format=epoch - CHANGE CUSTOM HOST VAR COMMAND host_1 SNMPVERSION 789456 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 300 - Log To Console SELECT c.value FROM customvariables c LEFT JOIN hosts h ON c.host_id=h.host_id WHERE h.name='host_1' && c.name='SNMPVERSION' - ${output}= Query SELECT c.value FROM customvariables c LEFT JOIN hosts h ON c.host_id=h.host_id WHERE h.name='host_1' && c.name='SNMPVERSION' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "(('789456',),)" - END - Should Be Equal As Strings ${output} (('789456',),) - - Stop Engine - Kindly Stop Broker + [Documentation] external command CHANGE_CUSTOM_HOST_VAR on SNMPVERSION + [Tags] Broker Engine host extcmd atoi + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item central bbdo_version 3.0.0 + Ctn Config Broker Sql Output central unified_sql + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List check_for_external_commands + ${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 + Ctn Change Custom Host Var Command host_1 SNMPVERSION 789456 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 300 + Log To Console SELECT c.value FROM customvariables c LEFT JOIN hosts h ON c.host_id=h.host_id WHERE h.name='host_1' && c.name='SNMPVERSION' + ${output}= Query SELECT c.value FROM customvariables c LEFT JOIN hosts h ON c.host_id=h.host_id WHERE h.name='host_1' && c.name='SNMPVERSION' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "(('789456',),)" + END + Should Be Equal As Strings ${output} (('789456',),) + + 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 - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item central bbdo_version 3.0.0 - Config Broker Sql Output central unified_sql - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=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 - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - - FOR ${index} IN RANGE 300 - Log To Console SELECT c.value FROM customvariables c JOIN hosts h ON c.host_id=h.host_id JOIN services s ON c.service_id = s.service_id and h.host_id = s.service_id WHERE h.name='host_1' && s.description = 'service_1' && c.name='CRITICAL' - ${output}= Query SELECT c.value FROM customvariables c JOIN hosts h ON c.host_id=h.host_id JOIN services s ON c.service_id = s.service_id and h.host_id = s.service_id WHERE h.name='host_1' && s.description = 'service_1' && c.name='CRITICAL' - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "(('456123',),)" - END - Should Be Equal As Strings ${output} (('456123',),) - - Stop Engine - Kindly Stop Broker + [Documentation] external command CHANGE_CUSTOM_SVC_VAR on CRITICAL + [Tags] Broker Engine host extcmd atoi + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item central bbdo_version 3.0.0 + Ctn Config Broker Sql Output central unified_sql + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List check_for_external_commands + ${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 + Ctn Change Custom Svc Var Command host_1 service_1 CRITICAL 456123 + + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} + + FOR ${index} IN RANGE 300 + Log To Console SELECT c.value FROM customvariables c JOIN hosts h ON c.host_id=h.host_id JOIN services s ON c.service_id = s.service_id and h.host_id = s.service_id WHERE h.name='host_1' && s.description = 'service_1' && c.name='CRITICAL' + ${output}= Query SELECT c.value FROM customvariables c JOIN hosts h ON c.host_id=h.host_id JOIN services s ON c.service_id = s.service_id and h.host_id = s.service_id WHERE h.name='host_1' && s.description = 'service_1' && c.name='CRITICAL' + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "(('456123',),)" + END + Should Be Equal As Strings ${output} (('456123',),) + + 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 - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item central bbdo_version 3.0.0 - Config Broker Sql Output central unified_sql - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=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 host_1 service_1 30 ${VarRoot}/lib/centreon-engine/check.pl --id ${command_param} - Should Be True ${result} msg=service table not updated + [Documentation] external command CHECK_SERVICE_RESULT + [Tags] Broker Engine host extcmd atoi + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item central bbdo_version 3.0.0 + Ctn Config Broker Sql Output central unified_sql + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List check_for_external_commands + ${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 + 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 ${VarRoot}/lib/centreon-engine/check.pl --id ${command_param} + Should Be True ${result} service table not updated BEHOSTCHECK - [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 - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item central bbdo_version 3.0.0 - Config Broker Sql Output central unified_sql - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=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 - Should Be True ${result} msg=hosts table not updated + [Documentation] external command CHECK_SERVICE_RESULT + [Tags] Broker Engine host extcmd atoi + Ctn Config Engine ${1} ${50} ${20} + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item central bbdo_version 3.0.0 + Ctn Config Broker Sql Output central unified_sql + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List check_for_external_commands + ${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' + 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 3650542d342..3a6b3fb9f2a 100644 --- a/tests/broker-engine/hostgroups.robot +++ b/tests/broker-engine/hostgroups.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine add Hostgroup Library DatabaseLibrary @@ -19,168 +19,168 @@ Library ../resources/Common.py 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} msg=One of the new host groups not found in logs. - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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} msg=One of the new host groups not found in logs. - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item module1 bbdo_version 3.0.0 - Broker Config Add Item module2 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 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 Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item module1 bbdo_version 3.0.0 + Ctn Broker Config Add Item module2 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 - 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} msg=One of the new host groups not found in logs. - Stop Engine - Kindly stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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} - - 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 - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item module1 bbdo_version 3.0.0 - Broker Config Add Item module2 bbdo_version 3.0.0 - Broker Config Add Item module3 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 + 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 Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item module1 bbdo_version 3.0.0 + Ctn Broker Config Add Item module2 bbdo_version 3.0.0 + Ctn Broker Config Add Item module3 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 ${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} msg=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} msg=We should have 12 hosts members of host 1. - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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} msg=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} @@ -194,42 +194,42 @@ EBNHG4 END Should Be Equal As Strings ${output} (('hostgroup_test',),) - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker EBNHGU4 [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 - 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 + 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} msg=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} @@ -243,5 +243,5 @@ EBNHGU4 END Should Be Equal As Strings ${output} (('hostgroup_test',),) - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/hosts-with-notes-and-actions.robot b/tests/broker-engine/hosts-with-notes-and-actions.robot index 9d112471aa8..f43511cd802 100644 --- a/tests/broker-engine/hosts-with-notes-and-actions.robot +++ b/tests/broker-engine/hosts-with-notes-and-actions.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine Creation of hosts with long action_url, notes and notes_url. Library DatabaseLibrary @@ -19,20 +19,20 @@ Library ../resources/Common.py 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} - 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 - 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 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 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 @@ -47,26 +47,26 @@ EBSNU1 EXIT FOR LOOP IF "${output}" == "(('${nu}',),)" 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} - 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 - 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 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 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 @@ -81,26 +81,26 @@ EBSAU2 EXIT FOR LOOP IF "${output}" == "(('${au}',),)" 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} - 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 - 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 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 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 @@ -115,5 +115,5 @@ EBSN3 EXIT FOR LOOP IF "${output}" == "(('${n}',),)" 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 429249da2be..03d5c9af841 100644 --- a/tests/broker-engine/log-v2_engine.robot +++ b/tests/broker-engine/log-v2_engine.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine log_v2 Library DatabaseLibrary @@ -19,30 +19,30 @@ Library ../resources/Common.py 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} msg=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} msg=No message telling configuration loaded. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -55,39 +55,39 @@ LOGV2EB1 EXIT FOR LOOP IF "${output}" == "((1,),)" 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} msg=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} msg=No message telling configuration loaded. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -100,38 +100,38 @@ LOGV2EBU1 EXIT FOR LOOP IF "${output}" == "((1,),)" 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} msg=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} msg=Old logs should be enabled. @@ -145,36 +145,36 @@ LOGV2DB1 EXIT FOR LOOP IF "${output}" == "((1,),)" 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} msg=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} @@ -188,37 +188,37 @@ LOGV2DB2 EXIT FOR LOOP IF "${output}" == "((0,),)" 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} msg=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} @@ -233,38 +233,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} msg=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} @@ -279,136 +279,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} msg=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} msg=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} msg=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} msg=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} msg=Engine and Broker not connected ${pid}= Get Process Id e0 ${content_v2}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. @@ -416,7 +416,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} msg=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/notification-unstable.robot b/tests/broker-engine/notification-unstable.robot index 191ad2a4153..39e4e238264 100644 --- a/tests/broker-engine/notification-unstable.robot +++ b/tests/broker-engine/notification-unstable.robot @@ -11,347 +11,347 @@ Library ../resources/Engine.py Library ../resources/Broker.py Library ../resources/Common.py -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. @@ -359,40 +359,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. @@ -400,40 +400,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. @@ -441,40 +441,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. @@ -482,52 +482,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. @@ -535,242 +535,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 1a2f1b6a1da..64fd64998f5 100644 --- a/tests/broker-engine/output-tables.robot +++ b/tests/broker-engine/output-tables.robot @@ -1,231 +1,231 @@ *** Settings *** -Resource ../resources/resources.robot -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save logs If Failed - -Documentation Engine/Broker tests on bbdo_version 3.0.0 and protobuf bbdo embedded events. -Library Process -Library String -Library DateTime -Library DatabaseLibrary -Library OperatingSystem -Library ../resources/Engine.py -Library ../resources/Broker.py -Library ../resources/Common.py -Library ../resources/specific-duplication.py +Resource ../resources/resources.robot +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed + +Documentation Engine/Broker tests on bbdo_version 3.0.0 and protobuf bbdo embedded events. +Library Process +Library String +Library DateTime +Library DatabaseLibrary +Library OperatingSystem +Library ../resources/Engine.py +Library ../resources/Broker.py +Library ../resources/Common.py +Library ../resources/specific-duplication.py *** 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 - 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 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 - ${start}= Get Current Date - Sleep 1s - Start Broker - 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 - Should Be True ${result} msg=no updates concerning resources available. - FOR ${l} IN ${content_not_present} - ${result}= Find In Log ${centralLog} ${start} ${content_not_present} - Should Not Be True ${result[0]} msg=There are updates of hosts/services table(s). + [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 + 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 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 + 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}= 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}= 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 - 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 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 - ${start}= Get Current Date - Start Broker - Start Engine - ${content_present}= Create List UPDATE hosts SET checked= UPDATE services SET checked= - ${content_not_present}= Create List INSERT INTO resources UPDATE resources SET UPDATE tags INSERT INTO tags UPDATE severities INSERT INTO severities - ${result}= Find In log With Timeout ${centralLog} ${start} ${content_present} 60 - Should Be True ${result} msg=no updates concerning hosts/services available. - FOR ${l} IN ${content_not_present} - ${result}= Find In Log ${centralLog} ${start} ${content_not_present} - Should Not Be True ${result[0]} msg=There are updates of the resources table. + [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 + 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 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 + 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 UPDATE resources SET UPDATE tags INSERT INTO tags UPDATE severities INSERT INTO severities + ${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}= 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 - - Config Broker central - Config Broker module ${1} - Broker Config Log central sql trace - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item central bbdo_version 3.0.0 - Config Broker Sql Output central unified_sql - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. - ${result}= check_field_db_value SELECT global_host_event_handler FROM instances WHERE instance_id=1 command_1 30 - Should Be True ${result} msg=global_host_event_handler not updated. - ${result}= check_field_db_value SELECT global_service_event_handler FROM instances WHERE instance_id=1 command_2 2 - Should Be True ${result} msg=global_service_event_handler not updated. - ${result}= check_field_db_value SELECT flap_detection FROM instances WHERE instance_id=1 ${1} 3 - Should Be True ${result} msg=flap_detection not updated. - ${result}= check_field_db_value SELECT notifications FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=notifications not updated. - ${result}= check_field_db_value SELECT active_host_checks FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=active_host_checks not updated. - ${result}= check_field_db_value SELECT active_service_checks FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=active_service_checks not updated. - ${result}= check_field_db_value SELECT check_hosts_freshness FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=check_hosts_freshness not updated. - ${result}= check_field_db_value SELECT check_services_freshness FROM instances WHERE instance_id=1 ${1} 3 - Should Be True ${result} msg=check_services_freshness not updated. - ${result}= check_field_db_value SELECT obsess_over_hosts FROM instances WHERE instance_id=1 ${1} 3 - Should Be True ${result} msg=obsess_over_hosts not updated. - ${result}= check_field_db_value SELECT obsess_over_services FROM instances WHERE instance_id=1 ${1} 3 - Should Be True ${result} msg=obsess_over_services not updated. - ${result}= check_field_db_value SELECT passive_host_checks FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=passive_host_checks not updated. - ${result}= check_field_db_value SELECT passive_service_checks FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=passive_service_checks not updated. - Stop Engine - Kindly Stop Broker + [Documentation] Instance status to bdd + [Tags] Broker Engine + 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 + + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item central bbdo_version 3.0.0 + Ctn Config Broker Sql Output central unified_sql + ${start}= Get Current Date + Ctn Start Broker + Ctn Start Engine + ${content}= Create List check_for_external_commands + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. + ${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}= 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}= 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}= Ctn Check Field Db Value SELECT notifications FROM instances WHERE instance_id=1 ${0} 3 + Should Be True ${result} notifications not updated. + ${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}= 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}= 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}= 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}= 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}= 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}= 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}= 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. + Ctn Stop Engine + Ctn Kindly Stop Broker BEINSTANCE - [Documentation] Instance to bdd - [Tags] Broker Engine - Config Engine ${1} ${50} ${20} - - Config Broker central - Config Broker module ${1} - Broker Config Log central sql trace - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item central bbdo_version 3.0.0 - 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 - Should Be True ${result} msg=no correct engine pid in instances table. - ${result}= check_field_db_value SELECT engine FROM instances WHERE instance_id=1 Centreon Engine 3 - Should Be True ${result} msg=no correct engine in instances table. - ${result}= check_field_db_value SELECT running FROM instances WHERE instance_id=1 ${1} 3 - Should Be True ${result} msg=no correct running in instances table. - ${result}= check_field_db_value SELECT name FROM instances WHERE instance_id=1 Poller0 3 - Should Be True ${result} msg=no correct name in instances table. - ${result}= check_field_db_value SELECT end_time FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=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 - Should Be True ${start} <= ${bdd_start_time[0][0]} and ${bdd_start_time[0][0]} <= ${now} sg=no correct start_time in instances table. + [Documentation] Instance to bdd + [Tags] Broker Engine + Ctn Config Engine ${1} ${50} ${20} + + Ctn Config Broker central + Ctn Config Broker module ${1} + Ctn Broker Config Log central sql trace + Ctn Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item central bbdo_version 3.0.0 + 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}= 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}= 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}= 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}= 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}= 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}= 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. 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 - - Clear Retention - - Start Broker - 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 - Should Be True ${result} msg=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 - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 30 - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected - - Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - ${output}= Query 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 msg=notification_number is not null - - Stop Engine - Kindly Stop Broker + [Documentation] bbdo 2.0 notification number =40000. make an overflow => notification_number null in db + [Tags] Broker Engine protobuf bbdo + 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 + + Ctn Clear Retention + + Ctn Start Broker + Ctn Start Engine + + ${start}= Get Current Date + ${content}= Create List INITIAL SERVICE STATE: host_16;service_314; + ${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. + + Ctn Set Svc Notification Number host_16 service_314 40000 + Repeat Keyword 3 times Ctn Process Service Check Result 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} + ${output}= Query 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 + + Ctn Stop Engine + Ctn Kindly Stop Broker BE_TIME_NULL_SERVICE_RESOURCE - [Documentation] With BBDO 3, 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 - - 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 - - Start Broker - Start Engine - - FOR ${index} IN RANGE 300 - ${output}= Query SELECT r.last_status_change, s.last_hard_state_change, s.last_notification, s.next_notification , s.last_state_change, s.last_time_critical, s.last_time_ok, s.last_time_unknown, s.last_time_warning, h.last_hard_state_change, h.last_notification, h.next_host_notification, h.last_state_change, h.last_time_down, h.last_time_unreachable, h.last_time_up FROM services s, resources r, hosts h WHERE h.host_id=1 AND s.service_id=1 AND r.id=1 AND r.parent_id=1 - Log To Console ${output} - Sleep 1s - EXIT FOR LOOP IF "${output}" == "((None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None),)" - END - 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 + [Documentation] With BBDO 3, time must be set to NULL on 0 in services, hosts and resources tables. + [Tags] Broker Engine protobuf bbdo + 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 + + Ctn Clear Retention + + Ctn Start Broker + Ctn Start Engine + + FOR ${index} IN RANGE 300 + ${output}= Query SELECT r.last_status_change, s.last_hard_state_change, s.last_notification, s.next_notification , s.last_state_change, s.last_time_critical, s.last_time_ok, s.last_time_unknown, s.last_time_warning, h.last_hard_state_change, h.last_notification, h.next_host_notification, h.last_state_change, h.last_time_down, h.last_time_unreachable, h.last_time_up FROM services s, resources r, hosts h WHERE h.host_id=1 AND s.service_id=1 AND r.id=1 AND r.parent_id=1 + Log To Console ${output} + Sleep 1s + EXIT FOR LOOP IF "${output}" == "((None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None),)" + END + Should Be Equal As Strings ${output} ((None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None),) + Ctn Stop Engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/retention-duplicates.robot b/tests/broker-engine/retention-duplicates.robot index f1237389157..f9f24b467e6 100644 --- a/tests/broker-engine/retention-duplicates.robot +++ b/tests/broker-engine/retention-duplicates.robot @@ -10,442 +10,442 @@ Library ../resources/Broker.py Library ../resources/Common.py Library ../resources/specific-duplication.py -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} msg=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} msg=Lua not started in centengine - ${result}= Check Connections + ${result}= Ctn Check Connections Should Be True ${result} msg=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} msg=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} msg=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} msg=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} msg=Lua not started in centengine - ${result}= Check Connections + ${result}= Ctn Check Connections Should Be True ${result} msg=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} msg=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} msg=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} msg=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} msg=Lua not started in centengine - ${result}= Check Connections + ${result}= Ctn Check Connections Should Be True ${result} msg=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} msg=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} msg=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} msg=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} msg=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} msg=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} msg=Lua not started in centengine - ${result}= Check Connections + ${result}= Ctn Check Connections Should Be True ${result} msg=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} msg=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} msg=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} msg=Lua not started in centengine - ${result}= Check Connections + ${result}= Ctn Check Connections Should Be True ${result} msg=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} msg=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 Log module0 lua debug - 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 - 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 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 + 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} msg=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} msg=Lua not started in centengine - ${result}= Check Connections + ${result}= Ctn Check Connections Should Be True ${result} msg=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} msg=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 - 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 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 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 # 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} msg=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} msg=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]} msg=We did not get any pb service status for 60s - ${result}= Check Connections + ${result}= Ctn Check Connections Should Be True ${result} msg=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} msg=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} msg=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} msg=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} msg=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]} msg=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]} msg=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 - Broker Config Add Item module0 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 + 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.1 + Ctn Broker Config Add Item central bbdo_version 3.0.1 + Ctn Broker Config Add Item rrd bbdo_version 3.0.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} msg=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} msg=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} msg=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]} msg=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]} msg=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 f742ffb5fc0..f0f103c76c2 100644 --- a/tests/broker-engine/reverse-connection.robot +++ b/tests/broker-engine/reverse-connection.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine communication with or without compression Library Process @@ -19,28 +19,28 @@ Library ../resources/Common.py 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 - ${result}= Check Connections + Ctn Start Broker + Ctn Start Engine + ${result}= Ctn Check Connections Should Be True ${result} msg=Engine and Broker not connected - 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} msg=Connection to map has failed. File Should Not Exist ${VarRoot}/lib/centreon-broker/central-broker-master.queue.centreon-broker-master-map* msg=There should not exist que map files. @@ -48,27 +48,27 @@ 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 - ${result}= Check Connections + Ctn Start Broker + Ctn Start Engine + ${result}= Ctn Check Connections Should Be True ${result} msg=Engine and Broker not connected - 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} msg=Connection to map has failed File Should Not Exist ${VarRoot}/lib/centreon-broker/central-broker-master.queue.centreon-broker-master-map* msg=There should not exist queue map files. @@ -76,25 +76,25 @@ 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 - ${result}= Check Connections + Ctn Start Broker + Ctn Start Engine + ${result}= Ctn Check Connections Should Be True ${result} msg=Engine and Broker not connected - 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} msg=Connection to map has failed File Should Not Exist ${VarRoot}/lib/centreon-broker/central-broker-master.queue.centreon-broker-master-map-2 msg=There should not exist queue map files. @@ -102,32 +102,32 @@ 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 - ${result}= Check Connections + Ctn Start Engine + ${result}= Ctn Check Connections Should Be True ${result} msg=Engine and Broker not connected # 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} msg=Filters badly applied in Broker # We should have exactly 1000 pb_service @@ -140,36 +140,36 @@ 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 storages filters [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", "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 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"]} + 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 - ${result}= Check Connections + Ctn Start Engine + ${result}= Ctn Check Connections Should Be True ${result} msg=Engine and Broker not connected # 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} msg=Filters badly applied in Broker # We should have 1000 pb_service with maybe some BAs @@ -187,16 +187,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} msg=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 6b238769d00..6700d87280e 100644 --- a/tests/broker-engine/rrd-from-db.robot +++ b/tests/broker-engine/rrd-from-db.robot @@ -11,47 +11,47 @@ Library ../resources/Engine.py Library ../resources/Broker.py Library ../resources/Common.py -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 *** BRRDDMDB1 [Documentation] RRD metrics deletion from metric ids with a query in centreon_storage. [Tags] rrd metric deletion unified_sql mysql - Start 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 Start Mysql + 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} msg=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} msg=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 @@ -61,39 +61,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} msg=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} msg=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 @@ -107,45 +107,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} msg=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} msg=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} msg=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} msg=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} ... msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. @@ -154,47 +154,47 @@ 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 - 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 - 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 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 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} msg=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} msg=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} msg=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} msg=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} ... msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. @@ -203,44 +203,44 @@ 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 - Clear Db data_bin - 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 Clear Db data_bin + 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} msg=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} msg=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} msg=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} msg=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} msg=at least one metric contains NaN value diff --git a/tests/broker-engine/rrd.robot b/tests/broker-engine/rrd.robot index a8b45eb31f1..7ba6e2c9ddc 100644 --- a/tests/broker-engine/rrd.robot +++ b/tests/broker-engine/rrd.robot @@ -11,44 +11,44 @@ Library ../resources/Engine.py Library ../resources/Broker.py Library ../resources/Common.py -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 - Start Mysql - 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 Start Mysql + 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} msg=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]} msg=No log message telling about some metrics deletion. # We should have one line, but stored in an array. @@ -66,57 +66,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} msg=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} msg=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} msg=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]} msg=No log message telling about indexes ${indexes_str} deletion. # We should have one line, but stored in an array. FOR ${l} IN @{result[1]} @@ -138,29 +138,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} msg=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} ... msg=A message telling indexes nor metrics appear in the storage database should appear. @@ -168,34 +168,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} msg=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]} msg=No log message telling about metrics ${metrics_str} deletion. # We should have one line, but stored in an array. @@ -212,34 +212,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} msg=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]} msg=No log message telling about indexes ${indexes_str} deletion. # We should have one line, but stored in an array. FOR ${l} IN @{result[1]} @@ -259,30 +259,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} msg=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} ... msg=A message telling indexes nor metrics appear in the storage database should appear. @@ -290,46 +290,46 @@ 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 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 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} msg=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} msg=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} msg=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} msg=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} msg=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} ... msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. @@ -338,90 +338,90 @@ 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} msg=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} msg=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} msg=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} msg=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} msg=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 Rrd_1 [Documentation] RRD metric rebuild with gRPC API. 3 non existing indexes ids are selected then a 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 diff --git a/tests/broker-engine/rrdcached-from-db.robot b/tests/broker-engine/rrdcached-from-db.robot index 3165c5ab06d..919b0e59123 100644 --- a/tests/broker-engine/rrdcached-from-db.robot +++ b/tests/broker-engine/rrdcached-from-db.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker RRD metric deletion from the legacy query made by the php with rrdcached. Library DatabaseLibrary @@ -17,40 +17,40 @@ Library ../resources/Common.py *** Test Cases *** BRRDCDDMDB1 - Start Mysql + Ctn Start Mysql [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} msg=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} msg=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 @@ -60,40 +60,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} msg=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} msg=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 @@ -107,93 +107,93 @@ 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} msg=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} msg=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} msg=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} msg=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} msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. END 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 - 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 - 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 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 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} msg=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} msg=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} msg=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} msg=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} msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. END diff --git a/tests/broker-engine/rrdcached.robot b/tests/broker-engine/rrdcached.robot index 3223ecabf13..d777028f788 100644 --- a/tests/broker-engine/rrdcached.robot +++ b/tests/broker-engine/rrdcached.robot @@ -1,328 +1,328 @@ *** Settings *** -Resource ../resources/resources.robot -Suite Setup Clean Before Suite With rrdcached -Suite Teardown Clean After Suite With rrdcached -Test Setup Stop Processes -Test Teardown Save logs If Failed - -Documentation Centreon Broker RRD metric rebuild/deletion with rrdcached -Library DatabaseLibrary -Library Process -Library OperatingSystem -Library DateTime -Library Collections -Library ../resources/Engine.py -Library ../resources/Broker.py -Library ../resources/Common.py +Resource ../resources/resources.robot +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 + +Documentation Centreon Broker RRD metric rebuild/deletion with rrdcached +Library DatabaseLibrary +Library Process +Library OperatingSystem +Library DateTime +Library Collections +Library ../resources/Engine.py +Library ../resources/Broker.py +Library ../resources/Common.py *** Test Cases *** BRRDCDDM1 - Start Mysql - [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 - ${start}= Get Current Date - Start Broker - Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - - # We choose 3 metrics to remove. - ${metrics}= Get Metrics To Delete 3 - Log To Console Metrics to delete ${metrics} - - ${empty}= Create List - 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 - Should Be True ${result} msg=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 - Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s - END + Ctn Start Mysql + [Documentation] RRD metrics deletion from metric ids with rrdcached. + [Tags] RRD metric deletion rrdcached + 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 + 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}= Ctn Get Metrics To Delete 3 + Log To Console Metrics to delete ${metrics} + + ${empty}= Create List + Ctn Remove Graphs 51001 ${empty} ${metrics} + ${metrics_str}= Catenate SEPARATOR=, @{metrics} + ${content}= Create List metrics ${metrics_str} erased from database + + ${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 + Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s + END 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 - - ${start}= Get Current Date - Sleep 1s - Start Broker - Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - - ${indexes}= Get Indexes To Delete 2 - ${metrics}= Get Metrics Matching Indexes ${indexes} - Log To Console indexes ${indexes} to delete with their metrics - - ${empty}= Create List - 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 - Should Be True ${result} msg=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 - Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s - END - FOR ${m} IN @{metrics} - log to console Wait for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted - Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s - END + [Documentation] RRD metrics deletion from index ids with rrdcached. + [Tags] RRD metric deletion rrdcached + 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 + Ctn Start Broker + Ctn Start Engine + ${result}= Ctn Check Connections + Should Be True ${result} Engine and Broker not connected + + ${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 + Ctn Remove Graphs 51001 ${indexes} ${empty} + ${indexes_str}= Catenate SEPARATOR=, @{indexes} + ${content}= Create List indexes ${indexes_str} erased from database + + ${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 + Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s + END + FOR ${m} IN @{metrics} + log to console Wait for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted + Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s + END 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 - - ${start}= Get Current Date - Start Broker - Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - - ${indexes}= Get Not Existing Indexes 2 - ${metrics}= 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} - ${content}= Create List do not appear in the storage database - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=A message telling indexes nor metrics appear in the storage database should appear. + [Documentation] RRD deletion of non existing metrics and indexes with rrdcached + [Tags] RRD metric deletion rrdcached + 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 + Ctn Start Broker + Ctn Start Engine + ${result}= Ctn Check Connections + Should Be True ${result} Engine and Broker not connected + + ${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. + + Ctn Remove Graphs 51001 ${indexes} ${metrics} + ${content}= Create List do not appear in the storage database + ${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. 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 - - ${start}= Get Current Date - Start Broker - Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - - # We choose 3 metrics to remove. - ${metrics}= Get Metrics To Delete 3 - Log To Console metrics to delete ${metrics} - - ${empty}= Create List - 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 - Should Be True ${result} msg=No log message telling about metrics ${metrics_str} deletion. - FOR ${m} IN @{metrics} - Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s - END + [Documentation] RRD metric deletion on table metric with unified sql output with rrdcached + [Tags] RRD metric deletion unified_sql rrdcached + 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 + 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}= Ctn Get Metrics To Delete 3 + Log To Console metrics to delete ${metrics} + + ${empty}= Create List + Ctn Remove Graphs 51001 ${empty} ${metrics} + ${metrics_str}= Catenate SEPARATOR=, @{metrics} + ${content}= Create List metrics ${metrics_str} erased from database + + ${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 + END 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 - - ${start}= Get Current Date - Start Broker - Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - - ${indexes}= Get Indexes To Delete 2 - ${metrics}= Get Metrics Matching Indexes ${indexes} - Log To Console indexes ${indexes} to delete with their metrics - - ${empty}= Create List - 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 - Should Be True ${result} msg=No log message telling about indexes ${indexes_str} deletion. - FOR ${i} IN @{indexes} - Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s - END - FOR ${m} IN @{metrics} - Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s - END + [Documentation] RRD metrics deletion from index ids with unified sql output with rrdcached. + [Tags] RRD metric deletion unified_sql rrdcached + 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 + Ctn Start Broker + Ctn Start Engine + ${result}= Ctn Check Connections + Should Be True ${result} Engine and Broker not connected + + ${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 + Ctn Remove Graphs 51001 ${indexes} ${empty} + ${indexes_str}= Catenate SEPARATOR=, @{indexes} + ${content}= Create List indexes ${indexes_str} erased from database + + ${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 + END + FOR ${m} IN @{metrics} + Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s + END 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 - - ${start}= Get Current Date - Start Broker - Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - - ${indexes}= Get Not Existing Indexes 2 - ${metrics}= 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} - ${content}= Create List do not appear in the storage database - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=A message telling indexes nor metrics appear in the storage database should appear. + [Documentation] RRD deletion of non existing metrics and indexes with rrdcached + [Tags] RRD metric deletion unified_sql rrdcached + 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 + Ctn Start Broker + Ctn Start Engine + ${result}= Ctn Check Connections + Should Be True ${result} Engine and Broker not connected + + ${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. + + Ctn Remove Graphs 51001 ${indexes} ${metrics} + ${content}= Create List do not appear in the storage database + ${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. 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 - - ${start}= Get Current Date - Start Broker - Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - - # We get 3 indexes to rebuild - ${index}= Get Indexes To Rebuild 3 - Rebuild Rrd Graphs 51001 ${index} 1 - Log To Console Indexes to rebuild: ${index} - ${metrics}= 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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild END - FOR ${m} IN @{metrics} - ${value}= Evaluate ${m} / 2 - ${result}= Compare RRD Average Value ${m} ${value} - Should Be True ${result} msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. - END + [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 + 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 + 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}= Ctn Get Indexes To Rebuild 3 + Ctn Rebuild Rrd Graphs 51001 ${index} 1 + Log To Console Indexes to rebuild: ${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}= 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}= 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}= 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}= 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}= 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. + END 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 - - ${start}= Get Current Date - Start Broker - Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - - # We get 3 indexes to rebuild - ${index}= Get Indexes To Rebuild 3 - Rebuild Rrd Graphs 51001 ${index} 1 - Log To Console Indexes to rebuild: ${index} - ${metrics}= 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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=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 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild END - FOR ${m} IN @{metrics} - ${value}= Evaluate ${m} / 2 - ${result}= Compare RRD Average Value ${m} ${value} - Should Be True ${result} msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. + [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 + 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 + 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}= Ctn Get Indexes To Rebuild 3 + Ctn Rebuild Rrd Graphs 51001 ${index} 1 + Log To Console Indexes to rebuild: ${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}= 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}= 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}= 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}= 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}= 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. END diff --git a/tests/broker-engine/scheduler.robot b/tests/broker-engine/scheduler.robot index 0170eeebc65..a6d9c7ffe9c 100644 --- a/tests/broker-engine/scheduler.robot +++ b/tests/broker-engine/scheduler.robot @@ -11,43 +11,43 @@ Library ../resources/Engine.py Library ../resources/Broker.py Library ../resources/Common.py -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 3dcbc68ce44..d719e6b7733 100644 --- a/tests/broker-engine/servicegroups.robot +++ b/tests/broker-engine/servicegroups.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine add servicegroup Library Process @@ -18,102 +18,102 @@ Library ../resources/Common.py 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 ${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} msg=One of the new service groups not found in logs. - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 ${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} msg=One of the new service groups not found in logs. - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker 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 - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item module1 bbdo_version 3.0.0 - Broker Config Add Item module2 bbdo_version 3.0.0 - Broker Config Add Item module3 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 - - 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 Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item module1 bbdo_version 3.0.0 + Ctn Broker Config Add Item module2 bbdo_version 3.0.0 + Ctn Broker Config Add Item module3 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 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} msg=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} msg=We should get 9 relations between the servicegroup 1 and services. - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/services-and-bulk-stmt.robot b/tests/broker-engine/services-and-bulk-stmt.robot index 39bac82afc4..786048f1dd7 100644 --- a/tests/broker-engine/services-and-bulk-stmt.robot +++ b/tests/broker-engine/services-and-bulk-stmt.robot @@ -13,45 +13,45 @@ Library ../resources/Engine.py Library ../resources/Broker.py Library ../resources/Common.py -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 ... Unified sql stream 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} @@ -67,28 +67,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 ... Unified sql stream 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} @@ -106,35 +106,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 ... Unified sql stream 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} @@ -150,27 +150,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 ... Unified sql stream 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} @@ -188,37 +188,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. @@ -234,59 +234,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) @@ -301,20 +301,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 @@ -332,30 +332,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) @@ -372,20 +372,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 @@ -395,39 +395,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} @@ -438,10 +438,10 @@ Services_and_bulks_${id} ${content} Create List perfdata on connection ${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 -- @@ -450,7 +450,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 5d7beb6abac..6a5c6be3e46 100644 --- a/tests/broker-engine/services-increased.robot +++ b/tests/broker-engine/services-increased.robot @@ -11,109 +11,109 @@ Library ../resources/Engine.py Library ../resources/Broker.py Library ../resources/Common.py -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} - 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 central bbdo_version 3.0.1 - Broker Config Add Item rrd bbdo_version 3.0.1 - 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 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 central bbdo_version 3.0.1 + Ctn Broker Config Add Item rrd bbdo_version 3.0.1 + 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 - Broker Config Add Item module0 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 - 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 Broker Config Add Item module0 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 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} @@ -122,40 +122,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 c8a46ba0687..54b0d6ff88b 100644 --- a/tests/broker-engine/services-with-notes-and-actions.robot +++ b/tests/broker-engine/services-with-notes-and-actions.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine progressively add services Library DatabaseLibrary @@ -19,21 +19,21 @@ Library ../resources/Common.py 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} - Broker Config Add Item module0 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 - 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 Broker Config Add Item module0 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 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 @@ -48,27 +48,27 @@ EBSNU1 EXIT FOR LOOP IF "${output}" == "(('${nu}',),)" 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} - Broker Config Add Item module0 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 - 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 Broker Config Add Item module0 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 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 @@ -83,27 +83,27 @@ EBSAU2 EXIT FOR LOOP IF "${output}" == "(('${au}',),)" 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} - Broker Config Add Item module0 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 - 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 Broker Config Add Item module0 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 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 @@ -118,5 +118,5 @@ EBSN3 EXIT FOR LOOP IF "${output}" == "(('${n}',),)" 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 46b0698389d..5971bceb624 100644 --- a/tests/broker-engine/services.robot +++ b/tests/broker-engine/services.robot @@ -11,45 +11,45 @@ Library ../resources/Engine.py Library ../resources/Broker.py Library ../resources/Common.py -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} - 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 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 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 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} msg=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} @@ -62,5 +62,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 83b535876bb..b736a3d36ad 100644 --- a/tests/broker-engine/start-stop.robot +++ b/tests/broker-engine/start-stop.robot @@ -1,426 +1,426 @@ *** Settings *** -Resource ../resources/resources.robot -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save logs If Failed +Resource ../resources/resources.robot +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed -Documentation Centreon Broker and Engine start/stop tests -Library Process -Library DateTime -Library OperatingSystem -Library DateTime -Library ../resources/Engine.py -Library ../resources/Broker.py -Library ../resources/Common.py +Documentation Centreon Broker and Engine start/stop tests +Library Process +Library DateTime +Library OperatingSystem +Library DateTime +Library ../resources/Engine.py +Library ../resources/Broker.py +Library ../resources/Common.py *** 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 - Should Be True ${result} - Kindly Stop Broker - Stop Engine + [Documentation] Start-Stop Broker/Engine - Broker started first - Broker stopped first + [Tags] Broker Engine start-stop + 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} + 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 - Should Be True ${result} - ${result}= Check Poller Enabled In Database 1 10 - Should Be True ${result} - Stop Engine - ${result}= Check Poller Disabled In Database 1 10 - Should Be True ${result} - Kindly Stop Broker + [Documentation] Start-Stop Broker/Engine - Broker started first - Engine stopped first + [Tags] Broker Engine start-stop + 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}= Ctn Check Poller Enabled In Database 1 10 + Should Be True ${result} + Ctn Stop Engine + ${result}= Ctn Check Poller Disabled In Database 1 10 + Should Be True ${result} + 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 - Should Be True ${result} - ${result}= Check Poller Enabled In Database 1 10 - Should Be True ${result} - Stop Engine - ${result}= Check Poller Disabled In Database 1 10 - Should Be True ${result} - Kindly Stop Broker + [Documentation] Start-Stop Broker/Engine - Engine started first - Engine stopped first + [Tags] Broker Engine start-stop + 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}= Ctn Check Poller Enabled In Database 1 10 + Should Be True ${result} + Ctn Stop Engine + ${result}= Ctn Check Poller Disabled In Database 1 10 + Should Be True ${result} + 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 - Should Be True ${result} - ${result}= Check Poller Enabled In Database 1 10 - Should Be True ${result} - Kindly Stop Broker - Stop Engine + [Documentation] Start-Stop Broker/Engine - Engine started first - Broker stopped first + [Tags] Broker Engine start-stop + 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}= Ctn Check Poller Enabled In Database 1 10 + Should Be True ${result} + 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 - Should Be True ${result} - Kindly Stop Broker - Stop Engine + [Documentation] Start-Stop Broker/engine - Engine debug level is set to all, it should not hang + [Tags] Broker Engine start-stop + 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} + Ctn Kindly Stop Broker + Ctn Stop Engine 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 - Should Be True ${result} - Kindly Stop Broker - Stop Engine + [Documentation] Start-Stop grpc version Broker/Engine - Broker started first - Broker stopped first + [Tags] Broker Engine start-stop + 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} + 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 - Should Be True ${result} - ${result}= Check Poller Enabled In Database 1 10 - Should Be True ${result} - Stop Engine - ${result}= Check Poller Disabled In Database 1 10 - Should Be True ${result} - Kindly Stop Broker + [Documentation] Start-Stop grpc version Broker/Engine - Broker started first - Engine stopped first + [Tags] Broker Engine start-stop + 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}= Ctn Check Poller Enabled In Database 1 10 + Should Be True ${result} + Ctn Stop Engine + ${result}= Ctn Check Poller Disabled In Database 1 10 + Should Be True ${result} + 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 - Should Be True ${result} - ${result}= Check Poller Enabled In Database 1 10 - Should Be True ${result} - Stop Engine - ${result}= Check Poller Disabled In Database 1 10 - Should Be True ${result} - Kindly Stop Broker + [Documentation] Start-Stop grpc version Broker/Engine - Engine started first - Engine stopped first + [Tags] Broker Engine start-stop + 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}= Ctn Check Poller Enabled In Database 1 10 + Should Be True ${result} + Ctn Stop Engine + ${result}= Ctn Check Poller Disabled In Database 1 10 + Should Be True ${result} + 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 - Should Be True ${result} - Kindly Stop Broker - Stop Engine + [Documentation] Start-Stop grpc version Broker/Engine - Engine started first - Broker stopped first + [Tags] Broker Engine start-stop + 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} + 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 - Should Be True ${result} - ${result}= Check Poller Enabled In Database 1 10 - Should Be True ${result} - Stop Engine - ${result}= Check Poller Disabled In Database 1 10 - Should Be True ${result} - Kindly Stop Broker + [Documentation] Start-Stop grpc version Broker/engine - Engine debug level is set to all, it should not hang + [Tags] Broker Engine start-stop + 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}= Ctn Check Poller Enabled In Database 1 10 + Should Be True ${result} + Ctn Stop Engine + ${result}= Ctn Check Poller Disabled In Database 1 10 + Should Be True ${result} + 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 - Should Be True ${result} - ${result}= Check Poller Enabled In Database 1 10 - Should Be True ${result} - Stop Engine - ${result}= Check Poller Disabled In Database 1 10 - Should Be True ${result} - Kindly Stop Broker + [Documentation] Start-Stop grpc version Broker/Engine - Broker started first - Broker stopped last compression activated + [Tags] Broker Engine start-stop + 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}= Ctn Check Poller Enabled In Database 1 10 + Should Be True ${result} + Ctn Stop Engine + ${result}= Ctn Check Poller Disabled In Database 1 10 + Should Be True ${result} + 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 - 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 - FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine - ${result}= Check Connections - Should Be True ${result} - ${result}= Check Poller Enabled In Database 1 10 - Should Be True ${result} - Stop Engine - ${result}= Check Poller Disabled In Database 1 10 - Should Be True ${result} - Kindly Stop Broker - END + [Documentation] Start-Stop grpc version Broker/Engine - well configured + [Tags] Broker Engine start-stop + 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/ + 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 + Ctn Start Broker + Ctn Start Engine + ${result}= Ctn Check Connections + Should Be True ${result} + ${result}= Ctn Check Poller Enabled In Database 1 10 + Should Be True ${result} + Ctn Stop Engine + ${result}= Ctn Check Poller Disabled In Database 1 10 + Should Be True ${result} + 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 - 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 - FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine - Sleep 2s - Kindly Stop Broker - Stop Engine - END + [Documentation] Start-Stop grpc version Broker/Engine only server crypted + [Tags] Broker Engine start-stop + 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/ + 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 + Ctn Start Broker + Ctn Start Engine + Sleep 2s + 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 - 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 - FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine - Sleep 2s - Kindly Stop Broker - Stop Engine - END + [Documentation] Start-Stop grpc version Broker/Engine only engine crypted + [Tags] Broker Engine start-stop + 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/ + 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 + Ctn Start Broker + Ctn Start Engine + Sleep 2s + 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 - 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 - FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine - ${result}= Check Connections - Should Be True ${result} - Sleep 2s - Kindly Stop Broker - Stop Engine - END + [Documentation] Start-Stop grpc version Broker/Engine - well configured + [Tags] Broker Engine start-stop + 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/ + 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 + Ctn Start Broker + Ctn Start Engine + ${result}= Ctn Check Connections + Should Be True ${result} + Sleep 2s + 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 - 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 - FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine - Sleep 5s - Kindly Stop Broker - Stop Engine - END + [Documentation] Start-Stop grpc version Broker/Engine only engine server crypted + [Tags] Broker Engine start-stop + 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/ + 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 + Ctn Start Broker + Ctn Start Engine + Sleep 5s + 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 - 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 - FOR ${i} IN RANGE 0 5 - Start Broker - Start Engine - Sleep 5s - Kindly Stop Broker - Stop Engine - END + [Documentation] Start-Stop grpc version Broker/Engine only engine crypted + [Tags] Broker Engine start-stop + 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/ + 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 + Ctn Start Broker + Ctn Start Engine + Sleep 5s + 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 - ${start}= Get Current Date - Start Broker True - Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=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 - Sleep 2s - Kindly Stop Broker True - Stop Engine + [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 + Ctn Config Engine ${1} + Ctn Config Broker central + Ctn Config Broker module + Ctn Clear Retention + ${start}= Get Current Date + Ctn Start Broker True + Ctn Start Engine + ${content}= Create List check_for_external_commands + ${result}= Ctn Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} msg=An Initial host state on host_1 should be raised before we can start our external commands. + 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 + 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 - ${start}= Get Current Date - Start Broker - Start Engine - ${content}= Create List execute statement 306524174 + [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 + 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 + Ctn Start Broker + Ctn Start Engine + ${content}= Create List execute statement 306524174 - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 120 - Should Be True ${result} msg=Services should be updated after the ingestion of the queue file - Stop Engine - Kindly Stop Broker + ${result}= Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 120 + Should Be True ${result} msg=Services should be updated after the ingestion of the queue file + Ctn Stop Engine + Ctn Kindly Stop Broker diff --git a/tests/broker-engine/tags.robot b/tests/broker-engine/tags.robot index 75df9459d5a..68d181336eb 100644 --- a/tests/broker-engine/tags.robot +++ b/tests/broker-engine/tags.robot @@ -10,707 +10,707 @@ Library ../resources/Broker.py Library ../resources/Common.py Library ../resources/specific-duplication.py -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 - Broker Config Log central perfdata 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 Broker Config Log central perfdata 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: end check_queue - ${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: end check_queue 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: end check_queue - ${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: end check_queue 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 56f8bcab071..8832b3fa65a 100644 --- a/tests/broker-engine/tls.robot +++ b/tests/broker-engine/tls.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine communication with or without TLS Library Process @@ -18,24 +18,24 @@ Library ../resources/Common.py 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} msg=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" @@ -43,9 +43,9 @@ BECT1 ELSE IF "${comp1}" == "no" and "${comp2}" == "yes" Insert Into List ${content2} ${-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 @@ -53,153 +53,153 @@ 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 localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt + ${hostname}= Ctn Get Hostname + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set central central-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set central central-broker-master-input public_cert ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set module0 central-module-master-output private_key ${EtcRoot}/centreon-broker/server.key - Broker Config Output set module0 central-module-master-output public_cert ${EtcRoot}/centreon-broker/server.crt - 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 Input Set central central-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key + Ctn Broker Config Input Set central central-broker-master-input public_cert ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set module0 central-module-master-output private_key ${EtcRoot}/centreon-broker/server.key + Ctn Broker Config Output Set module0 central-module-master-output public_cert ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set module0 central-module-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + 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} msg=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 central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt - 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 Input Set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set module0 central-module-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + 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} msg=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 ${hostname} ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate ${hostname} ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt + Ctn Create Key And Certificate ${hostname} ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt + Ctn Create Key And Certificate ${hostname} ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt - 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 central central-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set central central-broker-master-input public_cert ${EtcRoot}/centreon-broker/client.crt - 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 module0 central-module-master-output private_key ${EtcRoot}/centreon-broker/server.key - Broker Config Output set module0 central-module-master-output public_cert ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set module0 central-module-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set module0 central-module-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + 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 + Ctn Broker Config Input Set central central-broker-master-input public_cert ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt + 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 + Ctn Broker Config Output Set module0 central-module-master-output public_cert ${EtcRoot}/centreon-broker/server.crt + 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} msg=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} msg=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" @@ -207,9 +207,9 @@ BECT_GRPC1 ELSE IF "${comp1}" == "no" and "${comp2}" == "yes" Insert Into List ${content2} ${-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 @@ -217,133 +217,133 @@ 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 localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set central central-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set central central-broker-master-input public_cert ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set module0 central-module-master-output private_key ${EtcRoot}/centreon-broker/server.key - Broker Config Output set module0 central-module-master-output public_cert ${EtcRoot}/centreon-broker/server.crt - 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 Input Set central central-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key + Ctn Broker Config Input Set central central-broker-master-input public_cert ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set module0 central-module-master-output private_key ${EtcRoot}/centreon-broker/server.key + Ctn Broker Config Output Set module0 central-module-master-output public_cert ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set module0 central-module-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + 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} msg=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 central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt - 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 Input Set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set module0 central-module-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + 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} msg=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 ${hostname} ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate ${hostname} ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt + Ctn Create Key And Certificate ${hostname} ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt + Ctn Create Key And Certificate ${hostname} ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt - 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 central central-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set central central-broker-master-input public_cert ${EtcRoot}/centreon-broker/client.crt - 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 module0 central-module-master-output private_key ${EtcRoot}/centreon-broker/server.key - Broker Config Output set module0 central-module-master-output public_cert ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set module0 central-module-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set module0 central-module-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + 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 + Ctn Broker Config Input Set central central-broker-master-input public_cert ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set central central-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt + 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 + Ctn Broker Config Output Set module0 central-module-master-output public_cert ${EtcRoot}/centreon-broker/server.crt + 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} msg=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/bbdo-server-client-ko.robot b/tests/broker/bbdo-server-client-ko.robot index af4f6bd47cb..2148c70c509 100644 --- a/tests/broker/bbdo-server-client-ko.robot +++ b/tests/broker/bbdo-server-client-ko.robot @@ -1,8 +1,8 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker start/stop tests with bbdo_server and bbdo_client input/output streams. Only these streams are used instead of grpc and tcp. Library Process @@ -15,62 +15,62 @@ Library DateTime 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} msg=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} msg=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} msg=The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 @@ -80,7 +80,7 @@ Start Stop Service ${result}= Wait Or Dump And Kill Process b2 60s Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=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} diff --git a/tests/broker/bbdo-server-client-reversed.robot b/tests/broker/bbdo-server-client-reversed.robot index 2b5dbcd0230..af938b354f9 100644 --- a/tests/broker/bbdo-server-client-reversed.robot +++ b/tests/broker/bbdo-server-client-reversed.robot @@ -1,270 +1,270 @@ *** Settings *** -Resource ../resources/resources.robot -Suite Setup Prepare Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes -Test Teardown Save logs If Failed +Resource ../resources/resources.robot +Suite Setup Ctn Prepare Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes +Test Teardown Ctn Save Logs If Failed -Documentation Centreon Broker start/stop tests with bbdo_server and bbdo_client input/output streams. Only these streams are used instead of grpc and tcp. -Library DateTime -Library Process -Library OperatingSystem -Library ../resources/Broker.py +Documentation Centreon Broker start/stop tests with bbdo_server and bbdo_client input/output streams. Only these streams are used instead of grpc and tcp. +Library DateTime +Library Process +Library OperatingSystem +Library ../resources/Broker.py *** 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 + [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 + 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. central-broker-master-output 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 central-broker-master-output 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 - ${content}= Create List failover 'central-broker-master-output' construction. - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + [Documentation] Start-Stop two instances of broker and no coredump. Connection with bbdo_server/bbdo_client, reversed and retention. central-broker-master-output is then a failover. + [Tags] Broker start-stop bbdo_server bbdo_client tcp + 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 central-broker-master-output 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 'central-broker-master-output' construction. + ${result}= Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} msg=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. central-broker-master-output 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 central-broker-master-output retention yes - Broker Config Log central config info - Repeat Keyword 5 times Start Stop Service 0 + [Documentation] Start-Stop two instances of broker and no coredump. The server contains a listen address, reversed and retention. central-broker-master-output is then a failover. + [Tags] Broker start-stop bbdo_server bbdo_client tcp + 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 central-broker-master-output 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. central-broker-master-output 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 central-broker-master-output retention yes - Repeat Keyword 10 times Start Stop Instance 300ms + [Documentation] Start/Stop 10 times broker with 300ms interval and no coredump, reversed and retention. central-broker-master-output is then a failover. + [Tags] Broker start-stop bbdo_server bbdo_client tcp + 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 central-broker-master-output 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 central-broker-master-output 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 - ${content}= Create List endpoint applier: creating new failover 'central-broker-master-output' failover 'central-broker-master-output' construction. - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + [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 + 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 central-broker-master-output 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 'central-broker-master-output' failover 'central-broker-master-output' construction. + ${result}= Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} msg=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 central-broker-master-output encryption yes - Broker Config Output set central central-broker-master-output retention yes - Broker Config Input set rrd rrd-broker-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 - ${content}= Create List TLS: successful handshake - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + [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 + 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 central-broker-master-output encryption yes + Ctn Broker Config Output Set central central-broker-master-output retention yes + Ctn Broker Config Input Set rrd rrd-broker-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}= Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} msg=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 central-broker-master-output encryption yes - Broker Config Output set central central-broker-master-output retention yes - Broker Config Input set rrd rrd-broker-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 central central-broker-master-output private_key ${EtcRoot}/centreon-broker/server.key - Broker Config Output set central central-broker-master-output certificate ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set central central-broker-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt - ${start}= Get Round Current Date - Repeat Keyword 5 times Start Stop Service 0 - ${content}= Create List TLS: successful handshake - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + [Documentation] Start-Stop two instances of broker and no coredump. Encryption is enabled. + [Tags] Broker start-stop bbdo_server bbdo_client tcp tls + 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 central-broker-master-output encryption yes + Ctn Broker Config Output Set central central-broker-master-output retention yes + Ctn Broker Config Input Set rrd rrd-broker-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 central-broker-master-output private_key ${EtcRoot}/centreon-broker/server.key + Ctn Broker Config Output Set central central-broker-master-output certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set central central-broker-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key + Ctn Broker Config Input Set rrd rrd-broker-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}= Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} msg=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 central-broker-master-output encryption yes - Broker Config Output set central central-broker-master-output retention yes - Broker Config Input set rrd rrd-broker-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 debug - Create Key And Certificate localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt + [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 + 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 central-broker-master-output encryption yes + Ctn Broker Config Output Set central central-broker-master-output retention yes + Ctn Broker Config Input Set rrd rrd-broker-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 debug + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt - Broker Config Output set central central-broker-master-output private_key ${EtcRoot}/centreon-broker/server.key - Broker Config Output set central central-broker-master-output certificate ${EtcRoot}/centreon-broker/server.crt - Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set rrd rrd-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt - ${start}= Get Round Current Date - Start Broker - ${content}= Create List write: buff: write done: buff: - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. - Kindly Stop Broker + Ctn Broker Config Output Set central central-broker-master-output private_key ${EtcRoot}/centreon-broker/server.key + Ctn Broker Config Output Set central central-broker-master-output certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Input Set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key + Ctn Broker Config Input Set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set rrd rrd-broker-master-input ca_certificate ${EtcRoot}/centreon-broker/server.crt + ${start}= Ctn Get Round Current Date + Ctn Start Broker + ${content}= Create List write: buff: write done: buff: + ${result}= Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} msg=No information about TLS activation. + 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 central-broker-master-output compression yes - Broker Config Output set central central-broker-master-output 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 - ${content}= Create List compression: writing - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No compression enabled - Kindly Stop Broker + [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 + 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 central-broker-master-output compression yes + Ctn Broker Config Output Set central central-broker-master-output 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}= Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} msg=No compression enabled + 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 central-broker-master-output compression no - Broker Config Output set central central-broker-master-output 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 - ${content}= Create List BBDO: we have extensions '' and peer has 'COMPRESSION' - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Compression enabled but should not. - Kindly Stop Broker + [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 + 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 central-broker-master-output compression no + Ctn Broker Config Output Set central central-broker-master-output 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}= Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} msg=Compression enabled but should not. + 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 central-broker-master-output compression yes - Broker Config Output set central central-broker-master-output 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 - ${content}= Create List server default compression deflate - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No compression enabled - Kindly Stop Broker + [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 + 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 central-broker-master-output compression yes + Ctn Broker Config Output Set central central-broker-master-output 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}= Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} msg=No compression enabled + 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 central-broker-master-output compression no - Broker Config Output set central central-broker-master-output 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 - ${content}= Create List server default compression deflate - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 15 - Should Be True not ${result} msg=No compression enabled - Kindly Stop Broker + [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 + 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 central-broker-master-output compression no + Ctn Broker Config Output Set central central-broker-master-output 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}= Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 15 + Should Be True not ${result} msg=No compression enabled + Ctn Kindly Stop Broker *** Keywords *** -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} - Should Be True ${result} msg=The connection between cbd central and rrd is not established. +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}= Ctn Check Connection 5670 ${pid1} ${pid2} + Should Be True ${result} msg=The connection between cbd central and rrd is not established. - Send Signal To Process SIGTERM b1 - ${result}= Wait Or Dump And Kill Process b1 60s - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker service badly stopped - Send Signal To Process SIGTERM b2 - ${result}= Wait Or Dump And Kill Process b2 60s - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker service badly stopped + Send Signal To Process SIGTERM b1 + ${result} Ctn Wait Or Dump And Kill Process b1 60s + Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker service badly stopped + Send Signal To Process SIGTERM b2 + ${result}= Ctn Wait Or Dump And Kill Process b2 60s + Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker service badly stopped -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 60s - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker instance badly stopped +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}= Ctn Wait Or Dump And Kill Process b1 60s + Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker instance badly stopped + +Ctn Prepare Suite + Ctn Clean Before Suite + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt -Prepare Suite - Clean Before Suite - Create Key And Certificate localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt - 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 8b944775610..d82a009af67 100644 --- a/tests/broker/bbdo-server-client.robot +++ b/tests/broker/bbdo-server-client.robot @@ -1,8 +1,8 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker start/stop tests with bbdo_server and bbdo_client input/output streams. Only these streams are used instead of grpc and tcp. Library DateTime @@ -15,336 +15,336 @@ Library ../resources/Broker.py 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 central-broker-master-output encryption yes - Broker Config Input set rrd rrd-broker-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 central-broker-master-output encryption yes + Ctn Broker Config Input Set rrd rrd-broker-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} msg=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 central-broker-master-output encryption yes - Broker Config Input set rrd rrd-broker-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 central central-broker-master-output private_key ${EtcRoot}/centreon-broker/server.key - Broker Config Output set central central-broker-master-output certificate ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set central central-broker-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt + 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 central-broker-master-output encryption yes + Ctn Broker Config Input Set rrd rrd-broker-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 central-broker-master-output private_key ${EtcRoot}/centreon-broker/server.key + Ctn Broker Config Output Set central central-broker-master-output certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set central central-broker-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key + Ctn Broker Config Input Set rrd rrd-broker-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} msg=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 central-broker-master-output encryption yes - Broker Config Input set rrd rrd-broker-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 central-broker-master-output encryption yes + Ctn Broker Config Input Set rrd rrd-broker-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} msg=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 central-broker-master-output encryption yes - Broker Config Input set rrd rrd-broker-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 debug - Broker Config Log central grpc debug - Create Key And Certificate localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt + 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 central-broker-master-output encryption yes + Ctn Broker Config Input Set rrd rrd-broker-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 debug + Ctn Broker Config Log central grpc debug + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt - Broker Config Output set central central-broker-master-output private_key ${EtcRoot}/centreon-broker/server.key - Broker Config Output set central central-broker-master-output certificate ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set central central-broker-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Output Set central central-broker-master-output private_key ${EtcRoot}/centreon-broker/server.key + Ctn Broker Config Output Set central central-broker-master-output certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set central central-broker-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key + Ctn Broker Config Input Set rrd rrd-broker-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} msg=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 central-broker-master-output encryption yes - Broker Config Input set rrd rrd-broker-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 localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt + 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 central-broker-master-output encryption yes + Ctn Broker Config Input Set rrd rrd-broker-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 + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt - Broker Config Output set central central-broker-master-output private_key ${EtcRoot}/centreon-broker/server.key - Broker Config Output set central central-broker-master-output certificate ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set central central-broker-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/missing-client.key - Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Output Set central central-broker-master-output private_key ${EtcRoot}/centreon-broker/server.key + Ctn Broker Config Output Set central central-broker-master-output certificate ${EtcRoot}/centreon-broker/server.crt + Ctn Broker Config Output Set central central-broker-master-output ca_certificate ${EtcRoot}/centreon-broker/client.crt + Ctn Broker Config Input Set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/missing-client.key + Ctn Broker Config Input Set rrd rrd-broker-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} msg=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 central-broker-master-output 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 central-broker-master-output 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} msg=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 central-broker-master-output 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 central-broker-master-output 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} msg=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 central-broker-master-output 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 central-broker-master-output 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} msg=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 rrd-broker-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 rrd-broker-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} msg=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 rrd-broker-master-input authorization titus - Broker Config output set central central-broker-master-output 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 rrd-broker-master-input authorization titus + Ctn Broker Config Output Set central central-broker-master-output 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} msg=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} msg=The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 @@ -354,7 +354,7 @@ Start Stop Service ${result}= Wait For Process b2 timeout=60s on_timeout=kill Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=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} @@ -362,7 +362,7 @@ Start Stop Instance ${result}= Wait For Process b1 timeout=60s on_timeout=kill Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker instance badly stopped -Prepare Suite - Clean Before Suite - Create Key And Certificate localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt - Create Key And Certificate localhost ${EtcRoot}/centreon-broker/client.key ${EtcRoot}/centreon-broker/client.crt +Ctn Prepare Suite + Ctn Clean Before Suite + Ctn Create Key And Certificate localhost ${EtcRoot}/centreon-broker/server.key ${EtcRoot}/centreon-broker/server.crt + 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 b6632e0db4d..fff4daee88a 100644 --- a/tests/broker/command-line.robot +++ b/tests/broker/command-line.robot @@ -1,8 +1,8 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker only start/stop tests Library Process @@ -15,57 +15,57 @@ Library DateTime 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} msg=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} msg=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} msg=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} msg=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 27acc824449..f371e7fc43f 100644 --- a/tests/broker/filters.robot +++ b/tests/broker/filters.robot @@ -1,47 +1,47 @@ *** Settings *** -Resource ../resources/resources.robot -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Resource ../resources/resources.robot +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes -Documentation Centreon Broker only start/stop tests -Library Process -Library OperatingSystem -Library ../resources/Broker.py -Library DateTime +Documentation Centreon Broker only start/stop tests +Library Process +Library OperatingSystem +Library ../resources/Broker.py +Library DateTime *** 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 central central-broker-master-sql filters {"category": ["neb", "foo", "bar"]} - ${start}= Get Current Date - 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 - Should Be True ${result} msg="Only neb filter should be applied on sql output" + [Documentation] Start broker with invalid filters but one filter ok + [Tags] Broker start-stop log-v2 + 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 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}= 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 central central-broker-master-sql filters {"category": ["doe", "foo", "bar"]} - ${start}= Get Current Date - 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 - Should Be True ${result} msg="Only neb filter should be applied on sql output" + [Documentation] Start broker with only invalid filters on an output + [Tags] Broker start-stop log-v2 + 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 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}= 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 debfd1a1fa1..9d0be6b58f5 100644 --- a/tests/broker/grpc-stream.robot +++ b/tests/broker/grpc-stream.robot @@ -1,9 +1,9 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker only start/stop tests Library Process @@ -15,99 +15,99 @@ Library ../resources/Broker.py 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 msg=Broker instance badly stopped diff --git a/tests/broker/log.robot b/tests/broker/log.robot index e826156a8d9..d6bb9b27072 100644 --- a/tests/broker/log.robot +++ b/tests/broker/log.robot @@ -1,8 +1,8 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker only start/stop tests Library Process @@ -15,58 +15,58 @@ Library DateTime 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} msg="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} msg="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 central core + Ctn Start Broker + ${result}= Ctn Get Broker Log Level 51001 central core Should Be Equal ${result} trace - Set Broker Log Level 51001 central core debug - ${result}= Get Broker Log Level 51001 central core + Ctn Set Broker Log Level 51001 central core debug + ${result}= Ctn Get Broker Log Level 51001 central 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 central core + Ctn Start Broker + ${result}= Ctn Get Broker Log Level 51001 central core Should Be Equal ${result} trace - ${result}= Set Broker Log Level 51001 central core foo + ${result}= Ctn Set Broker Log Level 51001 central 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 central foo trace + Ctn Start Broker + ${result}= Ctn Set Broker Log Level 51001 central 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 f22ce14eb05..ba555a03e5b 100644 --- a/tests/broker/sql.robot +++ b/tests/broker/sql.robot @@ -1,387 +1,390 @@ *** Settings *** -Resource ../resources/resources.robot -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Resource ../resources/resources.robot +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes -Documentation Centreon Broker Mariadb access -Library Process -Library OperatingSystem -Library DateTime -Library ../resources/Broker.py -Library ../resources/Engine.py -Library ../resources/Common.py +Documentation Centreon Broker Mariadb access +Library Process +Library OperatingSystem +Library DateTime +Library ../resources/Broker.py +Library ../resources/Engine.py +Library ../resources/Common.py *** 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 - FOR ${i} IN RANGE 0 5 - ${start}= Get Current Date - 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 - Should Be True ${result} msg=A message should tell that sql and storage outputs do not have the same configuration. - Kindly Stop Broker - END + [Documentation] Access denied when database name exists but is not the good one for sql output + [Tags] Broker sql + 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 + Ctn Start Broker + ${content} Create List storage and sql streams do not have the same database configuration + ${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. + 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 - FOR ${i} IN RANGE 0 5 - ${start}= Get Current Date - 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 - Should Be True ${result} msg=A log telling the impossibility to establish a connection between the storage stream and the database should appear. - Kindly Stop Broker - END + [Documentation] Access denied when database name exists but is not the good one for storage output + [Tags] Broker sql + 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 + Ctn Start Broker + ${content} Create List storage and sql streams do not have the same database configuration + ${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. + 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 - FOR ${i} IN RANGE 0 5 - ${start}= Get Current Date - Start Broker - ${content}= Create List global error: mysql_connection: error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No message about the database not connected. - Kindly Stop Broker - END + [Documentation] Access denied when database name does not exist for sql output + [Tags] Broker sql + 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 + Ctn Start Broker + ${content} Create List global error: mysql_connection: error while starting connection + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No message about the database not connected. + 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 - FOR ${i} IN RANGE 0 5 - ${start}= Get Current Date - Start Broker - ${content}= Create List error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 20 - Should Be True ${result} msg=No message about the fact that cbd is not correctly connected to the database. - Kindly Stop Broker - END + [Documentation] Access denied when database name does not exist for storage and sql outputs + [Tags] Broker sql + 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 + Ctn Start Broker + ${content} Create List error while starting connection + ${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. + 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 - FOR ${i} IN RANGE 0 5 - ${start}= Get Current Date - Start Broker - ${content}= Create List error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 50 - Should Be True ${result} msg=No message about the disconnection between cbd and the database - Kindly Stop Broker - END + [Documentation] cbd does not crash if the storage/sql db_host is wrong + [Tags] Broker sql + 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 + Ctn Start Broker + ${content} Create List error while starting connection + ${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 + 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 - FOR ${i} IN RANGE 0 5 - ${start}= Get Current Date - Start Broker - ${content}= Create List error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 20 - Should Be True ${result} msg=No message about the disconnection between cbd and the database - Kindly Stop Broker - END + [Documentation] cbd does not crash if the sql db_host is wrong + [Tags] Broker sql + 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 + Ctn Start Broker + ${content} Create List error while starting connection + ${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 + 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 - ${start}= Get Current Date - Start Broker - ${content}= Create List mysql_connection: error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 20 - Should Be True ${result} - Kindly Stop Broker + [Documentation] access denied when database user password is wrong for perfdata/sql + [Tags] Broker sql + 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 + Ctn Start Broker + ${content} Create List mysql_connection: error while starting connection + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 + Should Be True ${result} + 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 - ${start}= Get Current Date - Start Broker - ${content}= Create List mysql_connection: error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 20 - Should Be True ${result} - Kindly Stop Broker + [Documentation] access denied when database user password is wrong for perfdata/sql + [Tags] Broker sql + 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 + Ctn Start Broker + ${content} Create List mysql_connection: error while starting connection + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 + Should Be True ${result} + 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 - ${start}= Get Current Date - Start Broker - ${content}= Create List mysql_connection: error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 20 - Should Be True ${result} - Kindly Stop Broker + [Documentation] access denied when database user password is wrong for sql + [Tags] Broker sql + 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 + Ctn Start Broker + ${content} Create List mysql_connection: error while starting connection + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 20 + Should Be True ${result} + 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 - ${start}= Get Current Date - Start Broker - ${content}= Create List sql stream initialization storage stream initialization - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 40 - Should Be True ${result} - Kindly Stop Broker + [Documentation] connection should be established when user password is good for sql/perfdata + [Tags] Broker sql + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Broker Config Log central sql debug + ${start} Get Current Date + Ctn Start Broker + ${content} Create List sql stream initialization storage stream initialization + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40 + Should Be True ${result} + 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} - ${start}= Get Current Date - Stop Mysql - Start Broker - Start Engine - ${content}= Create List error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 40 - Should Be True ${result} msg=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 - Should Be True ${result} msg=Message about the connection to the database is missing. - Kindly Stop Broker - Stop Engine + [Documentation] start broker/engine and then start MariaDB => connection is established + [Tags] Broker sql start-stop + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Engine ${1} + ${start} Get Current Date + Ctn Stop Mysql + Ctn Start Broker + Ctn Start Engine + ${content} Create List error while starting connection + ${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 + Ctn Start Mysql + ${result} Ctn Check Broker Stats Exist central mysql manager waiting tasks in connection 0 + Should Be True ${result} Message about the connection to the database is missing. + 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} - ${start}= Get Current Date - Start Mysql - Start Broker - Start Engine - FOR ${t} IN RANGE 60 - ${result}= Check Sql connections count with grpc 51001 ${3} - Exit For Loop If ${result} - END - Should Be True ${result} msg=gRPC does not return 3 connections as expected - Stop Mysql - FOR ${t} IN RANGE 60 - ${result}= Check All Sql connections Down with grpc 51001 - Exit For Loop If ${result} - END - Should Be True ${result} msg=Connections are not all down. + [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 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Engine ${1} + Ctn Start Mysql + Ctn Start Broker + Ctn Start Engine + FOR ${t} IN RANGE 60 + ${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 + Ctn Stop Mysql + FOR ${t} IN RANGE 60 + ${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 - FOR ${t} IN RANGE 60 - ${result}= Check Sql connections count with grpc 51001 ${3} - Exit For Loop If ${result} - END - Should Be True ${result} msg=gRPC does not return 3 connections as expected - Kindly Stop Broker - Stop Engine + Ctn Start Mysql + FOR ${t} IN RANGE 60 + ${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 + 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} - ${start}= Get Current Date - Stop Mysql - Start Broker - Start Engine - FOR ${t} IN RANGE 60 - ${result}= Check All Sql connections Down with grpc 51001 - Exit For Loop If ${result} - END - Should Be True ${result} msg=Connections are not all down. + [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 + Ctn Config Broker central + Ctn Config Broker rrd + Ctn Config Broker module + Ctn Config Engine ${1} + ${start} Get Current Date + Ctn Stop Mysql + Ctn Start Broker + Ctn Start Engine + FOR ${t} IN RANGE 60 + ${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 - FOR ${t} IN RANGE 60 - ${result}= Check Sql connections count with grpc 51001 ${3} - Exit For Loop If ${result} - END - Should Be True ${result} msg=gRPC does not return 3 connections as expected - Kindly Stop Broker - Stop Engine + Ctn Start Mysql + FOR ${t} IN RANGE 60 + ${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 + 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 - ${content}= Create List error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 20 - Should Be True ${result} msg=Message about the disconnection between cbd and the database is missing - Start Mysql - ${result}= Get Broker Stats Size central mysql manager - Should Be True ${result} >= ${c} + 1 msg=The stats file should contain at less ${c} + 1 connections to the database. - Kindly Stop Broker - Stop Engine - END + [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} + 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} 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 + Ctn Start Mysql + ${result} Ctn Get Broker Stats Size central mysql manager + Should Be True ${result} >= ${c} + 1 The stats file should contain at less ${c} + 1 connections to the database. + 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 - Config Broker module - # 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 - FOR ${i} IN RANGE 0 5 - ${start}= Get Current Date - Start Broker - ${content}= Create List Table 'centreon\..*' doesn't exist - ${result}= Find Regex In Log with timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=A message about that 'centreon.hosts' does not exist should appear - Kindly Stop Broker - END + [Documentation] Access denied when database name exists but is not the good one for unified sql output + [Tags] Broker sql unified_sql + Ctn Config Broker central + Ctn Config Broker Sql Output central unified_sql + Ctn Config Broker rrd + Ctn Config Broker module + # We replace the usual centreon_storage database by centreon to make the wanted error + 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 + Ctn Start Broker + ${content} Create List Table 'centreon\..*' doesn't exist + ${result} Ctn Find Regex In Log With Timeout ${centralLog} ${start} ${content} 60 + Should Be True ${result} A message about that 'centreon.hosts' does not exist should appear + 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 - FOR ${i} IN RANGE 0 5 - ${start}= Get Current Date - Start Broker - ${content}= Create List global error: mysql_connection: error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} - Kindly Stop Broker - END + [Documentation] Access denied when database name does not exist for unified sql output + [Tags] Broker sql unified_sql + 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 + Ctn Start Broker + ${content} Create List global error: mysql_connection: error while starting connection + ${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} + 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 - FOR ${i} IN RANGE 0 5 - ${start}= Get Current Date - Start Broker - ${content}= Create List error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 50 - Should Be True ${result} msg=Cannot find the message telling cbd is not connected to the database. - Kindly Stop Broker - END + [Documentation] cbd does not crash if the unified sql db_host is wrong + [Tags] Broker sql unified_sql + 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 + Ctn Start Broker + ${content} Create List error while starting connection + ${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. + 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 - ${start}= Get Current Date - Start Broker - ${content}= Create List mysql_connection: error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 20 - Should Be True ${result} msg=Error concerning cbd not connected to the database is missing. - Kindly Stop Broker + [Documentation] Access denied when database user password is wrong for unified sql + [Tags] Broker sql unified_sql + 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 + Ctn Start Broker + ${content} Create List mysql_connection: error while starting connection + ${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. + 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 - ${start}= Get Current Date - Start Broker - ${content}= Create List mysql_connection 0x[0-9a-f]* : commit - ${result}= Find Regex In Log with timeout ${centralLog} ${start} ${content} 40 - Should Be True ${result[0]} msg=Log concerning a commit (connection ok) is missing. - Kindly Stop Broker + [Documentation] Connection should be established when user password is good for unified sql + [Tags] Broker sql unified_sql + 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 + Ctn Start Broker + ${content} Create List mysql_connection 0x[0-9a-f]* : commit + ${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. + 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 6 - 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} - ${start}= Get Current Date - Stop Mysql - Start Broker - Start Engine - ${content}= Create List mysql_connection: error while starting connection - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 20 - Should Be True ${result} msg=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 - Should Be True ${result} msg=No stats on mysql manager found - ${result}= Get Broker Stats size central mysql manager ${60} - Should Be True ${result} >= ${c} + 1 msg=Broker mysql manager stats do not show the ${c} connections - Kindly Stop Broker - Stop Engine - END + [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 6 + FOR ${c} IN @{lst} + 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 + Ctn Stop Mysql + Ctn Start Broker + Ctn Start Engine + ${content} Create List mysql_connection: error while starting connection + ${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 + 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} 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 + Ctn Kindly Stop Broker + Ctn Stop Engine + END diff --git a/tests/broker/start-stop.robot b/tests/broker/start-stop.robot index 9970383e622..5f164bfb506 100644 --- a/tests/broker/start-stop.robot +++ b/tests/broker/start-stop.robot @@ -9,110 +9,110 @@ Library ../resources/Broker.py Library ../resources/Engine.py Library ../resources/Common.py -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 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 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} @@ -125,11 +125,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 @@ -145,7 +145,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 caaef277a32..66235477814 100644 --- a/tests/ccc/ccc.robot +++ b/tests/ccc/ccc.robot @@ -1,8 +1,8 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation ccc tests with engine and broker Library Process @@ -17,15 +17,15 @@ Library ../resources/Common.py 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 @@ -35,29 +35,29 @@ 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 - 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 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 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 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 @@ -67,32 +67,32 @@ BECCC2 Sleep 1s END - ${version}= Get Version + ${version}= Ctn Get 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 - 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 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 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 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 @@ -101,32 +101,32 @@ BECCC3 EXIT FOR LOOP IF len("${content.strip()}") > 0 Sleep 1s END - ${version}= Get Version + ${version}= Ctn Get 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 - 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 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 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 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 @@ -137,29 +137,29 @@ BECCC4 END ${contains}= Evaluate "GetVersion" in """${content}""" and "RemovePoller" in """${content}""" Should Be True ${contains} msg=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 - 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 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 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 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 @@ -170,29 +170,29 @@ BECCC5 END ${contains}= Evaluate "The list argument expects no command" in """${content}""" Should Be True ${contains} msg=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 - 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 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 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 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 @@ -201,7 +201,7 @@ BECCC6 IF len("""${content.strip().split()}""") > 50 BREAK Sleep 1s END - ${version}= Get Version + ${version}= Ctn Get Version ${vers}= Split String ${version} . ${mm}= Evaluate """${vers}[0]""".lstrip("0") ${m}= Evaluate """${vers}[1]""".lstrip("0") @@ -217,29 +217,29 @@ BECCC6 ... {\n \"major\": ${mm},\n \"minor\": ${m},\n \"patch\": ${p}\n} ... msg=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 - 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 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 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 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 @@ -249,29 +249,29 @@ BECCC7 Sleep 1s END Should Contain ${content} Error during the execution of '/com.centreon.broker.Broker/GetVersion' method: msg=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 - 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 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 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 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 EnableServiceNotifications{"names":{"host_name": "host_1", "service_name": "service_1"}} stdout=/tmp/output.txt FOR ${i} IN RANGE 10 @@ -281,6 +281,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 2b441fead3c..99132cf8a84 100644 --- a/tests/connector_perl/connector_perl.robot +++ b/tests/connector_perl/connector_perl.robot @@ -2,55 +2,55 @@ Resource ../resources/resources.robot Library ../resources/Engine.py -Suite Setup Start engine -Suite Teardown Stop engine +Suite Setup Ctn Start Engine +Suite Teardown Ctn Stop Engine Documentation centreon_connector_perl tests. -Library Process -Library OperatingSystem +Library Process +Library OperatingSystem *** Keywords *** -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 - Sleep 5 seconds we wait engine start - -Stop engine - Stop Custom Engine engine_alias +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/ + Ctn Kill Engine + Ctn Start Custom Engine /tmp/test_connector_perl/centengine.cfg engine_alias + Sleep 5 seconds we wait engine start + +Ctn Stop Engine + Ctn Stop Custom Engine engine_alias *** Test Cases *** -test use connector perl exist script - [Documentation] test exist script +Ctn 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 - Sleep 5 seconds we wait engine forced checks - ${search_result}= check search /tmp/test_connector_perl/log/centengine.debug test.pl - Should Contain ${search_result} a dummy check msg=check not found + 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}= 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 +Ctn 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 - Sleep 5 seconds we wait engine forced checks - ${search_result}= 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' msg=check not found + 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}= 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' check not found -test use connector perl multiple script - [Documentation] test script multiple +Ctn test use connector perl multiple script + [Documentation] test script multiple [Tags] Connector Engine - FOR ${idx} IN RANGE 2 12 + 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 + 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} - Should Contain ${search_result} a dummy check msg=check not found + ${search_str}= Catenate SEPARATOR= test.pl -H 127.0.0. ${idx} + ${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 diff --git a/tests/connector_ssh/connector_ssh.robot b/tests/connector_ssh/connector_ssh.robot index e7863f32dbd..cdb7384786b 100644 --- a/tests/connector_ssh/connector_ssh.robot +++ b/tests/connector_ssh/connector_ssh.robot @@ -1,10 +1,10 @@ *** Settings *** -Resource ../resources/resources.robot +Resource ../resources/resources.robot Library ../resources/Engine.py -Suite Setup Prepare ssh and start engine -Suite Teardown Stop engine +Suite Setup Ctn Prepare ssh and start engine +Suite Teardown Ctn Stop Engine -Documentation centreon_connector_ssh tests. +Documentation centreon_connector_ssh tests. Library Process Library DateTime Library OperatingSystem @@ -12,67 +12,67 @@ Library OperatingSystem *** Keywords *** -Prepare ssh and start engine - [Documentation] in order to test ssh connector, we need to create a user, his password and his Keyword - Run useradd testconnssh - Remove File ~testconnssh/.ssh/authorized_keys - Run echo testconnssh:passwd | chpasswd - Run su testconnssh -c "ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa << ~testconnssh/.ssh/authorized_keys +Ctn Test6Hosts + [Documentation] as 127.0.0.x point to the localhost address we will simulate check on 6 hosts + [Tags] Connector Engine + Sleep 5 seconds we wait sshd raz pending connexions from previous tests + Run cat ~testconnssh/.ssh/id_rsa.pub ~root/.ssh/id_rsa.pub > ~testconnssh/.ssh/authorized_keys - FOR ${idx} IN RANGE 0 5 - ${host}= Catenate SEPARATOR= local_host_test_machine_. ${idx} - schedule forced host check ${host} /tmp/test_connector_ssh/rw/centengine.cmd + FOR ${idx} IN RANGE 0 5 + ${host}= Catenate SEPARATOR= local_host_test_machine_. ${idx} + Ctn Schedule Forced Host Check ${host} /tmp/test_connector_ssh/rw/centengine.cmd + END + Sleep 10 seconds we wait engine forced checks + ${run_env}= Ctn Run Env + IF "${run_env}" == "docker" + Log To Console test with ipv6 skipped in docker environment + ELSE + ${search_result}= Ctn Check Search /tmp/test_connector_ssh/log/centengine.debug /usr/lib64/nagios/plugins/check_by_ssh -H ::1 + Should Contain ${search_result} output='toto=::1' check not found for ::1 END - Sleep 10 seconds we wait engine forced checks - ${run_env}= Run Env - IF "${run_env}" == "docker" - Log To Console test with ipv6 skipped in docker environment - ELSE - ${search_result}= check search /tmp/test_connector_ssh/log/centengine.debug /usr/lib64/nagios/plugins/check_by_ssh -H ::1 - Should Contain ${search_result} output='toto=::1' msg=check not found for ::1 - END - FOR ${idx} IN RANGE 1 5 - ${expected_output}= Catenate SEPARATOR= output='toto=127.0.0. ${idx} - ${search_str}= Catenate SEPARATOR= /usr/lib64/nagios/plugins/check_by_ssh -H 127.0.0. ${idx} - ${search_result}= check search /tmp/test_connector_ssh/log/centengine.debug ${search_str} - Should Contain ${search_result} ${expected_output} msg=check not found for ${expected_output} + FOR ${idx} IN RANGE 1 5 + ${expected_output}= Catenate SEPARATOR= output='toto=127.0.0. ${idx} + ${search_str}= Catenate SEPARATOR= /usr/lib64/nagios/plugins/check_by_ssh -H 127.0.0. ${idx} + ${search_result}= Ctn Check Search /tmp/test_connector_ssh/log/centengine.debug ${search_str} + Should Contain ${search_result} ${expected_output} check not found for ${expected_output} END diff --git a/tests/engine/forced_checks.robot b/tests/engine/forced_checks.robot index 253034fb543..042510df6b1 100644 --- a/tests/engine/forced_checks.robot +++ b/tests/engine/forced_checks.robot @@ -8,42 +8,42 @@ Library OperatingSystem Library ../resources/Broker.py Library ../resources/Engine.py -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 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 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 @@ -54,39 +54,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 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 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 @@ -97,46 +97,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 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 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 @@ -147,45 +147,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 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 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 @@ -196,84 +196,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 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. - 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 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. 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 @@ -282,42 +282,42 @@ 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 - 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 a0754932fe1..51615eba5c7 100644 --- a/tests/engine/perl-connectors.robot +++ b/tests/engine/perl-connectors.robot @@ -1,33 +1,33 @@ *** Settings *** -Resource ../resources/resources.robot -Suite Setup Clean Before Suite -Suite Teardown Clean After Suite -Test Setup Stop Processes +Resource ../resources/resources.robot +Suite Setup Ctn Clean Before Suite +Suite Teardown Ctn Clean After Suite +Test Setup Ctn Stop Processes -Documentation Centreon Engine test perl connectors -Library Process -Library OperatingSystem -Library DateTime -Library ../resources/Engine.py -Library ../resources/Broker.py -Library ../resources/Common.py +Documentation Centreon Engine test perl connectors +Library Process +Library OperatingSystem +Library DateTime +Library ../resources/Engine.py +Library ../resources/Broker.py +Library ../resources/Common.py *** 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 - ${start}= Get Current Date + [Documentation] Check with perl connector + [Tags] Engine start-stop + Ctn Config Engine ${1} + Ctn Config Broker module + Ctn Engine Config Set Value ${0} log_level_commands trace + ${start} Get Current Date - Start Engine - ${content}= Create List connector::run: connector='Perl Connector' - ${result}= Find In Log with timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=Missing a message talking about 'Perl Connector' + Ctn Start Engine + ${content} Create List connector::run: connector='Perl Connector' + ${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 - Should Be True ${result} msg=Missing a message telling data is available from the Perl connector + ${content} Create List connector::data_is_available + ${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 b95aa356339..b97dff5a101 100644 --- a/tests/engine/start-stop.robot +++ b/tests/engine/start-stop.robot @@ -1,8 +1,8 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Engine only start/stop tests Library Process @@ -14,35 +14,35 @@ Library ../resources/Engine.py 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 ed160e51d21..b9bf1f9c3b0 100644 --- a/tests/migration/migration.robot +++ b/tests/migration/migration.robot @@ -1,8 +1,8 @@ *** Settings *** Resource ../resources/resources.robot -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 Documentation Centreon Broker and Engine are configured in bbdo2 with sql/storage outputs. Then we change these outputs to unified_sql. The we change bbdo2 to bbdo3. And we make all the way in reverse order. @@ -20,98 +20,98 @@ 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} 200 + ${result}= Ctn Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 Should Be True ${result} msg=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} msg=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 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} 200 + ${result}= Ctn Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 Should Be True ${result} msg=No service status processed by the unified_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} msg=No metric sent to rrd cbd by unified_sql for 30s - Broker Config Add Item module0 bbdo_version 3.0.0 - Broker Config Add Item module1 bbdo_version 3.0.0 - Broker Config Add Item module2 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 Broker Config Add Item module0 bbdo_version 3.0.0 + Ctn Broker Config Add Item module1 bbdo_version 3.0.0 + Ctn Broker Config Add Item module2 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 Log To Console Move to BBDO 3.0.0 - 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} 200 + ${result}= Ctn Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 Should Be True ${result} msg=No pb service status processed by the unified_sql output with BBDO3 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} msg=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 - 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} 200 + ${result}= Ctn Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 Should Be True ${result} msg=No service status processed by the unified_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} msg=No metric sent to rrd cbd by unified_sql for 30s Log To Console Move back to 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} msg=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} msg=No metric sent to rrd cbd for 30s - Stop Engine - Kindly Stop Broker + Ctn Stop Engine + Ctn Kindly Stop Broker diff --git a/tests/resources/Broker.py b/tests/resources/Broker.py index abac5b0f370..6ec19d4dedf 100755 --- a/tests/resources/Broker.py +++ b/tests/resources/Broker.py @@ -419,7 +419,7 @@ def _apply_conf(name, callback): f.close() -def config_broker(name, poller_inst: int = 1): +def ctn_config_broker(name, poller_inst: int = 1): """ Configure a broker instance for test. Write the configuration files. @@ -476,7 +476,7 @@ def config_broker(name, poller_inst: int = 1): f.close() -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. @@ -491,7 +491,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. @@ -508,7 +508,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. @@ -524,7 +524,7 @@ def input_to_grpc(conf): _apply_conf(name, input_to_grpc) -def add_broker_crypto(json_dict, add_cert: bool, only_ca_cert: bool): +def ctn_add_broker_crypto(json_dict, add_cert: bool, only_ca_cert: bool): json_dict["encryption"] = "yes" if (add_cert): json_dict["ca_certificate"] = "/tmp/ca_1234.crt" @@ -533,7 +533,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. @@ -550,11 +550,11 @@ def crypto_modifier(conf): input_dict = conf["centreonBroker"]["input"] for i, v in enumerate(input_dict): if v["type"] == "grpc": - add_broker_crypto(v, add_cert, reversed) + ctn_add_broker_crypto(v, add_cert, reversed) _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 @@ -571,11 +571,11 @@ def crypto_modifier(conf): input_dict = conf["centreonBroker"]["output"] for i, v in enumerate(input_dict): if v["type"] == "grpc": - add_broker_crypto(v, add_cert, not reversed) + ctn_add_broker_crypto(v, add_cert, not reversed) _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. @@ -597,7 +597,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. @@ -619,7 +619,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. @@ -639,7 +639,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. @@ -659,7 +659,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. @@ -680,7 +680,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. @@ -701,7 +701,7 @@ def compression_modifier(conf): _apply_conf(config_name, compression_modifier) -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. @@ -754,7 +754,7 @@ def config_broker_bbdo_input(name, stream, port, proto, host=None): f.close() -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. @@ -773,7 +773,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") @@ -806,7 +806,7 @@ def config_broker_bbdo_output(name, stream, port, proto, host=None): f.close() -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. @@ -893,7 +893,7 @@ def config_broker_sql_output(name, output, queries_per_transaction: int = 20000) f.close() -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. @@ -927,7 +927,7 @@ def broker_config_clear_outputs_except(name, ex: list): f.close() -def broker_config_add_item(name, key, value): +def ctn_broker_config_add_item(name, key, value): """ Add an item to the broker configuration @@ -957,7 +957,7 @@ def broker_config_add_item(name, key, value): f.close() -def broker_config_remove_item(name, key): +def ctn_broker_config_remove_item(name, key): """ Remove an item from the broker configuration @@ -986,7 +986,7 @@ def broker_config_remove_item(name, key): f.close() -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. @@ -1021,7 +1021,7 @@ def broker_config_add_lua_output(name, output, luafile): f.close() -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. @@ -1033,7 +1033,7 @@ def broker_config_output_set(name, output, key, value): *Example:* - | Broker Config Output Set | central | central-broker-master-sql | host | localhost | + | Ctn Broker Config Output Set | central | central-broker-master-sql | host | localhost | """ if name == 'central': filename = "central-broker.json" @@ -1053,7 +1053,7 @@ def broker_config_output_set(name, output, key, value): f.close() -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. @@ -1065,7 +1065,7 @@ def broker_config_output_set_json(name, output, key, value): *Example:* - | Broker Config Output Set Json | central | central-broker-master-sql | filters | {"category": ["neb", "foo", "bar"]} | + | Ctn Broker Config Output Set Json | central | central-broker-master-sql | filters | {"category": ["neb", "foo", "bar"]} | """ if name == 'central': filename = "central-broker.json" @@ -1086,7 +1086,7 @@ def broker_config_output_set_json(name, output, key, value): f.close() -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. @@ -1097,7 +1097,7 @@ def broker_config_output_remove(name, output, key): *Example:* - | Broker Config Output Remove | central | centreon-broker-master-rrd | host | + | Ctn Broker Config Output Remove | central | centreon-broker-master-rrd | host | """ if name == 'central': filename = "central-broker.json" @@ -1118,7 +1118,7 @@ def broker_config_output_remove(name, output, key): f.close() -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. @@ -1150,7 +1150,7 @@ def broker_config_input_set(name, inp, key, value): f.close() -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. @@ -1178,7 +1178,7 @@ def broker_config_input_remove(name, inp, key): f.close() -def broker_config_log(name, key, value): +def ctn_broker_config_log(name, key, value): """ Configure broker log level. @@ -1208,7 +1208,7 @@ def broker_config_log(name, key, value): f.close() -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. @@ -1237,7 +1237,7 @@ def broker_config_flush_log(name, value): f.close() -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. @@ -1266,7 +1266,7 @@ def broker_config_source_log(name, value): f.close() -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. @@ -1310,7 +1310,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. @@ -1355,7 +1355,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. @@ -1406,7 +1406,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. @@ -1451,7 +1451,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. @@ -1497,7 +1497,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. """ @@ -1507,7 +1507,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 @@ -1537,7 +1537,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. @@ -1581,7 +1581,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. @@ -1625,7 +1625,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. @@ -1659,7 +1659,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. @@ -1708,7 +1708,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. @@ -1720,10 +1720,10 @@ def run_reverse_bam(duration, interval): subp.Popen("broker/map_client.py {:f}".format(interval), shell=True, stdout=subp.PIPE, stdin=subp.PIPE) time.sleep(duration) - getoutput("kill -9 $(ps aux | grep map_client.py | awk '{print $2}')") + getoutput("kill -9 $(ps aux | ctn_grep map_client.py | awk '{print $2}')") -def start_map(): +def ctn_start_map(): """ Launch the map_client_types.py script that simulates map. """ @@ -1732,7 +1732,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. """ @@ -1740,7 +1740,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 @@ -1799,7 +1799,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. @@ -1810,7 +1810,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. """ @@ -1835,7 +1835,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. @@ -1889,7 +1889,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 @@ -1919,12 +1919,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