diff --git a/roles/check_demarcation_point/tasks/checks.yaml b/roles/check_demarcation_point/tasks/checks.yaml index 66dfc00818d567b9131c1e05decad655452e0208..ea9820ab4084c25d719e8ef936393a776e9085c0 100644 --- a/roles/check_demarcation_point/tasks/checks.yaml +++ b/roles/check_demarcation_point/tasks/checks.yaml @@ -55,10 +55,10 @@ - name: Check the interface PCS statistics ansible.builtin.assert: that: - - "{{ verb }}.{{ check_id }}.ethernet_pcs_statistics_bit_error_secs <= {{ pcs_bit_error_seconds_threshold }}" - - "{{ verb }}.{{ check_id }}.ethernet_pcs_statistics_errored_blocks_secs <= {{ pcs_bit_error_blocks_seconds_threshold }}" + - "{{ verb }}.{{ check_id }}.ethernet_pcs_statistics_bit_error_secs | int <= {{ pcs_bit_error_seconds_threshold }}" + - "{{ verb }}.{{ check_id }}.ethernet_pcs_statistics_errored_blocks_secs | int <= {{ pcs_bit_error_blocks_seconds_threshold }}" fail_msg: "FAIL: PCS statistics errors detected" - success_msg: "PASS: PCS statistics errors detected" + success_msg: "PASS: PCS statistics errors are below threshold" failed_when: false - name: Check the optical levels output Tx power low threshold (dBm) diff --git a/roles/check_demarcation_point/tasks/compare.yaml b/roles/check_demarcation_point/tasks/compare.yaml index e378f71f271de8835760c06e53d19faf2e16bebe..4d80857c92fa6f54d10f906975e7e38093f1f737 100644 --- a/roles/check_demarcation_point/tasks/compare.yaml +++ b/roles/check_demarcation_point/tasks/compare.yaml @@ -77,3 +77,35 @@ - pre_check[check_id] is defined - post_check[check_id] is defined - file_status.stat.exists + +- name: Check if Rx power in POST check is way lower than PRE check (above permitted threshold) + ansible.builtin.assert: + that: + - "{{ rx_power_dbm_diff | float }} > {{ rx_power_allowed_diff | float }} " + fail_msg: "WARNING: Rx Power (dBm) diff between pre/post check is bigger than allowed threshold." + success_msg: "PASS: Rx Power (dBm) diff between pre/post check is normal." + failed_when: false + +- name: Check if Tx power in POST check is way lower than PRE check (above permitted threshold) + ansible.builtin.assert: + that: + - "{{ tx_power_dbm_diff | float }} > {{ tx_power_allowed_diff | float }} " + fail_msg: "WARNING: Rx Power (dBm) diff between pre/post check is bigger than allowed threshold." + success_msg: "PASS: Rx Power (dBm) diff between pre/post check is normal." + failed_when: false + +- name: Check if input_errors increase diff between PRE and POST checks is above permitted threshold + ansible.builtin.assert: + that: + - "{{ input_error_count_diff | int }} < {{ input_error_count_threshold | int }} " + fail_msg: "WARNING: Input errors count in POST check have been increased above threshold." + success_msg: "PASS: Input errors count diffs between PRE and POST check is normal." + failed_when: false + +- name: Check if output_errors increase diff between PRE and POST checks is above permitted threshold + ansible.builtin.assert: + that: + - "{{ output_error_count_diff | int }} < {{ output_error_count_threshold | int }} " + fail_msg: "WARNING: Output errors count in POST check have been increased above threshold." + success_msg: "PASS: ASS: Output errors count diffs between PRE and POST check is normal." + failed_when: false \ No newline at end of file diff --git a/roles/check_demarcation_point/vars/optical_thresholds.yml b/roles/check_demarcation_point/vars/optical_thresholds.yml index 2c496bca622339ceac7b5aac8ae2a8ad2f12c507..0c81c198ad197e44730035c528c2e4dafcd2bf1a 100644 --- a/roles/check_demarcation_point/vars/optical_thresholds.yml +++ b/roles/check_demarcation_point/vars/optical_thresholds.yml @@ -3,6 +3,8 @@ min_tx_power_dbm: -8 max_tx_power_dbm: 0 min_rx_power_dbm: -10 max_rx_power_dbm: -0.5 +rx_power_allowed_diff: -2 +tx_power_allowed_diff: -2 input_error_count_threshold: 3 output_error_count_threshold: 3 fec_ccw_count_threshold: 0 @@ -10,4 +12,4 @@ fec_ccw_error_rate_threshold: 0 fec_nccw_count_threshold: 0 fec_nccw_error_rate_threshold: 0 pcs_bit_error_seconds_threshold: 20 -pcs_bit_error_blocks_seconds_threshold: 20 +pcs_bit_error_blocks_seconds_threshold: 20 \ No newline at end of file