コード例 #1
0
"""Test Ports Script"""
from lib.netconf.system_config import System_Config
from lib.netconf.config import get_config_arg

sysDict = {

    'name'		 : 'optical,polatis,switch',
    'password'		 : 'optical,polatis,switch',
    'group'		 : 'admin,view,user',
    #'interface_status'   : 'eth0,10.99.99.227,10.99.99.154,255.0.0.0,10.255.255.255,00:50:c2:2b:48:a3',
    #'interface'          : 'eth0,10.99.99.227,10.99.99.154,255.0.0.0,10.255.255.255',
    'interface_status'   : get_config_arg('system_config', 'interface_status'),
    'interface'          : get_config_arg('system_config', 'interface'),
    'mode_preserve'      : 'MODE_PRESERVE',
    'mode_volatile'      : 'MODE_VOLATILE'
    #'interface_status'   : 'eth0,host,10.99.99.154,255.0.0.0,10.255.255.255,00:50:c2:2b:48:a3'

}



class test_system_config_opr:


    @classmethod
    def setUpClass(cls):

        """conecting switch"""
        cls.sys_cfg = System_Config()
        cls.sys_cfg.connect_switch()
コード例 #2
0
""" Test Product Information """

from lib.netconf.product_information import Product_Information
from lib.netconf.config import get_config_arg
from lib.netconf.get_switch_ports_info_from_ports_range import get_valid_ingress_port, get_valid_egress_port

product_info_dict = {

    'manufacturer'      : get_config_arg('product_information', 'manufacturer'),
    'serial_number'     : get_config_arg('product_information', 'serial_number'),
    'model_name'        : get_config_arg('product_information', 'model_name'),
    'software_version'  : get_config_arg('product_information', 'software_version'),
    'ingress_port_ids'  : get_valid_ingress_port(),
    'egress_port_ids'   : get_valid_egress_port()

}


class test_product_information():

    @classmethod
    def setUpClass(cls):
        cls.Product_Information = Product_Information()
        """Usage: <hostIP> <netconf-port> <username> <password> <timeout>\n"""
        cls.Product_Information.connect_switch()

    def testGetManufacturer(self):

        """ testing get manufacturer """

        self.Product_Information.get_manufacturer(manufacturer = product_info_dict['manufacturer'], file_name = 'get_manufacturer.xml')
コード例 #3
0
"""Test oxc Script"""
from lib.netconf.crossconnects import CrossConnects
from lib.netconf.ports import Ports
from lib.netconf.config import get_config_arg
from lib.netconf.get_switch_ports_info_from_ports_range import get_valid_ingress_port


   
oxcDict = {

    'valid_ingress_ports'        : get_config_arg('cross_connects', 'valid_ingress_ports'),
    'valid_egress_ports'         : get_config_arg('cross_connects', 'valid_egress_ports'), 
    'invalid_ingress_ports'      : get_config_arg('cross_connects', 'invalid_ingress_ports'),
    'invalid_egress_ports'       : get_config_arg('cross_connects', 'invalid_egress_ports') 

    }



portsDict = {

    #'port_ids'        		 : get_config_arg('ports', 'port_ids'),
    #'port_label'                 : get_config_arg('ports', 'port_label'),
    #'port_state'        	 : get_config_arg('ports', 'port_state'),
    #'lambda'        		 : get_config_arg('ports', 'lambda'),
    #'power_high_alarm'       	 : get_config_arg('ports', 'power_high_alarm'),
    #'power_low_alarm'            : get_config_arg('ports', 'power_low_alarm'),
    #'power_high_warning_offset'  : get_config_arg('ports', 'power_high_warning_offset'),
    #'power_low_warning_offset'   : get_config_arg('ports', 'power_low_warning_offset'),
    #'power_alarm_control'        : get_config_arg('ports', 'power_alarm_control'),
    #'offset'        		 : get_config_arg('ports', 'offset'),