def test_should_create_out_file(self): mitm.run_mitmdump(mitmcfg.outfile, 2) # call without a port number sleep(1) # give some to mitmdump self.assert_is_file( mitmcfg.dmpfile, "Output file %s is missing, cannot start mitmdump with default port" % mitmcfg.dmpfile)
def test_should_run_process_async(self): start = time() mitm.run_mitmdump(mitmcfg.outfile, 60) # call with a long timeout, 60sec time_passed = time() - start self.assertLess(time_passed, mitm.PORT_TRY_TIMEOUT + TIME_TOLERANCE, "mitmdump didn't return immediately %s " % time_passed)
def test_should_run_multiple_instances_together(self): for i in xrange(5): # run 50 mitmdump instances together i += 1 sleep(0.2) try: mitm.run_mitmdump(mitmcfg.outfile, 5) # call with a long timeout, 60sec except: self.fail("Cannot start %s mitmdump process in parallel" % i)
def test_should_return_port_pid(self): port, pid = mitm.run_mitmdump(mitmcfg.outfile, 2) # call with a port number self.assert_port_and_pid_is_ok( port, pid, "cannot start mitmdump with default port")
def test_should_run_process_async(self): start = time() mitm.run_mitmdump(mitmcfg.outfile, 60) # call with a long timeout, 60sec time_passed = time() - start self.assertLess(time_passed, mitm.PORT_TRY_TIMEOUT+TIME_TOLERANCE, "mitmdump didn't return immediately %s " % time_passed)
def test_should_create_out_file(self): mitm.run_mitmdump(mitmcfg.outfile, 2) # call without a port number sleep(1) # give some to mitmdump self.assert_is_file(mitmcfg.dmpfile, "Output file %s is missing, cannot start mitmdump with default port" % mitmcfg.dmpfile)
def test_should_return_port_pid(self): port, pid = mitm.run_mitmdump(mitmcfg.outfile, 2) # call with a port number self.assert_port_and_pid_is_ok(port, pid, "cannot start mitmdump with default port")