code: install_deps> python -I -m pip install coverage pytest pytest-cov six .pkg: install_requires> python -I -m pip install 'setuptools>=40.8.0' wheel .pkg: _optional_hooks> python /tmp/venv-HMen/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: get_requires_for_build_sdist> python /tmp/venv-HMen/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: get_requires_for_build_wheel> python /tmp/venv-HMen/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: install_requires_for_build_wheel> python -I -m pip install wheel .pkg: freeze> python -m pip freeze --all .pkg: pip==23.3.1,setuptools==69.0.2,wheel==0.42.0 .pkg: prepare_metadata_for_build_wheel> python /tmp/venv-HMen/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ .pkg: build_sdist> python /tmp/venv-HMen/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ code: install_package_deps> python -I -m pip install inotify inotify-simple mdclogpy msgpack 'protobuf<3.21.0' requests 'ricsdl<4.0.0,>=3.0.0' code: install_package> python -I -m pip install --force-reinstall --no-deps /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.tox/.tmp/package/1/ricxappframe-3.2.2.tar.gz code: freeze> python -m pip freeze --all code: async-timeout==4.0.3,certifi==2023.11.17,charset-normalizer==3.3.2,coverage==7.3.4,exceptiongroup==1.2.0,hiredis==2.0.0,idna==3.6,iniconfig==2.0.0,inotify==0.2.10,inotify-simple==1.3.5,mdclogpy==1.1.4,msgpack==1.0.7,nose==1.3.7,packaging==23.2,pip==23.3.1,pluggy==1.3.0,protobuf==3.20.3,pytest==7.4.3,pytest-cov==4.1.0,redis==4.3.6,requests==2.31.0,ricsdl==3.1.3,ricxappframe @ file:///w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.tox/.tmp/package/1/ricxappframe-3.2.2.tar.gz#sha256=08ae96fe41ad8ff490a167bd33abe06baae1d28d33f0e9062c32034694303b13,setuptools==69.0.2,six==1.16.0,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0 code: commands[0]> pytest --cov ricxappframe --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 --junitxml=/tmp/tests.xml ============================= test session starts ============================== platform linux -- Python 3.10.6, pytest-7.4.3, pluggy-1.3.0 cachedir: .tox/code/.pytest_cache rootdir: /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master plugins: cov-4.1.0 collected 75 items tests/test_Logger.py .............. [ 18%] tests/test_alarm.py .. [ 21%] tests/test_config.py FFF [ 25%] tests/test_e2ap.py ........ [ 36%] tests/test_init.py .FF [ 40%] tests/test_metric.py .. [ 42%] tests/test_rest.py . [ 44%] tests/test_rmr.py ............. [ 61%] tests/test_rmr_mocks.py ... [ 65%] tests/test_rmrclib.py .. [ 68%] tests/test_sdl.py ..... [ 74%] tests/test_subscribe.py .... [ 80%] tests/test_symptomdata.py .... [ 85%] tests/test_xapps.py FFFFFFFFFFF [100%] =================================== FAILURES =================================== ______________________________ test_config_no_env ______________________________ monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f3a2b115900> def test_config_no_env(monkeypatch): init_config_file() monkeypatch.delenv(Constants.CONFIG_FILE_ENV, raising=False) def default_rmr_handler(self, summary, sbuf): pass config_event_seen = False def config_handler(self, json): nonlocal config_event_seen config_event_seen = True global rmr_xapp_noconfig > rmr_xapp_noconfig = RMRXapp(default_rmr_handler, config_handler=config_handler, rmr_port=4652, use_fake_sdl=True) tests/test_config.py:58: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:811: in __init__ super().__init__( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4652, rmr_wait_for_ready = True, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError _________________________ test_default_config_handler __________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f3a2b0eb280> def test_default_config_handler(monkeypatch): """Just for coverage""" init_config_file() monkeypatch.setenv(Constants.CONFIG_FILE_ENV, config_file_path) def default_rmr_handler(self, summary, sbuf): pass # listen port is irrelevant, no messages arrive global rmr_xapp_defconfig rmr_xapp_defconfig = RMRXapp(default_rmr_handler, rmr_port=4567, use_fake_sdl=True) # in unit tests we need to thread here or else execution is not returned! rmr_xapp_defconfig.run(thread=True, rmr_timeout=1) write_config_file() # give the work loop a chance to timeout on RMR and process the config event time.sleep(3) > rmr_xapp_defconfig.stop() tests/test_config.py:86: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:926: in stop super().stop() ricxappframe/xapp_frame.py:755: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:230: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:220: in deregister resp = self.session.post(dereg_url, request_string) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stderr call ----------------------------- 1703722897436 28088/RMR [INFO] sends: ts=1703722897 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722897436 28088/RMR [INFO] sends: ts=1703722897 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722897436 28088/RMR [INFO] sends: ts=1703722897 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722897436 28088/RMR [INFO] sends: ts=1703722897 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722897511 28088/RMR [INFO] sends: ts=1703722897 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722897512 28088/RMR [INFO] sends: ts=1703722897 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722897512 28088/RMR [INFO] sends: ts=1703722897 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722897512 28088/RMR [INFO] sends: ts=1703722897 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722928439 28088/RMR [INFO] sends: ts=1703722928 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722928439 28088/RMR [INFO] sends: ts=1703722928 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722928439 28088/RMR [INFO] sends: ts=1703722928 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722928439 28088/RMR [INFO] sends: ts=1703722928 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722928515 28088/RMR [INFO] sends: ts=1703722928 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722928515 28088/RMR [INFO] sends: ts=1703722928 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722928515 28088/RMR [INFO] sends: ts=1703722928 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722928515 28088/RMR [INFO] sends: ts=1703722928 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister __________________________ test_custom_config_handler __________________________ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: > sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) .tox/code/lib/python3.10/site-packages/urllib3/connection.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/util/connection.py:60: in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ host = 'service-ricplt-appmgr-http.ricplt', port = 8080 family = , type = proto = 0, flags = 0 def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): """Resolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. """ # We override this function since we want to translate the numeric family # and socket type values to enum constants. addrlist = [] > for res in _socket.getaddrinfo(host, port, family, type, proto, flags): E OSError: [Errno 16] Device or resource busy /opt/pyenv/versions/3.10.6/lib/python3.10/socket.py:955: OSError The above exception was the direct cause of the following exception: self = method = 'POST', url = '/ric/v1/deregister', body = '' headers = {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded'} retries = Retry(total=0, connect=None, read=None, redirect=None, status=None) redirect = False, assert_same_host = False timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None release_conn = False, chunked = True, body_pos = None, preload_content = False decode_content = False, response_kw = {} parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/ric/v1/deregister', query=None, fragment=None) destination_scheme = None, conn = None, release_this_conn = True http_tunnel_required = False, err = None, clean_exit = False def urlopen( # type: ignore[override] self, method: str, url: str, body: _TYPE_BODY | None = None, headers: typing.Mapping[str, str] | None = None, retries: Retry | bool | int | None = None, redirect: bool = True, assert_same_host: bool = True, timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, pool_timeout: int | None = None, release_conn: bool | None = None, chunked: bool = False, body_pos: _TYPE_BODY_POSITION | None = None, preload_content: bool = True, decode_content: bool = True, **response_kw: typing.Any, ) -> BaseHTTPResponse: """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param url: The URL to perform the request on. :param body: Data to send in the request body, either :class:`str`, :class:`bytes`, an iterable of :class:`str`/:class:`bytes`, or a file-like object. :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When ``False``, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param bool preload_content: If True, the response's body will be preloaded into memory. :param bool decode_content: If True, will attempt to decode the body based on the 'content-encoding' header. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``preload_content`` which defaults to ``True``. :param bool chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. """ parsed_url = parse_url(url) destination_scheme = parsed_url.scheme if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = preload_content # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = to_str(_encode_target(url)) else: url = to_str(parsed_url.url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] release_this_conn = release_conn http_tunnel_required = connection_requires_http_tunnel( self.proxy, self.proxy_config, destination_scheme ) # Merge the proxy headers. Only done when not using HTTP CONNECT. We # have to copy the headers dict so we can safely change it without those # changes being reflected in anyone else's copy. if not http_tunnel_required: headers = headers.copy() # type: ignore[attr-defined] headers.update(self.proxy_headers) # type: ignore[union-attr] # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] # Is this a closed/new connection that requires CONNECT tunnelling? if self.proxy is not None and http_tunnel_required and conn.is_closed: try: self._prepare_proxy(conn) except (BaseSSLError, OSError, SocketTimeout) as e: self._raise_timeout( err=e, url=self.proxy.url, timeout_value=conn.timeout ) raise # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Make the request on the HTTPConnection object > response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, retries=retries, response_conn=response_conn, preload_content=preload_content, decode_content=decode_content, **response_kw, ) .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:790: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:496: in _make_request conn.request( .tox/code/lib/python3.10/site-packages/urllib3/connection.py:395: in request self.endheaders() /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1277: in endheaders self._send_output(message_body, encode_chunked=encode_chunked) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:1037: in _send_output self.send(msg) /opt/pyenv/versions/3.10.6/lib/python3.10/http/client.py:975: in send self.connect() .tox/code/lib/python3.10/site-packages/urllib3/connection.py:243: in connect self.sock = self._new_conn() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def _new_conn(self) -> socket.socket: """Establish a socket connection and set nodelay settings on it. :return: New socket connection. """ try: sock = connection.create_connection( (self._dns_host, self.port), self.timeout, source_address=self.source_address, socket_options=self.socket_options, ) except socket.gaierror as e: raise NameResolutionError(self.host, self, e) from e except SocketTimeout as e: raise ConnectTimeoutError( self, f"Connection to {self.host} timed out. (connect timeout={self.timeout})", ) from e except OSError as e: > raise NewConnectionError( self, f"Failed to establish a new connection: {e}" ) from e E urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 16] Device or resource busy .tox/code/lib/python3.10/site-packages/urllib3/connection.py:218: NewConnectionError The above exception was the direct cause of the following exception: self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: > resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) .tox/code/lib/python3.10/site-packages/requests/adapters.py:486: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:874: in urlopen return self.urlopen( .tox/code/lib/python3.10/site-packages/urllib3/connectionpool.py:844: in urlopen retries = retries.increment( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Retry(total=0, connect=None, read=None, redirect=None, status=None) method = 'POST', url = '/ric/v1/deregister', response = None error = NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy') _pool = _stacktrace = def increment( self, method: str | None = None, url: str | None = None, response: BaseHTTPResponse | None = None, error: Exception | None = None, _pool: ConnectionPool | None = None, _stacktrace: TracebackType | None = None, ) -> Retry: """Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.BaseHTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status other = self.other cause = "unknown" status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or method is None or not self._is_method_retryable(method): raise reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif error: # Other retry? if other is not None: other -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = "too many redirects" response_redirect_location = response.get_redirect_location() if response_redirect_location: redirect_location = response_redirect_location status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and the given method is in the allowed_methods cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) status = response.status history = self.history + ( RequestHistory(method, url, error, status, redirect_location), ) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, other=other, history=history, ) if new_retry.is_exhausted(): reason = error or ResponseError(cause) > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] E urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/urllib3/util/retry.py:515: MaxRetryError During handling of the above exception, another exception occurred: monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f3a280e9f60> def test_custom_config_handler(monkeypatch): # point watcher at the file init_config_file() monkeypatch.setenv(Constants.CONFIG_FILE_ENV, config_file_path) def default_handler(self, summary, sbuf): pass startup_config_event = False change_config_event = False def config_handler(self, json): mdc_logger.info("config_handler: json {}".format(json)) nonlocal startup_config_event nonlocal change_config_event if "start" in json: startup_config_event = True if "change" in json: change_config_event = True # listen port is irrelevant, no messages arrive global rmr_xapp_config rmr_xapp_config = RMRXapp(default_handler, config_handler=config_handler, rmr_port=4567, use_fake_sdl=True) assert startup_config_event rmr_xapp_config.run(thread=True, rmr_timeout=1) # in unit tests we need to thread here or else execution is not returned! write_config_file() # give the work loop a chance to timeout on RMR and process the config event time.sleep(3) assert change_config_event > rmr_xapp_config.stop() tests/test_config.py:119: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:926: in stop super().stop() ricxappframe/xapp_frame.py:755: in stop self.xapp_shutdown() ricxappframe/xapp_frame.py:230: in xapp_shutdown self.deregister() ricxappframe/xapp_frame.py:220: in deregister resp = self.session.post(dereg_url, request_string) .tox/code/lib/python3.10/site-packages/requests/sessions.py:637: in post return self.request("POST", url, data=data, json=json, **kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:589: in request resp = self.send(prep, **send_kwargs) .tox/code/lib/python3.10/site-packages/requests/sessions.py:703: in send r = adapter.send(request, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = request = , stream = False timeout = Timeout(connect=None, read=None, total=None), verify = True cert = None, proxies = OrderedDict() def send( self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None ): """Sends PreparedRequest object. Returns Response object. :param request: The :class:`PreparedRequest ` being sent. :param stream: (optional) Whether to stream the request content. :param timeout: (optional) How long to wait for the server to send data before giving up, as a float, or a :ref:`(connect timeout, read timeout) ` tuple. :type timeout: float or tuple or urllib3 Timeout object :param verify: (optional) Either a boolean, in which case it controls whether we verify the server's TLS certificate, or a string, in which case it must be a path to a CA bundle to use :param cert: (optional) Any user-provided SSL certificate to be trusted. :param proxies: (optional) The proxies dictionary to apply to the request. :rtype: requests.Response """ try: conn = self.get_connection(request.url, proxies) except LocationValueError as e: raise InvalidURL(e, request=request) self.cert_verify(conn, request.url, verify, cert) url = self.request_url(request, proxies) self.add_headers( request, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies, ) chunked = not (request.body is None or "Content-Length" in request.headers) if isinstance(timeout, tuple): try: connect, read = timeout timeout = TimeoutSauce(connect=connect, read=read) except ValueError: raise ValueError( f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " f"or a single float to set both timeouts to the same value." ) elif isinstance(timeout, TimeoutSauce): pass else: timeout = TimeoutSauce(connect=timeout, read=timeout) try: resp = conn.urlopen( method=request.method, url=url, body=request.body, headers=request.headers, redirect=False, assert_same_host=False, preload_content=False, decode_content=False, retries=self.max_retries, timeout=timeout, chunked=chunked, ) except (ProtocolError, OSError) as err: raise ConnectionError(err, request=request) except MaxRetryError as e: if isinstance(e.reason, ConnectTimeoutError): # TODO: Remove this in 3.0.0: see #2811 if not isinstance(e.reason, NewConnectionError): raise ConnectTimeout(e, request=request) if isinstance(e.reason, ResponseError): raise RetryError(e, request=request) if isinstance(e.reason, _ProxyError): raise ProxyError(e, request=request) if isinstance(e.reason, _SSLError): # This branch is for urllib3 v1.22 and later. raise SSLError(e, request=request) > raise ConnectionError(e, request=request) E requests.exceptions.ConnectionError: HTTPConnectionPool(host='service-ricplt-appmgr-http.ricplt', port=8080): Max retries exceeded with url: /ric/v1/deregister (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')) .tox/code/lib/python3.10/site-packages/requests/adapters.py:519: ConnectionError ----------------------------- Captured stderr call ----------------------------- 1703722931043 28088/RMR [INFO] sends: ts=1703722931 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722931043 28088/RMR [INFO] sends: ts=1703722931 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722931043 28088/RMR [INFO] sends: ts=1703722931 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722931043 28088/RMR [INFO] sends: ts=1703722931 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722959443 28088/RMR [INFO] sends: ts=1703722959 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722959443 28088/RMR [INFO] sends: ts=1703722959 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722959443 28088/RMR [INFO] sends: ts=1703722959 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722959443 28088/RMR [INFO] sends: ts=1703722959 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722959518 28088/RMR [INFO] sends: ts=1703722959 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722959519 28088/RMR [INFO] sends: ts=1703722959 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722959519 28088/RMR [INFO] sends: ts=1703722959 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722959519 28088/RMR [INFO] sends: ts=1703722959 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722962047 28088/RMR [INFO] sends: ts=1703722962 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722962047 28088/RMR [INFO] sends: ts=1703722962 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722962047 28088/RMR [INFO] sends: ts=1703722962 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722962047 28088/RMR [INFO] sends: ts=1703722962 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) ------------------------------ Captured log call ------------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister --------------------------- Captured stderr teardown --------------------------- 1703722990446 28088/RMR [INFO] sends: ts=1703722990 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722990446 28088/RMR [INFO] sends: ts=1703722990 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722990446 28088/RMR [INFO] sends: ts=1703722990 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722990446 28088/RMR [INFO] sends: ts=1703722990 src=prd-ubuntu1804-builder-2c-2g-2145:4652 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722990522 28088/RMR [INFO] sends: ts=1703722990 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722990522 28088/RMR [INFO] sends: ts=1703722990 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722990522 28088/RMR [INFO] sends: ts=1703722990 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722990522 28088/RMR [INFO] sends: ts=1703722990 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722993050 28088/RMR [INFO] sends: ts=1703722993 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4569 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722993050 28088/RMR [INFO] sends: ts=1703722993 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:4564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722993050 28088/RMR [INFO] sends: ts=1703722993 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3564 open=0 succ=0 fail=0 (hard=0 soft=0) 1703722993050 28088/RMR [INFO] sends: ts=1703722993 src=prd-ubuntu1804-builder-2c-2g-2145:4567 target=127.0.0.1:3563 open=0 succ=0 fail=0 (hard=0 soft=0) ---------------------------- Captured log teardown ----------------------------- WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister WARNING urllib3.connectionpool:connectionpool.py:871 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 16] Device or resource busy')': /ric/v1/deregister ____________________________ test_init_general_xapp ____________________________ def test_init_general_xapp(): def entry(self): # normally we would have some kind of loop here print("bye") > gen_xapp = Xapp(entrypoint=entry, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_init.py:46: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:961: in __init__ super().__init__(rmr_port=rmr_port, rmr_wait_for_ready=rmr_wait_for_ready, use_fake_sdl=use_fake_sdl) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , rmr_port = 4562 rmr_wait_for_ready = False, use_fake_sdl = True, post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError ______________________________ test_init_rmr_xapp ______________________________ def test_init_rmr_xapp(): def post_init(self): print("hey") def foo(self, _summary, _sbuf): pass > rmr_xapp = RMRXapp(foo, post_init=post_init, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_init.py:59: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:811: in __init__ super().__init__( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4562, rmr_wait_for_ready = False, use_fake_sdl = True post_init = .post_init at 0x7f3a2ab6beb0> def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError ________________________________ test_rmr_init _________________________________ def test_rmr_init(): # test variables def_pay = None sixty_pay = None # create rmr app def default_handler(self, summary, sbuf): nonlocal def_pay def_pay = json.loads(summary["payload"]) self.rmr_free(sbuf) def sixtythou_handler(self, summary, sbuf): nonlocal sixty_pay sixty_pay = json.loads(summary["payload"]) self.rmr_free(sbuf) global rmr_xapp > rmr_xapp = RMRXapp(default_handler, rmr_port=4564, use_fake_sdl=True) tests/test_xapps.py:52: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:811: in __init__ super().__init__( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4564, rmr_wait_for_ready = True, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError _____________________________ test_rmr_healthcheck _____________________________ def test_rmr_healthcheck(): # thanos uses the rmr xapp to healthcheck the rmr xapp # test variables health_pay = None def post_init(self): self.rmr_send(b"", Constants.RIC_HEALTH_CHECK_REQ) def default_handler(self, summary, sbuf): pass global rmr_xapp_health > rmr_xapp_health = RMRXapp(default_handler, post_init=post_init, rmr_port=4666, use_fake_sdl=True) tests/test_xapps.py:100: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ricxappframe/xapp_frame.py:811: in __init__ super().__init__( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4666, rmr_wait_for_ready = True, use_fake_sdl = True post_init = .post_init at 0x7f3a2ab69870> def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError ___________________________ test_rnib_get_list_nodeb ___________________________ rnib_information = [b'\n\nnodeb_5678\x12\x14\n\tplmn_5678\x12\x07nb_5678\x18\x06', b''] def test_rnib_get_list_nodeb(rnib_information): global rnib_xapp > rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_xapps.py:117: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4777, rmr_wait_for_ready = False, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError _________________________ test_rnib_get_list_all_nodeb _________________________ rnib_information = [b'\n\nnodeb_5678\x12\x14\n\tplmn_5678\x12\x07nb_5678\x18\x06', b''] def test_rnib_get_list_all_nodeb(rnib_information): global rnib_xapp > rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_xapps.py:145: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4777, rmr_wait_for_ready = False, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError ___________________________ test_rnib_get_list_cells ___________________________ rnib_cellinformation = [b'\x08\x01', b'\x08\x01'] def test_rnib_get_list_cells(rnib_cellinformation): global rnib_xapp > rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_xapps.py:166: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4777, rmr_wait_for_ready = False, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError ---------------------------- Captured stdout setup ----------------------------- _____________________________ test_rnib_get_nodeb ______________________________ rnib_helpers = def test_rnib_get_nodeb(rnib_helpers): global rnib_xapp > rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_xapps.py:184: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4777, rmr_wait_for_ready = False, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError ______________________________ test_rnib_get_cell ______________________________ rnib_helpers = def test_rnib_get_cell(rnib_helpers): global rnib_xapp > rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_xapps.py:201: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4777, rmr_wait_for_ready = False, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError ___________________________ test_rnib_get_cell_by_id ___________________________ rnib_helpers = def test_rnib_get_cell_by_id(rnib_helpers): global rnib_xapp > rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_xapps.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4777, rmr_wait_for_ready = False, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError _____________________________ test_rnib_get_cells ______________________________ rnib_helpers = def test_rnib_get_cells(rnib_helpers): global rnib_xapp > rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_xapps.py:235: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4777, rmr_wait_for_ready = False, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError __________________________ test_rnib_get_global_nodeb __________________________ rnib_helpers = def test_rnib_get_global_nodeb(rnib_helpers): global rnib_xapp > rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_xapps.py:252: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4777, rmr_wait_for_ready = False, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError __________________________ test_rnib_get_ranfunction ___________________________ rnib_helpers = def test_rnib_get_ranfunction(rnib_helpers): global rnib_xapp > rnib_xapp = _BaseXapp(rmr_port=4777, rmr_wait_for_ready=False, use_fake_sdl=True) tests/test_xapps.py:269: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = rmr_port = 4777, rmr_wait_for_ready = False, use_fake_sdl = True post_init = None def __init__(self, rmr_port=4562, rmr_wait_for_ready=True, use_fake_sdl=False, post_init=None): """ Documented in the class comment. """ # PUBLIC, can be used by xapps using self.(name): self.logger = Logger(name=__name__) self._appthread = None # Start rmr rcv thread self._rmr_loop = xapp_rmr.RmrLoop(port=rmr_port, wait_for_ready=rmr_wait_for_ready) self._mrc = self._rmr_loop.mrc # for convenience # SDL self.sdl = SDLWrapper(use_fake_sdl) # Config # The environment variable specifies the path to the Xapp config file self._config_path = os.environ.get(Constants.CONFIG_FILE_ENV, None) if self._config_path and os.path.isfile(self._config_path): self._inotify = inotify_simple.INotify() self._inotify.add_watch(self._config_path, inotify_simple.flags.MODIFY) self.logger.debug("__init__: watching config file {}".format(self._config_path)) else: self._inotify = None self.logger.warning("__init__: NOT watching any config file") self.session = requests.Session() # set Retry mechanism for any failure retries = Retry(total=5, backoff_factor=1, allowed_methods=frozenset(['GET', 'POST'])) adapter = HTTPAdapter(max_retries=retries) self.session.mount('http://', adapter) self.session.mount('https://', adapter) # configuration data for xapp registration and deregistration self._config_data = None if self._config_path and os.path.isfile(self._config_path): with open(self._config_path) as json_file: self._config_data = json.load(json_file) else: > elf.logger.error("__init__: Cannot Read config file for xapp Registration") E NameError: name 'elf' is not defined ricxappframe/xapp_frame.py:128: NameError =============================== warnings summary =============================== tests/test_config.py::test_custom_config_handler /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/.tox/code/lib/python3.10/site-packages/_pytest/threadexception.py:73: PytestUnhandledThreadExceptionWarning: Exception in thread Thread-3 (loop) Traceback (most recent call last): File "/w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/ricxappframe/xapp_frame.py", line 910, in loop with open(self._config_path) as json_file: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/file.json' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/pyenv/versions/3.10.6/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/opt/pyenv/versions/3.10.6/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/w/workspace/ric-plt-xapp-frame-py-pypi-verify-master/ricxappframe/xapp_frame.py", line 915, in loop raise XappError(f"Error occurred during polling configuration handler: {error.str()}") AttributeError: 'FileNotFoundError' object has no attribute 'str' warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg)) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ---------------------- generated xml file: /tmp/tests.xml ---------------------- ---------- coverage: platform linux, python 3.10.6-final-0 ----------- Name Stmts Miss Cover Missing ----------------------------------------------------------------------- ricxappframe/__init__.py 0 0 100% ricxappframe/alarm/__init__.py 0 0 100% ricxappframe/alarm/alarm.py 94 2 98% 250-251 ricxappframe/alarm/exceptions.py 2 0 100% ricxappframe/constants.py 5 0 100% ricxappframe/e2ap/__init__.py 0 0 100% ricxappframe/e2ap/asn1.py 224 0 100% ricxappframe/e2ap/asn1clib/__init__.py 0 0 100% ricxappframe/e2ap/asn1clib/asn1clib.py 2 0 100% ricxappframe/e2ap/asn1clib/types.py 16 0 100% ricxappframe/logger/__init__.py 0 0 100% ricxappframe/logger/mdclogger.py 133 22 83% 83-87, 95, 188-189, 196, 198, 200, 202, 220-224, 227-234 ricxappframe/metric/__init__.py 0 0 100% ricxappframe/metric/exceptions.py 2 0 100% ricxappframe/metric/metric.py 58 3 95% 122, 201-202 ricxappframe/rmr/__init__.py 0 0 100% ricxappframe/rmr/exceptions.py 4 0 100% ricxappframe/rmr/helpers.py 28 0 100% ricxappframe/rmr/rmr.py 156 3 98% 257, 454, 544 ricxappframe/rmr/rmr_mocks/__init__.py 0 0 100% ricxappframe/rmr/rmr_mocks/rmr_mocks.py 78 6 92% 39, 59, 79, 115, 133, 148 ricxappframe/rmr/rmrclib/__init__.py 0 0 100% ricxappframe/rmr/rmrclib/rmrclib.py 38 1 97% 53 ricxappframe/util/__init__.py 0 0 100% ricxappframe/util/constants.py 11 0 100% ricxappframe/xapp_frame.py 263 134 49% 129, 133, 151-162, 173-199, 222-224, 231-232, 244-246, 266-276, 301-307, 322, 350, 378, 409, 425, 452-458, 478, 498, 525-530, 554-559, 584-590, 617-628, 645-650, 673-678, 701-709, 715, 739, 753, 757, 828-831, 897-901, 920, 927-928, 962, 968-970 ricxappframe/xapp_rest.py 91 12 87% 66, 72-74, 131-132, 142-143, 155-156, 191-193 ricxappframe/xapp_rmr.py 42 23 45% 76-94, 107-113, 126, 129-137 ricxappframe/xapp_sdl.py 94 2 98% 53, 655 ricxappframe/xapp_subscribe.py 54 3 94% 64, 103, 171 ricxappframe/xapp_symptomdata.py 119 20 83% 43, 111-116, 152, 154-156, 160-161, 200-201, 221-224, 228 ----------------------------------------------------------------------- TOTAL 1514 231 85% Coverage HTML written to dir htmlcov Coverage XML written to file coverage.xml Required test coverage of 70% reached. Total coverage: 84.74% =========================== short test summary info ============================ FAILED tests/test_config.py::test_config_no_env - NameError: name 'elf' is no... FAILED tests/test_config.py::test_default_config_handler - requests.exception... FAILED tests/test_config.py::test_custom_config_handler - requests.exceptions... FAILED tests/test_init.py::test_init_general_xapp - NameError: name 'elf' is ... FAILED tests/test_init.py::test_init_rmr_xapp - NameError: name 'elf' is not ... FAILED tests/test_xapps.py::test_rmr_init - NameError: name 'elf' is not defined FAILED tests/test_xapps.py::test_rmr_healthcheck - NameError: name 'elf' is n... FAILED tests/test_xapps.py::test_rnib_get_list_nodeb - NameError: name 'elf' ... FAILED tests/test_xapps.py::test_rnib_get_list_all_nodeb - NameError: name 'e... FAILED tests/test_xapps.py::test_rnib_get_list_cells - NameError: name 'elf' ... FAILED tests/test_xapps.py::test_rnib_get_nodeb - NameError: name 'elf' is no... FAILED tests/test_xapps.py::test_rnib_get_cell - NameError: name 'elf' is not... FAILED tests/test_xapps.py::test_rnib_get_cell_by_id - NameError: name 'elf' ... FAILED tests/test_xapps.py::test_rnib_get_cells - NameError: name 'elf' is no... FAILED tests/test_xapps.py::test_rnib_get_global_nodeb - NameError: name 'elf... FAILED tests/test_xapps.py::test_rnib_get_ranfunction - NameError: name 'elf'... ============= 16 failed, 59 passed, 1 warning in 119.63s (0:01:59) ============= code: exit 1 (120.11 seconds) /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master> pytest --cov ricxappframe --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 --junitxml=/tmp/tests.xml pid=28088 .pkg: _exit> python /tmp/venv-HMen/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ code: FAIL ✖ in 2 minutes 16.35 seconds flake8: install_deps> python -I -m pip install flake8 flake8: freeze> python -m pip freeze --all flake8: flake8==6.1.0,mccabe==0.7.0,pip==23.3.1,pycodestyle==2.11.1,pyflakes==3.1.0,setuptools==69.0.2,wheel==0.42.0 flake8: commands[0]> flake8 setup.py ricxappframe tests ricxappframe/xapp_frame.py:114:33: W291 trailing whitespace ricxappframe/xapp_frame.py:128:13: F821 undefined name 'elf' ricxappframe/xapp_frame.py:152:1: W293 blank line contains whitespace ricxappframe/xapp_frame.py:176:9: F841 local variable 'pltnamespace' is assigned to but never used ricxappframe/xapp_frame.py:182:29: F541 f-string is missing placeholders ricxappframe/xapp_frame.py:194:50: F821 undefined name 'plt_namespace' ricxappframe/xapp_frame.py:194:65: F821 undefined name 'plt_namespace' ricxappframe/xapp_frame.py:199:72: W291 trailing whitespace ricxappframe/xapp_frame.py:213:1: W293 blank line contains whitespace ricxappframe/xapp_frame.py:224:75: W291 trailing whitespace ricxappframe/xapp_frame.py:973:5: E303 too many blank lines (2) ricxappframe/xapp_rmr.py:127:1: W293 blank line contains whitespace ricxappframe/xapp_rmr.py:130:76: F821 undefined name 'port' ricxappframe/xapp_rmr.py:133:1: W293 blank line contains whitespace ricxappframe/xapp_rmr.py:140:1: W391 blank line at end of file flake8: exit 1 (0.80 seconds) /w/workspace/ric-plt-xapp-frame-py-pypi-verify-master> flake8 setup.py ricxappframe tests pid=28423 code: FAIL code 1 (136.35=setup[16.24]+cmd[120.11] seconds) flake8: FAIL code 1 (3.12=setup[2.32]+cmd[0.80] seconds) evaluation failed :( (139.65 seconds)