示例#1
0
文件: net.py 项目: yaobinwen/mininet
 def init(cls):
     "Initialize Mininet"
     if cls.inited:
         return
     ensureRoot()
     fixLimits()
     cls.inited = True
示例#2
0
 def init(cls):
     "Initialize Mininet"
     if cls.inited:
         return
     ensureRoot()
     fixLimits()
     cls.inited = True
示例#3
0
文件: net.py 项目: gyj/cs143
def init():
    "Initialize Mininet."
    if init.inited:
        return
    if os.getuid() != 0:
        # Note: this script must be run as root
        # Perhaps we should do so automatically!
        print "*** Mininet must run as root."
        exit( 1 )
    # If which produces no output, then mnexec is not in the path.
    # May want to loosen this to handle mnexec in the current dir.
    if not quietRun( 'which mnexec' ):
        raise Exception( "Could not find mnexec - check $PATH" )
    fixLimits()
    init.inited = True
示例#4
0
    parser.add_argument('--switch',
                        choices = switches.keys(),
                        default = 'default',
                        help = "Specify switch to use (see mininet doc)")

    # import sys
    #
    # print  sys.argv

    args = parser.parse_args()

    #increase file descriptor limits
    from mininet.util import fixLimits

    fixLimits()

    if args.quiet >= 1:
        lg.setLogLevel('output')
    else:
        lg.setLogLevel('info')

    # topoFile = os.path.join(DIR, "data", args.tfile + ".json")
    topoFile = args.tfile
    if args.start_time is not None:
        EventsManager.start_time = int(args.start_time)
    # monitorUsage = args.monitorUsage
    import vars

    vars.watcher_log = args.watcher_log
    vars.testBinPath = args.bin_dir
示例#5
0
    parser.add_argument('--switch',
                        choices=switches.keys(),
                        default='default',
                        help="Specify switch to use (see mininet doc)")

    # import sys
    #
    # print  sys.argv

    args = parser.parse_args()

    #increase file descriptor limits
    from mininet.util import fixLimits

    fixLimits()

    if args.quiet >= 1:
        lg.setLogLevel('output')
    else:
        lg.setLogLevel('info')

    # topoFile = os.path.join(DIR, "data", args.tfile + ".json")
    topoFile = args.tfile
    if args.start_time is not None:
        EventsManager.start_time = int(args.start_time)
    # monitorUsage = args.monitorUsage
    import vars

    vars.watcher_log = args.watcher_log
    vars.testBinPath = args.bin_dir
示例#6
0
 def init(cls):
     "Initialize Mininet"
     if cls.inited:
         return
     fixLimits()
     cls.inited = True