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)
def tearDown(): cleanup() # make sure that all pending docker containers are killed with open(os.devnull, 'w') as devnull: subprocess.call( "docker rm -f $(docker ps --filter 'label=com.containernet' -a -q)", stdout=devnull, stderr=devnull, shell=True)
def tearDown(self): "Clean up if necessary" # satisfy pylint assert self if sys.exc_info != (None, None, None): cleanup()
def tearDown(self): # kill the ssh process sh("ps aux | grep 'ssh.*Banner' | awk '{ print $2 }' | xargs kill") cleanup() # remove public key pair sh('rm -rf /tmp/ssh')
def tearDown(): "Clean up if necessary" if sys.exc_info != ( None, None, None ): cleanup()
def addError(self, test, err): super(MininetTestResult, self).addError(test, err) cleanup()
def addFailure(self, test, err): super(MininetTestResult, self).addFailure(test, err) cleanup()