Example #1
0
 def create_pc(self):
     """
     Create a basic PortChannel used as setup for test cases
     """
     if1 = Interface('eth1/8')
     if2 = Interface('eth1/5')
     pc = PortChannel('444')
     pc.attach(if1)
     pc.attach(if2)
     return pc
Example #2
0
    def create_ipv6(self):
        int1 = Interface('eth1/1')
        int2 = Interface('eth1/2')
        pc1 = PortChannel('211')
        ipv6 = IPV6()
        ipv6.add_interface_address(int1,
                                   '2004:0DB8::1/10',
                                   link_local='FE83::1')
        ipv6.add_interface_address(int2, '2104:0DB8::1/11')
        ipv6.add_interface_address(int2, '2002:0DB8::1/12')
        ipv6.add_interface_address(pc1, '2022:0DB8::1/13')

        return ipv6
Example #3
0
 def create_lacp(self):
     """
     Create a Lacp used as setup for test cases
     """
     int = Interface('eth1/1')
     lacp = Lacp(rate='fast', interface=int)
     return lacp
Example #4
0
 def create_interface_mulitple(self):
     config = ConfigInterfaces()
     int1 = Interface('eth1/5')
     int2 = Interface('eth1/8')
     int1.set_layer('Layer2')
     int2.set_layer('Layer3')
     # Adding interfaces to be configured
     config.add_interface(int1)
     config.add_interface(int2)
     return config
Example #5
0
 def create_ipv6_route(self):
     # Create Interfaces
     int1 = Interface('eth1/1')
     int2 = Interface('eth1/2')
     # Create a L3 port channel
     pc1 = PortChannel('211', layer='Layer3')
     route = IPV6Route('2000:0::0/12')
     route.add_next_hop('234E:44::1',
                        int1,
                        vrf='default',
                        track_id='0',
                        tag='1')
     route.add_next_hop('234E:44::2', int2)
     route.add_next_hop('234E:44::4',
                        pc1,
                        vrf='default',
                        track_id='1',
                        tag='2')
     return route
Example #6
0
    def create_vrrps(self):
        """
        Create a VRRP used as setup for test cases
        """
        vrrp = ConfigVrrps()
        int = Interface('eth2/1')
        vrrp_int = Vrrp(int)
        vrrp_id = VrrpID('50')
        vrrp_id.set_primary('10.10.0.11')
        vrrp_id.set_secondary('10.10.0.12')

        vrrp_int.add_vrrp_id(vrrp_id)
        vrrp.add_vrrp(vrrp_int)
        return vrrp
Example #7
0
 def create_interface_mulitple(self):
     config  = ConfigInterfaces()
     int1 = Interface('eth1/5')
     int2 = Interface('eth1/8')
     int1.set_layer('Layer2')
     int2.set_layer('Layer3')
     # Adding interfaces to be configured
     config.add_interface(int1)
     config.add_interface(int2)
     return config
Example #8
0
 def test_config_interface(self):
     session = self.login_to_switch()
     self.assertRaises(TypeError, Interface.get, None)
     i_face = Interface('eth1/5')
     self.assertTrue(isinstance(i_face, Interface))
Example #9
0
 def create_interfcae(self):
     int1 = Interface('eth1/5')
     int1.set_admin_status('up')
     int1.set_layer('Layer2')
     int1.set_duplex('auto')
     int1.set_link_log('default')
     int1.set_mode('trunk')
     int1.set_speed('10G')
     int1.set_access_vlan('vlan-1')
     int1.set_trunk_log('default')
     int1.set_link_log('default')
     return int1
Example #10
0
 def create_interfcae(self):
     int1 = Interface('eth1/5')
     int1.set_admin_status('up')
     int1.set_layer('Layer2')
     int1.set_duplex('auto')
     int1.set_link_log('default')
     int1.set_mode('trunk')
     int1.set_speed('10G')
     int1.set_access_vlan('vlan-1')
     int1.set_trunk_log('default')
     int1.set_link_log('default')
     return int1
Example #11
0
 def create_interfcae(self):
     """
     Create Interface object and configure the its parameters
     """
     int1 = Interface('eth1/5')
     int1.set_admin_status('up')
     int1.set_layer('Layer2')
     int1.set_duplex('auto')
     int1.set_link_log('default')
     int1.set_mode('trunk')
     int1.set_speed('10G')
     int1.set_access_vlan('vlan-1')
     int1.set_trunk_log('default')
     int1.set_link_log('default')
     return int1