Package pysys :: Package utils :: Module allocport
[frames] | no frames]

Module allocport

source code

Classes
  TCPPortOwner
Functions
 
getEphemeralTCPPortRange()
Returns the range of TCP ports the operating system uses to allocate ephemeral ports from i.e.
source code
 
initializePortPool()
Initialize the pool of ports we can allocate TCP server ports from i.e.
source code
 
portIsInUse(port) source code
 
allocateTCPPort() source code
Variables
  tcpServerPortPool = deque([13820, 41087, 34860, 34226, 15883, ...
  BACKGROUND = 10
  BLOCKED = 26
  DEFAULT_DESCRIPTOR = ['pysystest.xml', '.pysystest', 'descript...
  DEFAULT_FORMAT_RUNLOG = '%(asctime)s %(levelname)-5s %(message)s'
  DEFAULT_FORMAT_STDOUT = '%(asctime)s %(levelname)-5s %(message)s'
  DEFAULT_GROUP = ''
  DEFAULT_INPUT = 'Input'
  DEFAULT_MAKER = ['ConsoleMakeTestHelper', 'pysys.launcher.cons...
  DEFAULT_MODULE = 'run'
  DEFAULT_OUTPUT = 'Output'
  DEFAULT_PROJECTFILE = ['pysysproject.xml', '.pysysproject']
  DEFAULT_REFERENCE = 'Reference'
  DEFAULT_RUNNER = ['BaseRunner', 'pysys.baserunner']
  DEFAULT_STYLESHEET = '/System/Library/Frameworks/Python.framew...
  DEFAULT_TESTCLASS = 'PySysTest'
  DEFAULT_TIMEOUT = 600
  DEFAULT_WRITER = ['XMLResultsWriter', 'pysys.writer', 'testsum...
  DEVNULL = '/dev/null'
  DUMPEDCORE = 25
  DYLD_LIBRARY_PATH = '/usr/lib:/usr/local/lib'
  ENVSEPERATOR = ':'
  FAILED = 23
  FAILS = [26, 25, 24, 23]
  FALSE = False
  FOREGROUND = 11
  HOSTNAME = '10070'
  INSPECT = 21
  LD_LIBRARY_PATH = ''
  LOOKUP = {False: 'FALSE', True: 'TRUE', 20: 'PASSED', 21: 'REQ...
  NOTVERIFIED = 22
  OSFAMILY = 'unix'
  OSWALK_IGNORES = ['Input', 'Output', 'Reference', 'CVS', '.svn']
  PASSED = 20
  PATH = '/bin:/usr/bin:/usr/sbin:/usr/local/bin'
  PLATFORM = 'darwin'
  PRECEDENT = [27, 26, 25, 24, 23, 22, 21, 20]
  PROJECT = None
  SITE_PACKAGES_DIR = '/System/Library/Frameworks/Python.framewo...
  SKIPPED = 27
  TIMEDOUT = 24
  TIMEOUTS = {'ManualTester': 1800, 'WaitForFile': 30, 'WaitForP...
  TRUE = True
  __package__ = 'pysys.utils'
  log = logging.getLogger('pysys')
  stdoutHandler = ThreadedStreamHandler(sys.stdout)
Function Details

getEphemeralTCPPortRange()

source code 

Returns the range of TCP ports the operating system uses to allocate ephemeral ports from i.e. the ports allocated for the client side of a client-server connection. Returned as a tuple, (ephemeral_low, ephemeral_high) or raises exception on error.

initializePortPool()

source code 

Initialize the pool of ports we can allocate TCP server ports from i.e. ports to which processes can bind to without clashes with other processes


Variables Details

tcpServerPortPool

Value:
deque([13820, 41087, 34860, 34226, 15883, 48984, 26798, 39907, 46394, \
14228, 24629, 19971, 27242, 19661, 44271, 7175, 20845, 15008, 29808, 3\
0333, 33779, 18849, 45513, 18449, 44809, 44855, 12374, 1993, 24788, 39\
297, 22667, 33078, 14382, 24645, 31746, 43543, 22262, 42222, 3093, 312\
60, 31334, 44125, 11453, 44699, 12946, 48805, 23970, 41955, 16591, 310\
79, 26690, 10204, 29182, 22224, 15360, 19311, 49080, 13066, 6122, 6608\
, 10457, 9552, 46172, 41690, 46264, 34862, 22697, 30483, 43591, 20960,\
 8852, 36047, 2249, 15161, 8394, 41973, 42260, 5337, 11054, 44238, 137\
...

DEFAULT_DESCRIPTOR

Value:
['pysystest.xml', '.pysystest', 'descriptor.xml']

DEFAULT_MAKER

Value:
['ConsoleMakeTestHelper', 'pysys.launcher.console']

DEFAULT_STYLESHEET

Value:
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.\
7/site-packages/pysys-log.xsl'

DEFAULT_WRITER

Value:
['XMLResultsWriter',
 'pysys.writer',
 'testsummary_%Y%m%d%H%M%S.xml',
 {}]

LOOKUP

Value:
{False: 'FALSE',
 True: 'TRUE',
 20: 'PASSED',
 21: 'REQUIRES INSPECTION',
 22: 'NOT VERIFIED',
 23: 'FAILED',
 24: 'TIMED OUT',
 25: 'DUMPED CORE',
...

SITE_PACKAGES_DIR

Value:
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.\
7/site-packages'

TIMEOUTS

Value:
{'ManualTester': 1800,
 'WaitForFile': 30,
 'WaitForProcessStop': 10,
 'WaitForSignal': 60,
 'WaitForSocket': 60}