Example #1
0
def test_12():
    prRed("Test Description: Delete br400")
    assert vxlan_utils.delete_bridge_interface('br400') == True
    exec_shell('brctl show')
    exec_shell('ip link show e101-010-0.200')
    exec_shell('ip link show e101-011-0.200')
    exec_shell('ip link show e101-012-0.300')
    exec_shell('ip link show e101-013-0.300')
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