Esempio n. 1
0
 def config_vlan(self):
     """
     Create a PortChannel and configure vlan on it
     """
     # Create one port channel
     pc1 = PortChannel('444')
     # Enable above created vlans on the port channel
     pc1.set_access_vlan('vlan-111')
     return pc1
Esempio n. 2
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
Esempio n. 3
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
Esempio n. 4
0
 def create_pc(self):
     """
     creates port channel and interface objects attach interfaces
     to the portchannel
     """
     if1 = Interface('eth1/8')
     if2 = Interface('eth1/5')
     pc = PortChannel('444')
     pc.attach(if1)
     pc.attach(if2)
     return pc
Esempio n. 5
0
 def test_get_all_portchannels(self):
     session = self.login_to_switch()
     self.assertRaises(TypeError, PortChannel.get, None)
     portchannels = PortChannel.get(session)
     for pc in portchannels:
         self.assertTrue(isinstance(pc, PortChannel))
         pc_as_a_string = str(pc)
         self.assertTrue(isinstance(pc_as_a_string, str))
Esempio n. 6
0
 def test_get_all_portchannels(self):
     session = self.login_to_switch()
     self.assertRaises(TypeError, PortChannel.get, None)
     portchannels = PortChannel.get(session)
     for pc in portchannels:
         self.assertTrue(isinstance(pc, PortChannel))
         pc_as_a_string = str(pc)
         self.assertTrue(isinstance(pc_as_a_string, str))
Esempio n. 7
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
Esempio n. 8
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
Esempio n. 9
0
 def config_vlan(self):
     # Create one port channel
     pc1 = PortChannel('444')
     # Enable above created vlans on the port channel
     pc1.set_access_vlan('vlan-111')
     return pc1