Commit 915a8ad6 authored by douomo's avatar douomo
Browse files

updating scripts after mwt event

parent cf4f5047
Loading
Loading
Loading
Loading
+19 −17
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ Test_4
*** Keywords ***
Query Alarms
    [Arguments]    ${par}
    ${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 Key    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["key_filename"]}
    ${m}=    Connect With Credentials    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["password"]}
    ${alarms_list}=    Get Filtered Config    ${m}    filters/alarms-list.xml
    Log    ${alarms_list}    console=yes
    Should Not Be Empty    ${alarms_list}
@@ -35,12 +35,13 @@ Query Alarms

Mute ODU and Query Alarms    
    [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    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    #${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    ${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"]}
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}
    BuiltIn.Sleep    2s
    BuiltIn.Sleep    5s
    #Set RSL Threshold    ${m}    ${par["testInterface"]}    ${par["rslThreshold"]}    #check this
    ${alarms}=    Get Filtered Config    ${m}    filters/alarms-list.xml
    ${last_alarms_start}=    Check Time Last Alarm    ${alarms}
@@ -60,10 +61,10 @@ Mute ODU and Query Alarms

Mute ODU and Receive RSL Alarms
    [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    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    #${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    ${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 TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    
    Set RSL Threshold    ${m}    ${par["testInterface"]}    ${par["rslThreshold"]}
@@ -80,17 +81,18 @@ Mute ODU and Receive RSL Alarms

Mute ODU Receive RSL Alarms and Unmute
    [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    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    #${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    ${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"]}
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}    
    BuiltIn.Sleep    5s
    Set RSL Threshold    ${m}    ${par["testInterface"]}    ${par["rslThreshold"]}
    BuiltIn.Sleep    5s
    #${resp}=    Evaluate    ${m}.create_subscription()
    ${resp}=    Call Method    ${m}    create_subscription    stream_name=NETCONF
    Mute ODU    ${t}    ${transmitter["testInterface"]}
    BuiltIn.Sleep    5s
    #${notif}=    Evaluate    next(${m}.take_notification(timeout=60))
    ${notif}=    Call Method    ${m}    take_notification    timeout=${TIMEOUT}
    ${notif_xml}=    Set Variable    ${notif.notification_xml}
+15 −15
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ Test_4
*** Keywords ***
Get Power
    [Arguments]    ${par}
    ${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 Key    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["key_filename"]}
    ${m}=    Connect With Credentials    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["password"]}
    ${power} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-transmitted-level"
    Log    Got config: ${power}    console=yes
    Should Not Be Equal    ${power}    ${None}
@@ -32,10 +32,10 @@ Get Power

Decrease TX Power
    [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    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    #${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    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    ${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    Set TX Power    ${t}    ${transmitter["testInterface"]}    ${transmitter["maxTxPower"]}
    BuiltIn.Sleep    5s
    ${init_RSL} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-received-level"
@@ -44,17 +44,17 @@ Decrease TX Power
    ${final_RSL} =    Get Iface Metrics    ${m}    ${par["testInterface"]}    "actual-received-level"
    Log    Initial RSL value: ${init_RSL}    console=yes
    Log    Final RSL value: ${final_RSL}    console=yes
    Should Be True    ${final_RSL}<=${init_RSL}
    Should Be True    ${final_RSL}<${init_RSL}
    Close Current Session    ${m}
    Close Current Session    ${t}
    

Check alarm
    [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    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    # ${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    #${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    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
     ${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    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    5s
    Set RSL Threshold    ${m}    ${par["testInterface"]}    ${par["rslThreshold"]}
@@ -84,10 +84,10 @@ Check alarm

Reaction to Alarm
    [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    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    # ${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    #${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    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["key_filename"]}
    ${t}=    Connect With Credentials    ${transmitter["host"]}    ${transmitter["port"]}    ${transmitter["username"]}    ${transmitter["password"]}
    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    5s
    Set RSL Threshold    ${m}    ${par["testInterface"]}    ${par["rslThreshold"]}
+8 −2
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ from robot.libraries.BuiltIn import BuiltIn
from ncclient.operations import RPCError
import dateutil


def get_filtered_config(mgr, filter):   
    tree = ET.parse(filter)
    root = tree.getroot()
@@ -84,10 +85,13 @@ def set_TX_power(m, int_name, txPower):
    BuiltIn().log_to_console("New config for tx-power:")
    BuiltIn().log_to_console(xml)
    m.edit_config(target="candidate", config=xml)
    try:
    m.commit()
    """try:
        m.commit()
    except RPCError as e:
        BuiltIn().log_to_console("RCP ERROR. Message :", e.message, " info: ", e.info)
        BuiltIn().log_to_console("RCP ERROR during commit")
        BuiltIn().log_to_console("RCP ERROR. Message :")
        BuiltIn().log_to_console(e)"""
    BuiltIn().log_to_console("new power committed")
        
    
@@ -168,7 +172,9 @@ def count_alarm(xml_reply):

def check_time_last_alarm(xml_reply):
    tree = ET.fromstring(xml_reply)
    BuiltIn().log_to_console(xml_reply)
    last = tree.findall(".//ns0:last-changed", namespaces={"ns0": "urn:ietf:params:xml:ns:yang:ietf-alarms"})
    dt = dateutil.parser.isoparse(last[0].text)
    ts = dt.timestamp()
    #ts = last[0].text
    return(ts)
 No newline at end of file

features/S_C_vlan.feature

deleted100644 → 0
+0 −45
Original line number Diff line number Diff line
Feature: Simple VLAN management
    As a Network Controller,
    I want to deploy and remove VLANs on network elements.

Scenario: C-VLAN deployment
    Given the network mentioned in network.csv
    When the controller deploys VLAN 101
    Then the traffic should pass on this VLAN
     And the VLAN 101 should be in the configuration


Scenario: C-VLAN Removal
    Given the network mentioned in network.csv
    When the controller removes VLAN 101
    Then the traffic should not pass on this VLAN
     And the VLAN 101 should not be in the configuration

Scenario: S-VLAN PB deployment
    Given the network mentioned in network.csv
    When the controller deploys VLAN 201
    Then the traffic should pass on this VLAN
     And the VLAN 201 should be in the configuration


Scenario: S-VLAN PB Removal
    Given the network mentioned in network.csv
    When the controller removes VLAN 201
    Then the traffic should not pass on this VLAN
     And the VLAN 201 should not be in the configuration

Scenario: S-VLAN PEB deployment
    Given the network mentioned in network.csv
    When the controller deploys VLAN 301
     And the controller register the CVLAN 302 and 303 to the VLAN 301
    Then the traffic should pass on this VLAN
     And the VLAN 301 should be in the configuration


Scenario: S-VLAN PEB Removal
    Given the network mentioned in network.csv
    When the controller unregister the CVLAN 302 and 303 to the VLAN 301
     And the controller removes VLAN 301
    Then the traffic should not pass on this VLAN
     And the VLAN 301 should not be in the configuration
+313 −41

File changed.

Preview size limit exceeded, changes collapsed.

Loading