Commit fd5be1dc authored by douomo's avatar douomo
Browse files

add check on the alarm number

parent 00ea7427
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -43,17 +43,18 @@ Mute ODU and Query Alarms
    BuiltIn.Sleep    2s
    BuiltIn.Sleep    2s
    #Set RSL Threshold    ${m}    ${par["testInterface"]}    -40.0    #check this
    #Set RSL Threshold    ${m}    ${par["testInterface"]}    -40.0    #check this
    ${alarms}=    Get Filtered Config    ${m}    filters/alarms-list.xml
    ${alarms}=    Get Filtered Config    ${m}    filters/alarms-list.xml
    #opt: retrieve "number-of-alarms" and check if the number increases after the mute of the ODU
    ${alarms_num_start}=    Count Alarm    ${alarms}
    Log    ${alarms}    console=yes
    Log    ${alarms}    console=yes
    Mute ODU    ${t}    ${transmitter["testInterface"]}    #Interface name to mute #On transmitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    Mute ODU    ${t}    ${transmitter["testInterface"]}    #Interface name to mute #On transmitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    BuiltIn.Sleep    2s
    BuiltIn.Sleep    2s
    ${alarms}=    Get Filtered Config    ${m}    filters/alarms-list.xml
    ${alarms}=    Get Filtered Config    ${m}    filters/alarms-list.xml
    Log    ${alarms}    console=yes
    Log    ${alarms}    console=yes
    ${alarms_num_end}=    Count Alarm    ${alarms}
    ${SNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"    #99.8 for Nokia
    ${SNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"    #99.8 for Nokia
#    Should Be Equal    ${SNR}    0
    ${ok}=    Evaluate    float(${SNR}) < 15
    ${ok}=    Evaluate    float(${SNR}) < 15
    ${ok_nokia}=    Evaluate    float(${SNR}) == 99.8
    ${ok_nokia}=    Evaluate    float(${SNR}) == 99.8
    Should Be True      ${ok}    msg=SNR (${SNR}) must be less than 15
    Should Be True      ${ok} or ${ok_nokia}    msg=SNR (${SNR}) must be less than 15
    Should Be True    ${alarms_num_start} < ${alarms_num_end}
    Close Current Session    ${m}
    Close Current Session    ${m}
    Close Current Session    ${t}
    Close Current Session    ${t}


+354 B (8.13 KiB)

File changed.

No diff preview for this file type.

+7 −1
Original line number Original line Diff line number Diff line
@@ -150,3 +150,9 @@ def check_power_degradation(init_xml_power, final_xml_power):
    tx_power = tree.findall(".//ns1:actual-transmitted-level", namespaces={"ns0" :"urn:ietf:params:xml:ns:netconf:base:1.0","ns1": "urn:ietf:params:xml:ns:yang:ietf-microwave-radio-link"})
    tx_power = tree.findall(".//ns1:actual-transmitted-level", namespaces={"ns0" :"urn:ietf:params:xml:ns:netconf:base:1.0","ns1": "urn:ietf:params:xml:ns:yang:ietf-microwave-radio-link"})
    final_tx_power = float(tx_power[0].text)
    final_tx_power = float(tx_power[0].text)
    return final_tx_power < init_tx_power
    return final_tx_power < init_tx_power


def count_alarm(xml_reply):
    tree = ET.fromstring(xml_reply)
    alarm = tree.findall(".//ns0:alarm", namespaces={"ns0": "urn:ietf:params:xml:ns:yang:ietf-alarms"})
    return len(alarm)
 No newline at end of file