def __init__(self, straight=5, hstart=2, hend=4, inject=False): TestCase.__init__(self) self.straight = straight if isinstance(straight, int) else int(straight) self.hstart = hstart if isinstance(hstart, int) else int(hstart) self.hend = hend if isinstance(hend, int) else int(hend) self.inject = inject if isinstance( inject, bool) else ('true' == inject.lower()) self.topo = HijackTopo(straight, hstart, hend) self.net = Mininet(self.topo, controller=lambda name: RemoteController( name, ip='127.0.0.1', port=6653), switch=UserSwitch) self.h1 = self.net.get('h1') self.h2 = self.net.get('h2') self.popens = [] if str(self.net.switch).find('UserSwitch') != -1: self.path_retriever = PathRetriever(dpidbase=16) else: self.path_retriever = PathRetriever(dpidbase=10)
def __init__(self, name): TestCase.__init__(self, name)
def __init__(self, name): self.wasRun = None TestCase.__init__(self, name)
def __init__(self, url): TestCase.__init__(self, APP, PROG, RES) self.url = url