Commit c229141a authored by douomo's avatar douomo
Browse files

Fixed AlarmTest

parent 1e56d939
Loading
Loading
Loading
Loading
+27 −19
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@ Library NcclientLibrary
Library        common.py
Variables    ne-cfg.py

*** Variables ***
${TIMEOUT}    ${60}


*** Test Cases ***
Test_1
@@ -31,38 +34,43 @@ Query Alarms
    Close Current Session    ${m}

Mute ODU and Query Alarms    
    [Arguments]    ${par}    ${transimitter}
    [Arguments]    ${par}    ${transmitter}
    ${m}=    Connect With Key    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["key_filename"]}
    #${m}=    Connect With Credentials    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["password"]}
    ${t}=    Connect With Key    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["password"]}
    Set RSL Threshold    ${m}    ${par["testInterface"]}    20
    ${t}=    Connect With Key    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -40.0
    ${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
    Log    ${alarms}    console=yes
    Mute ODU    ${t}    ${par["testInterface"]}    #Interface name to mute #On transimitter 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
    ${alarms}=    Get Filtered Config    ${m}    filters/alarms-list.xml
    Log    ${alarms}    console=yes
    ${SNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    Should Be True    ${SNR} <= 10.0
#    Should Be Equal    ${SNR}    0
    ${ok}=    Evaluate    float(${SNR}) < 15
    Should Be True      ${ok}    msg=SNR (${SNR}) deve essere minore di 15
    Close Current Session    ${m}
    Close Current Session    ${t}

Mute ODU and Receive RSL Alarms
    [Arguments]    ${par}    ${transimitter}
    [Arguments]    ${par}    ${transmitter}
    ${m}=    Connect With Key    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["key_filename"]}
    #${m}=    Connect With Credentials    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["password"]}
    ${t}=    Connect With Key    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["password"]}
    Unmute ODU    ${t}    ${par["testInterface"]}    #Interface name to mute #On transimitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    Set RSL Threshold    ${m}    ${par["testInterface"]}    20
    ${resp}=    Evaluate    ${m}.create_subscription()
    Mute ODU    ${t}    ${par["testInterface"]}
    ${notif}=    Evaluate    next(${m}.take_notification(timeout=60))
    Log    ${notif}    console=yes
    Should Not Be Empty    ${notif}
    Close Current Session    ${m}
    Close Current Session    ${t}
    ${t}=    Connect With Key    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    Unmute 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
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -40.0
#    ${resp}=    Evaluate    ${m}.create_subscription(stream_name="NETCONF")
    ${resp}=    Call Method    ${m}    create_subscription    stream_name=NETCONF
    Mute ODU    ${t}    ${transmitter["testInterface"]}
#    ${notif}=    Evaluate    next(${m}.take_notification(timeout=60))
#   Log    ${notif}    console=yes
#   Should Not Be Empty    ${notif}
    ${notif}=    Call Method    ${m}    take_notification    timeout=${TIMEOUT}
    ${notif_xml}=    Set Variable    ${notif.notification_xml}
    Should Not Be Empty    ${notif_xml}
    Log To Console    ${notif_xml}

Mute ODU Receive RSL Alarms and Unmute
    [Arguments]    ${par}    ${transimitter}
@@ -71,7 +79,7 @@ Mute ODU Receive RSL Alarms and Unmute
    ${t}=    Connect With Key    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["password"]}
    Unmute ODU    ${t}    ${par["ODUName"]}
    Set RSL Threshold    ${m}    ${par["testInterface"]}    20
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -40
    ${resp}=    Evaluate    ${m}.create_subscription()
    Mute ODU    ${t}    ${par["ODUName"]}
    ${notif}=    Evaluate    next(${m}.take_notification(timeout=60))