当前位置: 首页>>代码示例>>Python>>正文


Python util.ensureRoot函数代码示例

本文整理汇总了Python中mininet.util.ensureRoot函数的典型用法代码示例。如果您正苦于以下问题:Python ensureRoot函数的具体用法?Python ensureRoot怎么用?Python ensureRoot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ensureRoot函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: init

 def init(cls):
     "Initialize Mininet"
     if cls.inited:
         return
     ensureRoot()
     fixLimits()
     cls.inited = True
开发者ID:ruifcardoso,项目名称:mininet,代码行数:7,代码来源:net.py

示例2: runTests

def runTests( testDir, verbosity=1 ):
    "discover and run all tests in testDir"
    # ensure root and cleanup before starting tests
    ensureRoot()
    cleanup()
    # discover all tests in testDir
    testSuite = unittest.defaultTestLoader.discover( testDir )
    # run tests
    MininetTestRunner( verbosity=verbosity ).run( testSuite )
开发者ID:1514louluo,项目名称:mininet,代码行数:9,代码来源:runner.py

示例3: runTests

def runTests( testDir, verbosity=1 ):
    "discover and run all tests in testDir"
    # ensure root and cleanup before starting tests
    ensureRoot()
    cleanup()
    # discover all tests in testDir
    testSuite = unittest.defaultTestLoader.discover( testDir )
    # run tests
    success = MininetTestRunner( verbosity=verbosity ).run( testSuite ).wasSuccessful()
    sys.exit( 0 if success else 1 )
开发者ID:MatheusRagoso,项目名称:mininet,代码行数:10,代码来源:runner.py

示例4: runTests

def runTests(testDir, verbosity=1, dockeronly=False):
    "discover and run all tests in testDir"
    # ensure root and cleanup before starting tests
    ensureRoot()
    cleanup()
    # discover all tests in testDir
    testSuite = defaultTestLoader.discover(testDir)
    if dockeronly:
        testSuiteFiltered = [s for s in testSuite if "Docker" in str(s)]
        testSuite = TestSuite()
        testSuite.addTests(testSuiteFiltered)

    # run tests
    TextTestRunner(verbosity=verbosity).run(testSuite)
开发者ID:Shrq,项目名称:dockernet,代码行数:14,代码来源:runner.py

示例5: ensureRoot

from mininet.net import Mininet
from mininet.node import Host
from mininet.link import Link
from mininet.cli import CLI
from mininet.util import dumpNodeConnections
from mininet.util import ensureRoot

from subprocess import Popen, PIPE
from time import sleep, time

import sys
import os
import math
import requests

ensureRoot()

class ProtoTester(Topo):
    def __init__(self):

        # Initialise topology
        Topo.__init__(self)

        # Add hosts and switches
        sender = self.addHost('sender', ip='10.0.1.1', mac='00:00:00:00:00:01')
        LTE = self.addHost('LTE', ip='0.0.0.0')
        receiver = self.addHost('receiver', ip='10.0.1.2', mac='00:00:00:00:00:02')

        s1 = self.addSwitch('s1')
        s2 = self.addSwitch('s2')
开发者ID:ravinet,项目名称:app-prioritization,代码行数:30,代码来源:myrun-trial.py


注:本文中的mininet.util.ensureRoot函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。