예제 #1
0
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)
예제 #2
0
 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)
예제 #3
0
 def tearDown(self):
     "Clean up if necessary"
     # satisfy pylint
     assert self
     if sys.exc_info != (None, None, None):
         cleanup()
예제 #4
0
 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')
예제 #5
0
 def tearDown():
     "Clean up if necessary"
     if sys.exc_info != ( None, None, None ):
         cleanup()
예제 #6
0
 def addError(self, test, err):
     super(MininetTestResult, self).addError(test, err)
     cleanup()
예제 #7
0
 def addFailure(self, test, err):
     super(MininetTestResult, self).addFailure(test, err)
     cleanup()