Skip to content
Snippets Groups Projects
Commit 76fe316c authored by Thodoris Vasilopoulos's avatar Thodoris Vasilopoulos
Browse files

Create assertions by comparing the diff values on pre-post checks with threshold values

parent b30de90f
No related branches found
No related tags found
No related merge requests found
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
- name: Check the interface PCS statistics - name: Check the interface PCS statistics
ansible.builtin.assert: ansible.builtin.assert:
that: that:
- "{{ verb }}.{{ check_id }}.ethernet_pcs_statistics_bit_error_secs <= {{ pcs_bit_error_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 <= {{ pcs_bit_error_blocks_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" 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 failed_when: false
- name: Check the optical levels output Tx power low threshold (dBm) - name: Check the optical levels output Tx power low threshold (dBm)
......
...@@ -77,3 +77,35 @@ ...@@ -77,3 +77,35 @@
- pre_check[check_id] is defined - pre_check[check_id] is defined
- post_check[check_id] is defined - post_check[check_id] is defined
- file_status.stat.exists - 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
...@@ -3,6 +3,8 @@ min_tx_power_dbm: -8 ...@@ -3,6 +3,8 @@ min_tx_power_dbm: -8
max_tx_power_dbm: 0 max_tx_power_dbm: 0
min_rx_power_dbm: -10 min_rx_power_dbm: -10
max_rx_power_dbm: -0.5 max_rx_power_dbm: -0.5
rx_power_allowed_diff: -2
tx_power_allowed_diff: -2
input_error_count_threshold: 3 input_error_count_threshold: 3
output_error_count_threshold: 3 output_error_count_threshold: 3
fec_ccw_count_threshold: 0 fec_ccw_count_threshold: 0
...@@ -10,4 +12,4 @@ fec_ccw_error_rate_threshold: 0 ...@@ -10,4 +12,4 @@ fec_ccw_error_rate_threshold: 0
fec_nccw_count_threshold: 0 fec_nccw_count_threshold: 0
fec_nccw_error_rate_threshold: 0 fec_nccw_error_rate_threshold: 0
pcs_bit_error_seconds_threshold: 20 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment