Commit 4599cd8e authored by douomo's avatar douomo
Browse files

fixed alarm xml, added ref to the key

parent 52b55603
Loading
Loading
Loading
Loading
+15 −8
Original line number Original line Diff line number Diff line
@@ -12,19 +12,22 @@ Test_2
    Mute ODU and Query Alarms    ${vendor_1}    ${vendor_2}
    Mute ODU and Query Alarms    ${vendor_1}    ${vendor_2}


Test_3
Test_3
    Mute ODU and Receive SNR Alarms    ${vendor_1}    ${vendor_2}
    Mute ODU and Receive RSL Alarms    ${vendor_1}    ${vendor_2}


Test_4
Test_4
    Mute ODU and Receive RSL Alarms    ${vendor_1}    ${vendor_2}
    Mute ODU Receive RSL Alarms and Unmute    ${vendor_1}    ${vendor_2}
    
    
*** Keywords ***
*** Keywords ***
Query Alarms
Query Alarms
    [Arguments]    ${par}
    [Arguments]    ${par}
    ${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"]}
    ${alarms}=    Get Filtered Config    ${m}    filters/alarms.xml
    ${alarms_list}=    Get Filtered Config    ${m}    filters/alarms-list.xml
    Log    ${alarms}    console=yes
    Log    ${alarms_list}    console=yes
    Should Not Be Empty    ${alarms}
    Should Not Be Empty    ${alarms_list}
    ${alarms_inventory}=    Get Filtered Config    ${m}    filters/alarms-inventory.xml
    Log    ${alarms_inventory}    console=yes
    Should Not Be Empty    ${alarms_inventory}
    Close Current Session    ${m}
    Close Current Session    ${m}


Mute ODU and Query Alarms    
Mute ODU and Query Alarms    
@@ -33,15 +36,19 @@ 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"]}
    Set RSL Threshold    ${m}    ${par["testInterface"]}    20
    ${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}    ${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-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"
    Should Be Equal    ${SNR}    0
    Should Be Equal    ${SNR}    0
    Close Current Session    ${m}
    Close Current Session    ${m}
    Close Current Session    ${t}
    Close Current Session    ${t}


Mute ODU and Receive SNR Alarms
Mute ODU and Receive RSL Alarms
    [Arguments]    ${par}    ${transimitter}
    [Arguments]    ${par}    ${transimitter}
    ${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"]}
@@ -57,7 +64,7 @@ Mute ODU and Receive SNR Alarms
    Close Current Session    ${m}
    Close Current Session    ${m}
    Close Current Session    ${t}
    Close Current Session    ${t}


Mute ODU and Receive RSL Alarms
Mute ODU Receive RSL Alarms and Unmute
    [Arguments]    ${par}    ${transimitter}
    [Arguments]    ${par}    ${transimitter}
    ${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"]}
+6 −5
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ class NetworkElement(NamedTuple):
    port_1: int
    port_1: int
    port_2: int
    port_2: int
    mgmt_port: int
    mgmt_port: int
    key_filename: str




@library(scope="TEST")
@library(scope="TEST")
@@ -50,7 +51,7 @@ class NetconfLibrary:
        ``vlan_id`` is pushed in all NEs.
        ``vlan_id`` is pushed in all NEs.
        """
        """
        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, ne.key_filename)
            #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("connected to device")
            BuiltIn().log_to_console("connected to device")
            xml = create_VLAN_xml(ne,vlan_id)
            xml = create_VLAN_xml(ne,vlan_id)
@@ -68,7 +69,7 @@ class NetconfLibrary:
        Fails if the VLAN is missing in any of the NEs.
        Fails if the VLAN is missing in any of the NEs.
        """
        """
        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, ne.key_filename)
            #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)
            config = m.get_config(source='running').data_xml
            config = m.get_config(source='running').data_xml
            m.close_session()
            m.close_session()
@@ -84,7 +85,7 @@ class NetconfLibrary:
        ``vlan_id`` is deleted in all NEs.
        ``vlan_id`` is deleted in all NEs.
        """
        """
        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, ne.key_filename)
            #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)
            xml = delete_VLAN_xml(ne, vlan_id)
            xml = delete_VLAN_xml(ne, vlan_id)
            m.edit_config(target="candidate", config=xml)
            m.edit_config(target="candidate", config=xml)
@@ -95,7 +96,7 @@ class NetconfLibrary:
    @keyword("the VLAN ${vlan_id} should not be in the configuration")
    @keyword("the VLAN ${vlan_id} should not be in the configuration")
    def the_vlan_xxx_should_not_be_in_the_configuration(self, vlan_id: int) -> None:
    def the_vlan_xxx_should_not_be_in_the_configuration(self, vlan_id: int) -> None:
        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, ne.key_filename)
            #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)
            config = m.get_config(source='running').data_xml
            config = m.get_config(source='running').data_xml
            assert bool(not(vlan_exists(config, vlan_id)))
            assert bool(not(vlan_exists(config, vlan_id)))
@@ -110,7 +111,7 @@ class NetconfLibrary:
        """
        """
        for vlan_id in range(start, stop, step):
        for vlan_id in range(start, stop, step):
            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, ne.key_filename)
                #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)
                xml = create_VLAN_xml(ne,vlan_id)
                xml = create_VLAN_xml(ne,vlan_id)
                m.edit_config(target="candidate", config=xml)
                m.edit_config(target="candidate", config=xml)
+5 −0
Original line number Original line Diff line number Diff line
<filter>
  <alarms xmlns="urn:ietf:params:xml:ns:yang:ietf-alarms">
    <alarm-inventory/>
  </alarms>
</filter>
 No newline at end of file
+0 −0

File moved.

+1 −1
Original line number Original line Diff line number Diff line
name,address,username,password,bridgeName,componentName,port_1,port_2,mgmt_port
name,address,username,password,bridgeName,componentName,port_1,port_2,mgmt_port,key_filename
ne1,192.168.13.134,domenico,domenico,Bridge-1,Component-1,1,2,830
ne1,192.168.13.134,domenico,domenico,Bridge-1,Component-1,1,2,830