Commit 2a16a01a authored by douomo's avatar douomo
Browse files

Fixed check in AlarmTest, added sleep after muting the ODU

parent babf71c9
Loading
Loading
Loading
Loading
+13 −5
Original line number Original line Diff line number Diff line
@@ -49,7 +49,7 @@ Mute ODU and Query Alarms
    ${SNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    ${SNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
#    Should Be Equal    ${SNR}    0
#    Should Be Equal    ${SNR}    0
    ${ok}=    Evaluate    float(${SNR}) < 15
    ${ok}=    Evaluate    float(${SNR}) < 15
    Should Be True      ${ok}    msg=SNR (${SNR}) deve essere minore di 15
    Should Be True      ${ok}    msg=SNR (${SNR}) must be less than 15
    Close Current Session    ${m}
    Close Current Session    ${m}
    Close Current Session    ${t}
    Close Current Session    ${t}


@@ -71,6 +71,8 @@ Mute ODU and Receive RSL Alarms
    ${notif_xml}=    Set Variable    ${notif.notification_xml}
    ${notif_xml}=    Set Variable    ${notif.notification_xml}
    Should Not Be Empty    ${notif_xml}
    Should Not Be Empty    ${notif_xml}
    Log To Console    ${notif_xml}
    Log To Console    ${notif_xml}
    Close Current Session    ${m}
    Close Current Session    ${t}


Mute ODU Receive RSL Alarms and Unmute
Mute ODU Receive RSL Alarms and Unmute
    [Arguments]    ${par}    ${transimitter}
    [Arguments]    ${par}    ${transimitter}
@@ -80,13 +82,19 @@ Mute ODU Receive RSL Alarms and Unmute
    #${t}=    Connect With Credentials    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["password"]}
    #${t}=    Connect With Credentials    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["password"]}
    Unmute ODU    ${t}    ${transimitter["ODUName"]}
    Unmute ODU    ${t}    ${transimitter["ODUName"]}
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -40
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -40
    ${resp}=    Evaluate    ${m}.create_subscription()
    #${resp}=    Evaluate    ${m}.create_subscription()
    ${resp}=    Call Method    ${m}    create_subscription    stream_name=NETCONF
    Mute ODU    ${t}    ${transimitter["testInterface"]}
    Mute ODU    ${t}    ${transimitter["testInterface"]}
    ${notif}=    Evaluate    next(${m}.take_notification(timeout=60))
    #${notif}=    Evaluate    next(${m}.take_notification(timeout=60))
    Log    ${notif}    console=yes
    ${notif}=    Call Method    ${m}    take_notification    timeout=${TIMEOUT}
    ${notif_xml}=    Set Variable    ${notif.notification_xml}
    Should Not Be Empty    ${notif_xml}
    Log    ${notif_xml}    console=yes
    Should Not Be Empty    ${notif}
    Should Not Be Empty    ${notif}
    Unmute ODU    ${t}    ${transimitter["testInterface"]}
    Unmute ODU    ${t}    ${transimitter["testInterface"]}
    ${actual-recevied}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-received-level"
    ${actual-recevied}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-received-level"
    Should Be True    ${actual-recevied}>0
    #Should Be True    ${actual-recevied}>0
    ${ok}=    Evaluate    float(${actual-recevied}) > -40
    Should Be True      ${ok}    msg=Actual RSL (${actual-recevied}) must be greater than -40
    Close Current Session    ${m}
    Close Current Session    ${m}
    Close Current Session    ${t}
    Close Current Session    ${t}
 No newline at end of file
+126 B (8.01 KiB)

File changed.

No diff preview for this file type.

+2 −0
Original line number Original line Diff line number Diff line
@@ -116,6 +116,7 @@ def mute_ODU(m, name):
    xml = env.get_template("configFile/stateDown.xml.pyformat").render(context)
    xml = env.get_template("configFile/stateDown.xml.pyformat").render(context)
    m.edit_config(target="candidate", config=xml)
    m.edit_config(target="candidate", config=xml)
    m.commit()
    m.commit()
    time.sleep(2)
    
    
def unmute_ODU(m, name):
def unmute_ODU(m, name):
    env = Environment( loader=FileSystemLoader("."), autoescape=False)
    env = Environment( loader=FileSystemLoader("."), autoescape=False)
@@ -125,6 +126,7 @@ def unmute_ODU(m, name):
    xml = env.get_template("configFile/stateUp.xml.pyformat").render(context)
    xml = env.get_template("configFile/stateUp.xml.pyformat").render(context)
    m.edit_config(target="candidate", config=xml)
    m.edit_config(target="candidate", config=xml)
    m.commit()
    m.commit()
    time.sleep(2)


def close_current_session(m):
def close_current_session(m):
    m.close_session()
    m.close_session()