summaryrefslogtreecommitdiffstats
path: root/src/plugins/igmp
AgeCommit message (Expand)AuthorFilesLines
2021-12-03api: refactor to use REPLY_MSG_ID_BASE #defineKlement Sekera2-8/+8
2021-10-21fib: respect mfib entry flags on create with pathsPaul Atkins2-11/+13
2021-05-13tests: move test source to vpp/testDave Wallace2-912/+0
2021-05-01vlib: refactor trajectory trace debug featureBenoît Ganne1-1/+0
2021-02-11tests: tag the tests that do not work with multi-worker configurationAndrew Yourtchenko1-0/+2
2020-12-14misc: move to new pool_foreach macrosDamjan Marion2-9/+9
2020-12-08fib: Source Address SelectionNeale Ranns1-2/+2
2020-05-06docs: clean up make docs jobPaul Vinciguerra5-13/+10
2020-04-16igmp: fix igmp proxy group mergeBenoît Ganne6-24/+25
2020-03-17fib: Always install all routers mcast addressesNeale Ranns1-3/+3
2020-02-18misc: fix coverity warningsDave Barach1-1/+1
2020-01-10docs: Edit FEATURE.yaml files so they can be publishedJohn DeNisco1-1/+1
2020-01-03igmp: Add feature.yamlNeale Ranns1-0/+9
2019-12-14tests: changes for scapy 2.4.3 migrationsnaramre1-1/+2
2019-12-06igmp: use explicit types in apiOle Troan1-10/+11
2019-11-08tests: python3 use byte strings in raw()Ole Troan1-1/+1
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
2019-09-27igmp: remove api boilerplateOle Troan4-145/+6
2019-09-16api: autogenerate api trace print/endianOle Troan1-0/+4
2019-08-22tests: move plugin tests to src/plugins/*/testDave Wallace2-0/+909
2019-08-20vppapigen: remove support for legacy typedefsPaul Vinciguerra1-1/+1
2019-06-30igmp: accept packets that have more on the wire data than IGMP reports.Neale Ranns1-13/+19
2019-06-28igmp: Trace more data form input packetsNeale Ranns2-7/+16
2019-06-18fib: fib api updatesNeale Ranns2-22/+19
2019-05-16init / exit function orderingDave Barach3-22/+21
2019-05-03plugins: clean up plugin descriptionsDave Wallace1-1/+1
2019-04-23API: Python and Unix domain socket improvementOle Troan2-7/+3
2019-04-10API: Fix shared memory only action handlers.Ole Troan1-21/+21
2019-03-14IGMP: typo and doc fix (no behaviour change)Neale Ranns2-7/+7
2019-01-20buffers: don't init metadata, as it is already initializedDamjan Marion1-3/+0
2018-12-13make build failure.Paul Vinciguerra1-2/+2
2018-12-06API: Change ip4_address and ip6_address to use type alias.Ole Troan1-2/+2
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach2-8/+8
2018-11-13IGMP: improve CLI debug outputNeale Ranns9-42/+163
2018-11-06IGMP: Improved handling of (*,G) join and leaveNeale Ranns1-20/+74
2018-10-23c11 safe string handling supportDave Barach6-12/+12
2018-10-16IGMP: proxy deviceJakub Grajciar15-12/+749
2018-10-01IGMP: handle (*,G) report with no source addressesNeale Ranns1-8/+14
2018-09-24Trivial: Clean up some typos.Paul Vinciguerra12-17/+17
2018-08-27IGMP: enable command on cliNeale Ranns4-2/+84
2018-08-27cmake: Fix plugins .h includesMohsin Kazmi1-0/+4
2018-08-25cmake: improve add_vpp_plugin macroDamjan Marion1-2/+5
2018-08-17CMake as an alternative to autotools (experimental)Damjan Marion1-0/+29
2018-07-12IGMP: validate the packets length in the DPNeale Ranns3-25/+55
2018-07-10IGMP: coverity found defectsNeale Ranns3-4/+10
2018-07-09IGMP improvementsNeale Ranns27-1734/+3760
2018-06-29igmp: bugfix and minor improvementsJakub Grajciar5-76/+60
2018-06-10IGMP: use simple u32 bit hash keyNeale Ranns3-18/+15
2018-06-08Add reaper functions to want events APIs (VPP-1304)Neale Ranns2-32/+43
2018-05-23VPP-1283: IPv4 PMTU missing MTU value in ICMP4 message.Ole Troan1-1/+1
bp">self._details = details if enable_logging: logger.error(self._msg) logger.debug(self._details) def __repr__(self): return repr(self._msg) def __str__(self): return str(self._msg) class HTTPRequest(object): """A class implementing HTTP requests GET, PUT, POST and DELETE used in communication with Honeycomb. The communication with Honeycomb and processing of all exceptions is done in the method _http_request which uses requests.request to send requests and receive responses. The received status code and content of response are logged on the debug level. All possible exceptions raised by requests.request are also processed there. The other methods (get, put, post and delete) use _http_request to send corresponding request. These methods must not be used as keywords in tests. Use keywords implemented in the module HoneycombAPIKeywords instead. """ def __init__(self): pass @staticmethod def create_full_url(ip_addr, port, path): """Creates full url including host, port, and path to data. :param ip_addr: Server IP. :param port: Communication port. :param path: Path to data. :type ip_addr: str :type port: str or int :type path: str :return: Full url. :rtype: str """ return "http://{ip}:{port}{path}".format(ip=ip_addr, port=port, path=path) @staticmethod def _http_request(method, node, path, enable_logging=True, **kwargs): """Sends specified HTTP request and returns status code and response content. :param method: The method to be performed on the resource identified by the given request URI. :param node: Honeycomb node. :param path: URL path, e.g. /index.html. :param enable_logging: Used to suppress errors when checking Honeycomb state during suite setup and teardown. :param kwargs: Named parameters accepted by request.request: params -- (optional) Dictionary or bytes to be sent in the query string for the Request. data -- (optional) Dictionary, bytes, or file-like object to send in the body of the Request. json -- (optional) json data to send in the body of the Request. headers -- (optional) Dictionary of HTTP Headers to send with the Request. cookies -- (optional) Dict or CookieJar object to send with the Request. files -- (optional) Dictionary of 'name': file-like-objects (or {'name': ('filename', fileobj)}) for multipart encoding upload. timeout (float or tuple) -- (optional) How long to wait for the server to send data before giving up, as a float, or a (connect timeout, read timeout) tuple. allow_redirects (bool) -- (optional) Boolean. Set to True if POST/ PUT/DELETE redirect following is allowed. proxies -- (optional) Dictionary mapping protocol to the URL of the proxy. verify -- (optional) whether the SSL cert will be verified. A CA_BUNDLE path can also be provided. Defaults to True. stream -- (optional) if False, the response content will be immediately downloaded. cert -- (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. :type method: str :type node: dict :type path: str :type enable_logging: bool :type kwargs: dict :return: Status code and content of response. :rtype: tuple :raises HTTPRequestError: If 1. it is not possible to connect, 2. invalid HTTP response comes from server, 3. request exceeded the configured number of maximum re-directions, 4. request timed out, 5. there is any other unexpected HTTP request exception. """ timeout = kwargs["timeout"] url = HTTPRequest.create_full_url(node['host'], node['honeycomb']['port'], path) try: auth = HTTPBasicAuth(node['honeycomb']['user'], node['honeycomb']['passwd']) rsp = request(method, url, auth=auth, **kwargs) logger.debug("Status code: {0}".format(rsp.status_code)) logger.debug("Response: {0}".format(rsp.content)) return rsp.status_code, rsp.content except ConnectionError as err: # Switching the logging on / off is needed only for # "requests.ConnectionError" raise HTTPRequestError("Not possible to connect to {0}:{1}.". format(node['host'], node['honeycomb']['port']), repr(err), enable_logging=enable_logging) except HTTPError as err: raise HTTPRequestError("Invalid HTTP response from {0}.". format(node['host']), repr(err)) except TooManyRedirects as err: raise HTTPRequestError("Request exceeded the configured number " "of maximum re-directions.", repr(err)) except Timeout as err: raise HTTPRequestError("Request timed out. Timeout is set to {0}.". format(timeout), repr(err)) except RequestException as err: raise HTTPRequestError("Unexpected HTTP request exception.", repr(err)) @staticmethod @keyword(name="HTTP Get") def get(node, path, headers=None, timeout=10, enable_logging=True): """Sends a GET request and returns the response and status code. :param node: Honeycomb node. :param path: URL path, e.g. /index.html. :param headers: Dictionary of HTTP Headers to send with the Request. :param timeout: How long to wait for the server to send data before giving up, as a float, or a (connect timeout, read timeout) tuple. :param enable_logging: Used to suppress errors when checking Honeycomb state during suite setup and teardown. When True, logging is enabled, otherwise logging is disabled. :type node: dict :type path: str :type headers: dict :type timeout: float or tuple :type enable_logging: bool :return: Status code and content of response. :rtype: tuple """ return HTTPRequest._http_request('GET', node, path, enable_logging=enable_logging, headers=headers, timeout=timeout) @staticmethod @keyword(name="HTTP Put") def put(node, path, headers=None, payload=None, json=None, timeout=10): """Sends a PUT request and returns the response and status code. :param node: Honeycomb node. :param path: URL path, e.g. /index.html. :param headers: Dictionary of HTTP Headers to send with the Request. :param payload: Dictionary, bytes, or file-like object to send in the body of the Request. :param json: JSON formatted string to send in the body of the Request. :param timeout: How long to wait for the server to send data before giving up, as a float, or a (connect timeout, read timeout) tuple. :type node: dict :type path: str :type headers: dict :type payload: dict, bytes, or file-like object :type json: str :type timeout: float or tuple :return: Status code and content of response. :rtype: tuple """ return HTTPRequest._http_request('PUT', node, path, headers=headers, data=payload, json=json, timeout=timeout) @staticmethod @keyword(name="HTTP Post") def post(node, path, headers=None, payload=None, json=None, timeout=10): """Sends a POST request and returns the response and status code. :param node: Honeycomb node. :param path: URL path, e.g. /index.html. :param headers: Dictionary of HTTP Headers to send with the Request. :param payload: Dictionary, bytes, or file-like object to send in the body of the Request. :param json: JSON formatted string to send in the body of the Request. :param timeout: How long to wait for the server to send data before giving up, as a float, or a (connect timeout, read timeout) tuple. :type node: dict :type path: str :type headers: dict :type payload: dict, bytes, or file-like object :type json: str :type timeout: float or tuple :return: Status code and content of response. :rtype: tuple """ return HTTPRequest._http_request('POST', node, path, headers=headers, data=payload, json=json, timeout=timeout) @staticmethod @keyword(name="HTTP Delete") def delete(node, path, timeout=10): """Sends a DELETE request and returns the response and status code. :param node: Honeycomb node. :param path: URL path, e.g. /index.html. :param timeout: How long to wait for the server to send data before giving up, as a float, or a (connect timeout, read timeout) tuple. :type node: dict :type path: str :type timeout: float or tuple :return: Status code and content of response. :rtype: tuple """ return HTTPRequest._http_request('DELETE', node, path, timeout=timeout)