![]() ![]() Consider using the PYSYS_PORTS=minport-maxport environment variable to explicitly configure the range of non-ephemeral/server ports for PySys to use.', platform. warning ( 'PySys cannot determine the local/ephemeral port range on this OS ( %s ) as " %s " is missing falling back to default IANA range %d - %d. # We pick the IANA range as our default ephemeral_low, ephemeral_high = 49152, 65535 _log. exists ( port_file ): # There's no perfect default that works for all OSes (and the config may be customized by the OS anyway), # but it's useful to avoid an error to help on environments like Windows Subsystem for Linux v1. """ # Find the smallest and largest ephemeral port if PLATFORM = 'linux' : port_file = '/proc/sys/net/ipv4/ip_local_port_range' if not os. :raises Exception: If the ephemeral port range cannot be determined, which will prevent PySys from running any tests. :return: A tuple (ephemeral_min: int, ephemeral_max: int) giving the ephemeral port range for this platform. If the available server ports are overridden using the ``PYSYS_PORTS`` or ``PYSYS_PORTS_FILE`` environment variables, this function is not called. This function is used by `getServerTCPPorts()` to ensure that no ephemeral/client-side ports are allocated for server-side purposes by PySys (this could cause random port clashes). def getEphemeralTCPPortRange (): """Returns the minimum and maximum TCP ports this operating system uses to allocate ephemeral/dynamic ports (the client side of the TCP connection). ![]() If desired you can modify this set from a custom `` module (before the ``BaseRunner`` constructor is executed). By default this contains blocked ports that some web browsers do not permit connections to for security reasons, which would therefore cause browser-driven tests to fail. getLogger ( 'pysys.allocport' ) excludedTCPPorts = """ A set containing TCP server ports which will never be allocated by `` (or `TCPPortOwner`). Initialized to None since it might not actually be used. """ import collections, random, subprocess, sys import io import logging import time import platform from pysys import process_lock from nstants import * from import openfile # LRU queue of server TCP ports for allocation to tests which need to # start TCP servers. This is used by `` which should usually be used to access this functionality. # You should have received a copy of the GNU Lesser General Public # License along with this library if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA """ Dynamic TCP port allocation. See the GNU # Lesser General Public License for more details. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ![]() Grieve # This library is free software you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation either # version 2.1 of the License, or (at your option) any later version. #!/usr/bin/env python # PySys System Test Framework, Copyright (C) 2006-2022 M.B.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |