Пример #1
0
def test_7():
    #PRE-TEST Prep
    exec_shell('ip link delete dev e101-012-0.300')
    exec_shell('ip link delete dev e101-013-0.300')
    #Add Tagged access ports e101-012-0.300, e101-013-0.300 to Bridge br400
    prRed("Test Description: Add Tagged ports to bridge br400: e101-012-0.300, e101-013-0.300")
    vxlan_utils.create_vlan_subintf('e101-012-0', 300)
    vxlan_utils.create_vlan_subintf('e101-013-0', 300)
    tap1 = 'e101-012-0.300'
    tap2 = 'e101-013-0.300'
    tagged_access_ports = [tap1, tap2]
    assert vxlan_utils.add_tagged_access_ports_to_bridge_interface('br400', tagged_access_ports) == True
    exec_shell('brctl show')
Пример #2
0
def test_6():
    #PRE-TEST Prep
    exec_shell('ip link delete dev e101-010-0.200')
    exec_shell('ip link delete dev e101-011-0.200')
    #Create a Bridge br400 with tagged access ports(e101-010-0.200, e101-011-0.200) and tunnel endpoints(vtep500, vtep600)
    prRed("Test Description: Create bridge:br400; Tagged ports: e101-010-0.200, e101-011-0.200; VTEPs: vtep500, vtep600")
    vxlan_utils.create_vlan_subintf('e101-010-0', 200)
    vxlan_utils.create_vlan_subintf('e101-011-0', 200)
    tap1 = 'e101-010-0.200'
    tap2 = 'e101-011-0.200'
    tagged_access_ports = [tap1, tap2]
    member_interfaces = [] + tagged_access_ports + ['vtep500', 'vtep600']
    assert vxlan_utils.create_bridge_interface('br400', member_interfaces) == True
    exec_shell('brctl show')
def _parse_args(args):
    if args.command == 'create':
        if args.subcommand == 'bridge':
            return vxlan_utils.create_bridge_interface(args.name, [])
        elif args.subcommand == 'vtep':
            return vxlan_utils.create_vtep(args.name, args.vni, args.ip,
                                           args.family)
        elif args.subcommand == 'vlanSubIntf':
            return vxlan_utils.create_vlan_subintf(args.parent, args.vlan_id)
        return

    elif args.command == 'delete':
        if args.subcommand == 'bridge':
            return vxlan_utils.delete_bridge_interface(args.name)
        elif args.subcommand == 'vtep':
            return vxlan_utils.delete_vtep(args.name)
        elif args.subcommand == 'vlanSubIntf':
            return vxlan_utils.delete_vlan_subintf(args.parent, args.vlan_id)
        return

    elif args.command == 'add':
        if args.subcommand == 'tagged':
            return vxlan_utils.add_tagged_access_ports_to_bridge_interface(
                args.bridge_name, [args.tagged_member_name])
        elif args.subcommand == 'untagged':
            return vxlan_utils.add_untagged_access_ports_to_bridge_interface(
                args.bridge_name, [args.untagged_member_name])
        elif args.subcommand == 'vtep':
            return vxlan_utils.add_vteps_to_bridge_interface(
                args.bridge_name, [args.vtep_name])
        elif args.subcommand == 'remote-endpoint':
            re = vxlan_utils.RemoteEndpoint(args.ip, args.family,
                                            args.flooding_enabled)
            return vxlan_utils.add_remote_endpoint(args.vtep_name, [re])
        return

    elif args.command == 'remove':
        if args.subcommand == 'tagged':
            return vxlan_utils.remove_tagged_access_ports_to_bridge_interface(
                args.bridge_name, [args.tagged_member_name])
        elif args.subcommand == 'untagged':
            return vxlan_utils.remove_untagged_access_ports_to_bridge_interface(
                args.bridge_name, [args.untagged_member_name])
        elif args.subcommand == 'vtep':
            return vxlan_utils.remove_vteps_from_bridge_interface(
                args.bridge_name, [args.vtep_name])
        elif args.subcommand == 'remote-endpoint':
            re = vxlan_utils.RemoteEndpoint(args.ip, args.family,
                                            args.flooding_enabled)
            return vxlan_utils.remove_remote_endpoint(args.vtep_name, [re])
        return