""" 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')
Ejemplo n.º 2
0
"""Test oxc Script"""
from lib.netconf.crossconnects import CrossConnects
from lib.netconf.config import get_config_arg
from lib.netconf.get_switch_ports_info_from_ports_range import get_valid_ingress_port
from lib.netconf.get_switch_ports_info_from_ports_range import get_valid_egress_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') 
    'valid_ingress_ports'        : get_valid_ingress_port(),
    'valid_egress_ports'         : get_valid_egress_port(),
    'invalid_ingress_ports'      : '100,101,102',
    'invalid_egress_ports'       : '200,201,202'

    }


class test_oxc_opr: 

    @classmethod
    def setUpClass(cls):
        cls.oxc = CrossConnects()
        """Usage: <hostIP> <netconf-port> <username> <password> <timeout>\n"""
        cls.oxc.connect_switch()
        cls.oxc.get_existing_port_list()
        cls.oxc.cleanup_existing_connections(file_name = 'cleanup.xml')
        cls.oxc.edit_config_create_oxc_without_opr(ingress_ports = oxcDict['valid_ingress_ports'], egress_ports = oxcDict['valid_egress_ports'])