aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/IPUtil.py
AgeCommit message (Collapse)AuthorFilesLines
2023-01-16feat(papi): switch ip from vat to async papiVratko Polak1-47/+0
Change-Id: I3ecad09d2659124a6c07d642a453845ed1779258 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2023-01-16feat(papi): add async mode, use it in scale callsVratko Polak1-3/+3
+ Introduce two explicit handling modes to save memory in scale test. + Connect in async mode for both handling modes (to avoid reconnects). + Support both pre- and post-37758 VPP PAPI async behavior. + Use control-ping in dumps to emulate sync mode. + Do not use it for single reply to avoid VPP-2033. + Fix call sites to get their replies with correct handling mode. + Drain enqueued replies to avoid subsequent errors. + Retry if read returns None too early. + Update docstrings. - Complexity issues reported by pylint postponed, needs larger refactor. - Explicit replace of VAT is done in subsequent changes. Ticket: CSIT-1547 CSIT-1671 Change-Id: I3c63fa5c578975cc4dd7fce0babe3ab04ec15ed3 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2021-10-08fix(Pylint): Small fixespmikus1-2/+2
+ Just few obvious one Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: I9bbac293a56d6b2943bef03cb3b8943e967dae6b
2021-10-06docstring: Docstring warnings fixed.Viliam Luc1-3/+3
Change-Id: I8679c819b7c6ecd9e680bdc6edeafd2124def0b5 Signed-off-by: Viliam Luc <vluc@cisco.com>
2021-08-20Scale tests: Use exec commands and VAT executorVratko Polak1-34/+74
This is the same appoach as in ipsec tests. This is the fastest way to fix scale tests. - Some argument combinations are not supported, e.g. multipath=False. + Make multipath=True default. - Devicetest using local=True only works with PAPI. + But that was true already in rls2106, so no need to fix here. + Add two more formats to NetworkIncrement. + Check address is aligned, unless call side disables that. + Only one keyword for two devicetests disables the check. + Papi history condition to print first and last. + Minor docstring edits. Change-Id: I32d24e2f821b412b5841a50d2f87e1c86345b1aa Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2021-08-20Improve NetworkIncrementVratko Polak1-14/+30
+ Set 1 as default value for increment. + Update IPsecUtil. + Tolerate address with host bits set when incrementing. + Call sites can check initial value on their own. + Support multiple ways of converting to string. - Only the previous "dash" format is supported here. + Update docstrings. Change-Id: I0c71a6327cca6a319715b3fcfbbee800cac14287 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2021-07-28IPsec: add nth matching SPD entry outbound TCsJuraj Linkeš1-1/+45
Add testcases with plain ipv4 forwarding with 1, 10, 100 and 1000 SPD entries on outbound traffic in both directions both directions. Only match the last SPD entry and process others before the matching entry. Add testcases only without flow cache optimization. Refactor the Python functions that add SPD entries: - Unify the args in functions that add one and multiple entries. - For multiple entries, add the ability to pass an object that will handle how values in each iteration (i.e. for each entry) are modified. Change-Id: I061922eec6acc75a4e115202c07e72d89bf1f4d3 Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
2021-06-10FIX: Pylint reducepmikus1-27/+21
Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: I909942dbb920df7f0fe15c0c92cda92c3cd8d8ad
2020-12-16API: deprecated IPSEC APIsJan Gelety1-0/+25
Jira: CSIT-1597 + add ipsec_sa tear down action Change-Id: I4d1e6f26c14e61e8ddc6f29fbf5528a034c84eb0 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2020-10-20FIX: Namespace deletionpmikus1-3/+9
+ Not sure who was doing code. + Set interface up should have namespace version Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: I1103cddb9dd11e25a8ab0ce3f5126b2db9444749
2020-08-07Perf: NAT44 endpoint-dependent mode - udp, part IJan Gelety1-0/+18
- continuation of https://gerrit.fd.io/r/c/csit/+/26898 as there was reached limit of changes (1000) Jira: CSIT-1711 - udp synthetic profiles w/o data packets - udp cps perf tests, phase I (no special "search cps" KW) Part I means that we are using MRR tests to collect traffic data until there is ready new CPS test type with corresponding algorithm. Change-Id: I0d30feb9ecf1d0bff937152656f8eb422f831378 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2020-03-24CSIT-1597 API cleanup: srv6Jan Gelety1-1/+1
- cover API changes in VPP: https://gerrit.fd.io/r/c/vpp/+/25647 - update vpp stable to version 20.05-rc0~398 Change-Id: I5ebc84a702264b0b37e3886b48ec0713d174f880 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2020-03-13Use separate module for ip address objectJan Gelety1-37/+3
Reason: with upcomming vpp api changes the ip object will be used in more csit python libraries, e.g. InterfaceUtil.py, so we need to avoid circular import issue (e.g. InterfaceUtil.pyu <-> IPUtil.py) Change-Id: Ia658b187d4e326f58e33019dd54f8ac7b9137d78 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2020-01-15Hoststack perf infrastructure refactoringDave Wallace1-14/+90
- DUT only topology (hoststack test apps are co-located with vpp) - Make vpp app specific keywords generic where applicable - Add IP4 Prefix to topology file - Support running wrk in linux namespace - Refactor namespace cleanup - Remove redundant namespace creation code - Refactor test/keyword dirs: tcp -> hoststack - Add hoststack utility keywords - Refactor wrk suite setup/teardown - Update tests with recent perf infra changes Change-Id: Ia1cf07978d579393eef94923819a87c8c1f36f34 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2019-12-11CSIT-1597 API cleanup: tapJan Gelety1-8/+6
- cover API changes in VPP: https://gerrit.fd.io/r/c/vpp/+/21706 - cover API cahnges in VPP: https://gerrit.fd.io/r/c/vpp/+/23887 - update vpp stable to version 20.01-rc0~828 Change-Id: I70d88741a02729421d4b31010910138838811518 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-12-05Deal with some "pylint: disable=" commentsVratko Polak1-1/+2
+ When possible, fix the violation. + Else, add a comment: + An explanation (if not already present) and keep disable. + A TODO (if not already present) and remove the disable. - This makes tox job report more pylint violations, but any such violation is fixable and should be fixed. - Although some need to be fixed in VPP, such as enum item long names. Change-Id: I48604b5eda070083d79dff1439620dbd9e798e1f Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-11-28Python3: resources and librariesJan Gelety1-120/+127
Change-Id: I1392c06b1d64f62b141d24c0d42a8e36913b15e2 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-08-20Interface API cleanupJan Gelety1-24/+47
CSIT code alignment with API changes in VPP introduced by patch https://gerrit.fd.io/r/c/vpp/+/18361 Change-Id: Ib0357bba79f55d297ef1086fbf3b760caca16cdb Signed-off-by: Jan Gelety <jgelety@cisco.com> Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-08-14DO_NOT_MERGE CSIT-1194 - Framework easy pylint improvementsMiroslav Los1-1/+1
- force a python2 environment in tox for pylint - let pylint load some compiled modules for member checking - allow locally enabled pylint rules - ignore bad enum names - ignore complexity for code to be refactored by other tickets - broad excepts are acceptable sometimes Signed-off-by: Miroslav Los <miroslav.los@pantheon.tech> Change-Id: If4c3a1b85e8609f074e1de8ce91fc9c4fedbeb38
2019-08-07FIX: Remove PAPI_MAX_API_BULKJan Gelety1-2/+0
- it's not needed anymore as PapiSocketExecutor is used Change-Id: Ia9fad1d18991821d14e9261d27f7f26fca03c14a Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-07-11CSIT-1469: Migrate IPsecUtil library from VAT to PAPIJan Gelety1-6/+16
Change-Id: Iac790bf5755a70697e4c4eff32242b04f8e7f789 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-07-17Use PapiSocketProvider for most PAPI callsVratko Polak1-37/+31
Ticket: CSIT-1541 Ticket: VPP-1722 Ticket: CSIT-1546 + Increase timeout to hide x520 slownes of show hardware detail. - Install sshpass and update ssh client in virl bootstrap. + Added TODOs to remove when CSIT-1546 is fixed. + Enable default socksvr on any startup conf. + Improve OptionString init and repr. - The non-socket executor still kept for stats. + Remove everything unrelated to stats from non-socket executor. - Remove some debug-loooking calls to avoid failures. TODO: Introduce proper parsing to the affected keywords. + Reduce logging from PAPI code to level INFO. - Needs https://gerrit.fd.io/r/20660 to fully work. + Change default values for LocalExecution.run() + Return code check enabled by default. Code is more readable when rc!=0 is allowed explicitly, and the test code will now detect unexpected failures. + Logging disabled by default. Output XML is large already. Important logging can be enabled explicitly. + Restore alphabetical order in common.sh functions. Change-Id: I05882cb6b620ad14638f7404b5ad38c7a5de9e6c Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-07-12PapiExecutor always verifiesVratko Polak1-33/+20
Do not support returning unverified replies anymore. Basically, ".get_replies().verify_replies()" is now just ".get_replies()". This allows fairly large simplifications both at call sites and in PapiExecutor.py + Rename get_dumps to get_details. + Introduce get_reply and get_sw_if_index. + Rename variables holding get_*() value, + e.g. get_stats() value is stored to variable named "stats". + Rename "item" of subsequent loop to hint the type instead. + Rename "details" function argument to "verbose". + Process reply details in place, instead of building new list. - Except hybrid blocks which can return both list or single item. - Except human readable text building blocks. + Rename most similar names to sw_if_index. - Except "vpp_sw_index" and some function names. + Use single run_cli_cmd from PapiExecutor. + Do not chain methods over multiple lines. + Small space gain is not worth readability loss. + Include minor code and docstrings improvement. + Add some TODOs. Change-Id: Ib2110a3d2101a74d5837baab3a58dc46aafc6ce3 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-07-10Fix few pylint violationsVratko Polak1-4/+4
+ Stop attempting to check test/ as module inits are not there. Change-Id: Ia4e498061be3e3118b07e98c9c2f761f2454653e Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-06-18FIX: ip scale needs sw_if_index in VAT commandJan Gelety1-1/+19
Change-Id: Icb3e22a84af10b98edf83084991b8f2607c95798 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-07-03FIX: use len parameter name in prefix structure in ip_route_add_delJan Gelety1-47/+93
+ new vpp stabel build with fixed ipv6 address incrementation Change-Id: Id3f4104a48e45b6fd70ccbd47ad9e3c6925220fd Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-07-01FIX: re-introduce VAT for IP scale testsJan Gelety1-0/+20
Change-Id: I864118ee67628ea81f2f89dab5890df8fe15c4bc Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-06-16FIX: IPUtil after vpp api changesJan Gelety1-122/+149
+ do not log all ip_route_add_del api calls to PAPI history in case of scale tests + fix for SRv6 proxy tests + support of more complex structures in api calls/replies in PapiExecutor + update of vpp stable build to version 19.08-rc0~487-gb98dbb1 Change-Id: I9972e126b68ce1cb57f781e3d90ea9b3914de69e Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-06-18CSIT-1459: Migrate IP libraries from VAT to PAPIJan Gelety1-76/+357
Change-Id: Id84cf9c3afd53260b5bbf658a6a3870aa0c91333 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-03-04Rename to Constants.pyVratko Polak1-1/+1
Motivation: Make the constants available also for Robot. Restraint: Robotframework user guide says: Because variable files are always imported using a file system path, creating them as classes has some restrictions: Python classes must have the same name as the module they are located. Change-Id: I638ef3fe045db132e366de2e2699638b8637e45e Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2018-01-10CSIT-866: wrk onboarding in CSITTibor Frank1-1/+51
- CSIT-867: Low Level Description - CSIT-868: wrk traffic profile - parsing - CSIT-869: wrk implementation into CSIT Change-Id: I65e1037f5ae05b3a5b2020e4a6c54462766ae1b4 Signed-off-by: Tibor Frank <tifrank@cisco.com>
2017-10-11CSIT-778: Add mac-ip binding acl l2bd perf testJan Gelety1-0/+24
Change-Id: Iaced68458b0e4070f861be7854ee428ae8ca4e13 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2016-12-16Pylint fixesTibor Frank1-12/+13
- Fix PyLint errors - Fix comments in touched python modules Change-Id: I26db2d292a41969cf38b9b0bdd49c4fb15349102 Signed-off-by: Tibor Frank <tifrank@cisco.com>
2016-10-10CSIT-392: ip4-lispgpe-ip4Tibor Frank1-0/+20
- ip4-lispgpe-ip4 - main fib, vrf, virt2lisp Change-Id: I28c81e91689021693ce76352878fa21e953a4ef6 Signed-off-by: Tibor Frank <tifrank@cisco.com>
2016-09-05CSIT-229: ip4-lispgpe-ip4Tibor Frank1-1/+67
- main fib, - vrf, - phy2lisp Change-Id: Ic9bacef4574dc07b25041c4cd0653825a65c94fb Signed-off-by: Tibor Frank <tifrank@cisco.com>
2016-08-15CSIT-197: Add basic mapping rule tests for MAP-EMatej Klotton1-2/+21
- IPv4 prefix length + ea bits length < 32 - IPv4 prefix length + ea bits length == 32 - IPv4 prefix length + ea bits length > 32 - End user IPv6 prefix is 64 - IPv4 preffix is 0 Change-Id: Ib8d76abfebfb206fbbaa3c1422b2d321a3ed8712 Signed-off-by: Matej Klotton <mklotton@cisco.com>
2016-06-28Use interface key instead of interface name.Miroslav Miklus1-4/+16
JIRA: CSIT-141 Change-Id: I75cef6d570ab45ea9c4af838b6bf68cefc7c1a91 Signed-off-by: Miroslav Miklus <mmiklus@cisco.com>
2016-05-30Update Honeycomb testsselias1-2/+2
- add new test cases based on reported bugs - minor fixes Change-Id: I8b7464bc1f4e786e3a0ef67ba64d81e1c25ae5cf Signed-off-by: selias <samelias@cisco.com>
2016-05-12Update Honeycomb interface IPv4 testselias1-7/+10
- add verification of ipv4 subnet prefix support - modify keywords to allow setting ipv4 address with network prefix - fix variable definitions to evaluate numbers as ints, not strings - add exception to ipv4 netmask/prefix conversion method Change-Id: I9343ceb35856ddb33674d7067f1def6d40e99acc Signed-off-by: selias <samelias@cisco.com>
2016-05-06Add Honeycomb interface management tests (ipv4, ipv6, ethernet, routing)selias1-0/+19
- add test cases for managing ipv4, ipv6, ethernet and routing configuration on VPP interface - add keywords used in these tests to set and verify configuration - add method and vat template for dumping an interface's configured IP addresses - add method for converting between ipv4 netmasks and network prefixes - clean up documentation of older Honeycomb keywords Note: Test cases are tagged with a placeholder tag to allow manual test runs locally. It should be replaced with the appropriate environment tags once Honeycomb service is deployed on virl. Change-Id: I99ce1e72c8550f520f8c35ef4a93eaebb530db78 Signed-off-by: selias <samelias@cisco.com> Signed-off-by: Matej Klotton <mklotton@cisco.com>
2016-04-22Reformat python libraries.Matej Klotton1-9/+8
PEP8 reformat fix typos docstrings reformat Change-Id: Ic48ba4e06490630808b8e2ab1ab0b046ec7eeed7 Signed-off-by: Matej Klotton <mklotton@cisco.com>
2016-02-08New version of RF tests.Stefan Kobza1-0/+43
Change-Id: I241a2b7a7706e65f71cfd4a62e2a40f053fc5d07 Signed-off-by: Stefan Kobza <skobza@cisco.com>