Commit 52b55603 authored by douomo's avatar douomo
Browse files

updated filter for mute and unmute ODU

parent a4404213
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -33,7 +33,7 @@ Mute ODU and Query Alarms
    #${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    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["key_filename"]}
    #${t}=    Connect With Credentials    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["password"]}
    #${t}=    Connect With Credentials    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["password"]}
    Mute ODU    ${t}    ${par["ODUName"]}    #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}    ${par["testInterface"]}    #Interface name to mute #On transimitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    ${alarms}=    Get Filtered Config    ${m}    filters/alarms.xml
    ${alarms}=    Get Filtered Config    ${m}    filters/alarms.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"
@@ -47,10 +47,10 @@ Mute ODU and Receive SNR Alarms
    #${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    ${transimitter["host"]}    ${transimitter["port"]}    ${transimitter["username"]}    ${transimitter["key_filename"]}
    #${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}    ${par["ODUName"]}    #Interface name to mute #On transimitter node: need to connect to the TX and change ${m} with the reference to the transmitter
    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
    Set RSL Threshold    ${m}    ${par["testInterface"]}    20
    ${resp}=    Evaluate    ${m}.create_subscription()
    ${resp}=    Evaluate    ${m}.create_subscription()
    Mute ODU    ${t}    ${par["ODUName"]}
    Mute ODU    ${t}    ${par["testInterface"]}
    ${notif}=    Evaluate    next(${m}.take_notification(timeout=60))
    ${notif}=    Evaluate    next(${m}.take_notification(timeout=60))
    Log    ${notif}    console=yes
    Log    ${notif}    console=yes
    Should Not Be Empty    ${notif}
    Should Not Be Empty    ${notif}
+8 −8
Original line number Original line Diff line number Diff line
<config>
<nc:config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <odu xmlns="urn:ietf:params:xml:ns:yang:ietf-otn-odu">
  <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
    <odu-config>
    <interface>
        <name>{{ name }}</name>
        <name>{{ name }}</name>
      <admin-state>down</admin-state>
        <tx-enabled>false</tx-enabled>
    </odu-config>
    </interface>
  </odu>
  </interfaces>
</config>
</nc:config>
 No newline at end of file
+8 −8
Original line number Original line Diff line number Diff line
<config>
<nc:config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <odu xmlns="urn:ietf:params:xml:ns:yang:ietf-otn-odu">
  <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
    <odu-config>
    <interface>
        <name>{{ name }}</name>
        <name>{{ name }}</name>
      <admin-state>down</admin-state>
        <tx-enabled>false</tx-enabled>
    </odu-config>
    </interface>
  </odu>
  </interfaces>
</config>
</nc:config>
 No newline at end of file
+6 −4
Original line number Original line Diff line number Diff line
@@ -32,7 +32,8 @@ class NetconfLibrary:
    """RobotFramework library to control network element via NETCONF."""
    """RobotFramework library to control network element via NETCONF."""


    builtin = BuiltIn()
    builtin = BuiltIn()
    network: Optional[list[NetworkElement]] = None
    #network: Optional[list[NetworkElement]] = None
    network = list[NetworkElement]
    
    
    @keyword("the network mentioned in ${network_filename}")
    @keyword("the network mentioned in ${network_filename}")
    def the_network_mentioned_in_csv(self, network_filename: str) -> None:
    def the_network_mentioned_in_csv(self, network_filename: str) -> None:
@@ -40,6 +41,7 @@ class NetconfLibrary:
        with open(network_filename, encoding="ascii") as file:
        with open(network_filename, encoding="ascii") as file:
            csv = DictReader(file)
            csv = DictReader(file)
            network = [NetworkElement(**ne) for ne in csv]
            network = [NetworkElement(**ne) for ne in csv]
            BuiltIn().log_to_console(network)
        self.network = network
        self.network = network


    @keyword("the controller deploys VLAN ${vlan_id}")
    @keyword("the controller deploys VLAN ${vlan_id}")
@@ -50,13 +52,13 @@ class NetconfLibrary:
        for ne in self.network:
        for ne in self.network:
            m = connect_with_key(ne.address, ne.mgmt_port, ne.username, "/home/douomo/.ssh/netconf_key")
            m = connect_with_key(ne.address, ne.mgmt_port, ne.username, "/home/douomo/.ssh/netconf_key")
            #m = connect_with_credentials(ne.address, ne.mgmt_port, ne.username, ne.password)
            #m = connect_with_credentials(ne.address, ne.mgmt_port, ne.username, ne.password)
            BuiltIn().log_to_console(ne)
            BuiltIn().log_to_console("connected to device")
            xml = create_VLAN_xml(ne,vlan_id)
            xml = create_VLAN_xml(ne,vlan_id)
            target = "candidate"
            target = "candidate"
            m.edit_config(target=target, config=xml)
            m.edit_config(target=target, config=xml)
            m.commit()
            m.commit()
            m.close_session()
            m.close_session()
            BuiltIn().log_to_console("Configuration committed")
            BuiltIn().log_to_console("VLAN Committed")
        self.builtin.set_global_variable("${VLAN_ID}", vlan_id)
        self.builtin.set_global_variable("${VLAN_ID}", vlan_id)


    @keyword("the VLAN ${vlan_id} should be in the configuration")
    @keyword("the VLAN ${vlan_id} should be in the configuration")
Loading