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
示例#2
0
def test_14():
    prRed("Test Description: Delete vtep600")
    assert vxlan_utils.delete_vtep('vtep600') == True
    exec_shell('ip link show dev vtep600')