Commit 01cf76f2 authored by douomo's avatar douomo
Browse files

sleep mvoed in robot framework, change notification check, added control on SNIR=99.8

parent dcd5e05e
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -40,16 +40,19 @@ Mute ODU and Query Alarms
    ${t}=    Connect With Key    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    ${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"]}
    #${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -40.0
    BuiltIn.Sleep    2s
    #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
    #opt: retrieve "number-of-alarms" and check if the number increases after the mute of the ODU
    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
    ${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
    ${SNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    ${SNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"    #99.8 for Nokia
#    Should Be Equal    ${SNR}    0
#    Should Be Equal    ${SNR}    0
    ${ok}=    Evaluate    float(${SNR}) < 15
    ${ok}=    Evaluate    float(${SNR}) < 15
    ${ok_nokia}=    Evaluate    float(${SNR}) == 99.8
    Should Be True      ${ok}    msg=SNR (${SNR}) must be less than 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}
@@ -63,9 +66,10 @@ Mute ODU and Receive RSL Alarms
    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
    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 TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -40.0
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -40.0
#    ${resp}=    Evaluate    ${m}.create_subscription(stream_name="NETCONF")
    BuiltIn.Sleep    2s
    ${resp}=    Call Method    ${m}    create_subscription    stream_name=NETCONF
    ${resp}=    Call Method    ${m}    create_subscription    stream_name=NETCONF
    Mute ODU    ${t}    ${transmitter["testInterface"]}
    Mute ODU    ${t}    ${transmitter["testInterface"]}
    BuiltIn.Sleep    2s
    ${notif}=    Call Method    ${m}    take_notification    timeout=${TIMEOUT}
    ${notif}=    Call Method    ${m}    take_notification    timeout=${TIMEOUT}
    ${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}
@@ -81,6 +85,7 @@ Mute ODU Receive RSL Alarms and Unmute
    #${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    #${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    Unmute ODU    ${t}    ${transmitter["testInterface"]}
    Unmute ODU    ${t}    ${transmitter["testInterface"]}
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    
    BuiltIn.Sleep    2s
    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
    ${resp}=    Call Method    ${m}    create_subscription    stream_name=NETCONF
@@ -92,6 +97,7 @@ Mute ODU Receive RSL Alarms and Unmute
    Log    ${notif_xml}    console=yes
    Log    ${notif_xml}    console=yes
    Unmute ODU    ${t}    ${transmitter["testInterface"]}
    Unmute ODU    ${t}    ${transmitter["testInterface"]}
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    
    BuiltIn.Sleep    2s
    ${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
    ${ok}=    Evaluate    float(${actual-recevied}) > -40
+52 −23
Original line number Original line Diff line number Diff line
@@ -31,14 +31,14 @@ Get Power
    Close Current Session    ${m}
    Close Current Session    ${m}


Decrease TX Power
Decrease TX Power
    [Arguments]    ${par}    ${transimitter}
    [Arguments]    ${par}    ${transmitter}
    ${m}=    Connect With Key    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["key_filename"]}
    ${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"]}
    #${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 Key    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["password"]}
    #${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    Set TX Power    ${t}    ${transimitter["testInterface"]}    ${transimitter["maxTxPower"]}    #On transimitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    #On transmitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    ${init_SNR} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    ${init_SNR} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    Set TX Power    ${t}    ${transimitter["testInterface"]}    ${transimitter["minTxPower"]}    #On transimitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["minTxPower"]}    #On transmitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    ${final_SNR} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    ${final_SNR} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    Log    Got SNR: ${final_SNR}    console=yes
    Log    Got SNR: ${final_SNR}    console=yes
    Should Be True    ${final_SNR}<=${init_SNR}
    Should Be True    ${final_SNR}<=${init_SNR}
@@ -47,41 +47,70 @@ Decrease TX Power
    
    


Check alarm
Check alarm
    [Arguments]    ${par}    ${transimitter}
    [Arguments]    ${par}    ${transmitter}
    ${m}=    Connect With Key    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["key_filename"]}
    ${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"]}
    # ${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 Key    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    # ${t}=    Connect With Credentials    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["password"]}
    # ${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    Set TX Power    ${t}    ${transimitter["testInterface"]}    ${transimitter["maxTxPower"]}    #On transimitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    #On transmitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    BuiltIn.Sleep    2s
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -20.0
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -20.0
    ${init_SNR} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    ${init_SNR} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    ${resp}=    Evaluate    ${m}.create_subscription()
    ${resp}=    Evaluate    ${m}.create_subscription()
    Set TX Power    ${t}    ${transimitter["testInterface"]}    ${transimitter["minTxPower"]}    #On transimitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["minTxPower"]}    #On transmitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    ${notif}=    Call Method    ${m}    take_notification    timeout=${TIMEOUT}
    ${notif}=    Call Method    ${m}    take_notification    timeout=${TIMEOUT}
    IF     ${notif}!=${None}
    ${notif_type}=    Evaluate    str(type($notif))    modules=sys
        Log    ${notif}    console=yes
    Log    Notification object type: ${notif_type}    console=yes
        ${final_SNR} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    ${is_not_none}=    Evaluate    $notif is not None
    IF    ${is_not_none}
        Log    Notification received: ${notif}    console=yes
        ${notif_xml}=    Call Method    ${notif}    __getattribute__    notification_xml
        Log    Notification XML:\n${notif_xml}    console=yes
        Should Not Be Empty    ${notif_xml}
        ${final_SNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    actual-snir
        Log    Initial SNR value: ${init_SNR}    console=yes
        Log    Final SNR value: ${final_SNR}    console=yes
    ELSE
        Fail    No notification received within timeout period (${TIMEOUT}s)
    END
    END
    Should Be True    ${final_SNR}<${init_SNR}
    Should Be True    ${final_SNR}<${init_SNR}
    Close Current Session    ${m}
    Close Current Session    ${m}
    Close Current Session    ${t}
    Close Current Session    ${t}
    
    

Reaction to Alarm
Reaction to Alarm
    [Arguments]    ${par}    ${transimitter}
    [Arguments]    ${par}    ${transmitter}
    ${m}=    Connect With Key    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["key_filename"]}
    ${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"]}
    # ${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 Key    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    # ${t}=    Connect With Credentials    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["password"]}
    # ${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    Set TX Power    ${m}    ${transimitter["testInterface"]}    ${transimitter["maxTxPower"]}    #On transimitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    #On transmitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -20.0
    BuiltIn.Sleep    5s
    ${resp}=    Evaluate    ${m}.create_subscription()
    Set RSL Threshold    ${m}    ${par["testInterface"]}    -40.0
    Set TX Power    ${t}    ${transimitter["testInterface"]}    ${transimitter["minTxPower"]}    #On transimitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    ${init_SNR} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    ${resp}=    Call Method    ${m}    create_subscription    stream_name=NETCONF
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["minTxPower"]}    #On transmitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    ${notif}=    Call Method    ${m}    take_notification    timeout=${TIMEOUT}
    ${notif}=    Call Method    ${m}    take_notification    timeout=${TIMEOUT}
    IF    ${notif}!=${None}
    # Safely evaluate the Python object type.
        ${DegradedSNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    # Using $notif (not ${notif}) avoids Robot expanding the object into an invalid string.
        Set TX Power    ${t}    ${transimitter["testInterface"]}    ${transimitter["maxTxPower"]}    #On transimitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    ${notif_type}=    Evaluate    str(type($notif))    modules=sys
    Log    Notification object type: ${notif_type}    console=yes
    ${is_not_none}=    Evaluate    $notif is not None
    IF    ${is_not_none}
        Log    Notification received: ${notif}    console=yes
        ${notif_xml}=    Call Method    ${notif}    __getattribute__    notification_xml
        Log    Notification XML:\n${notif_xml}    console=yes
        Should Not Be Empty    ${notif_xml}
        ${Degraded_SNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    actual-snir
        Log    Initial SNR value: ${init_SNR}    console=yes
        Log    Degraded SNR value: ${Degraded_SNR}    console=yes
        Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}
        BuiltIn.Sleep    5s
    ELSE
        Fail    No notification received within timeout period (${TIMEOUT}s)
    END
    END
    ${restoredSNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    ${restoredSNR}=    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-snir"
    Log    Restored SNR value: ${restoredSNR}    console=yes
    Should Be True    ${DegradedSNR}<${restoredSNR}
    Should Be True    ${DegradedSNR}<${restoredSNR}
    Close Current Session    ${m}
    Close Current Session    ${m}
    Close Current Session    ${t}
    Close Current Session    ${t}
−233 B (7.78 KiB)

File changed.

No diff preview for this file type.

+0 −3
Original line number Original line Diff line number Diff line
@@ -81,7 +81,6 @@ def set_TX_power(m, int_name, txPower):
    BuiltIn().log_to_console(xml)
    BuiltIn().log_to_console(xml)
    m.edit_config(target="candidate", config=xml)
    m.edit_config(target="candidate", config=xml)
    m.commit()
    m.commit()
    time.sleep(2)
    
    
def set_SNR_threshold(m,int_name, t):
def set_SNR_threshold(m,int_name, t):
    env = Environment( loader=FileSystemLoader("."), autoescape=False)
    env = Environment( loader=FileSystemLoader("."), autoescape=False)
@@ -116,7 +115,6 @@ 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)
@@ -126,7 +124,6 @@ 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()
Loading