aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/ContainerUtils.py
AgeCommit message (Collapse)AuthorFilesLines
2018-09-05Fix various pylint violationsVratko Polak1-6/+2
+ SchedUtils.py: Do not use `len(SEQUENCE)` to determine if a sequence is empty + VatHistory.py: Do not use `len(SEQUENCE)` to determine if a sequence is empty + VppCounters.py: Do not use `len(SEQUENCE)` to determine if a sequence is empty + Memif.py: ++ Do not use `len(SEQUENCE)` to determine if a sequence is empty ++ Either all return statements in a function should return an expression, or none of them should. ++ Update :return: on possible None. + Classify.py: Unnecessary "else" after "return" + ContainerUtils.py: Useless super delegation in method '__init__' + CpuUtils.py: Do not use `len(SEQUENCE)` to determine if a sequence is empty + DropRateSearch.py: Either all return statements in a function should return an expression, or none of them should. + IPv4NodeAddress.py: Do not use `len(SEQUENCE)` to determine if a sequence is empty ++ Also improve docstrings. + IPv4Setup.py: Useless super delegation in method '__init__' + IPv6Setup.py: Do not use `len(SEQUENCE)` to determine if a sequence is empty ++ Also improve docstrings. + IPv6Setup.py: standard import "from ipaddress import IPv6Network" should be placed before "from robot.api import logger" + MacSwap.py: Trailing newlines + NATUtil.py: Do not use `len(SEQUENCE)` to determine if a sequence is empty + NodePath.py: Unnecessary "else" after "return" + Tap.py: Do not use `len(SEQUENCE)` to determine if a sequence is empty + topology.py: Either all return statements in a function should return an expression, or none of them should. + topology.py: Unnecessary "else" after "return" ++ Do not use `len(SEQUENCE)` to determine if a sequence is empty ++ Improve docstrings + DUTSetup.py: Do not use `len(SEQUENCE)` to determine if a sequence is empty ++ Also do not compare int(ret_code) just to access zero-ness. + ssh.py: Do not use `len(SEQUENCE)` to determine if a sequence is empty + InterfaceUtil.py: Unnecessary "else" after "return" Change-Id: Iba4244aa79661ee7df15fed5c7c6dbf04dfa88b2 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2018-08-10CSIT-1156 Create container memif tests for 2-node topologyPeter Mikus1-1/+4
CSIT-1155 Implement container memif KWs for 2-node topology Change-Id: I4fc7bcab499a0b8a8594114d3f331b0d9610bf9d Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-08-10CSIT-1193 De-duplicate bootstrap scripts into onePeter Mikus1-3/+6
- DPDK and VPP bootstrap merged into one (ligato will follow). - Added more error detections - Added topo-cleanup.py to cleanup TB before and after test. - Remove installation of VPP Change-Id: I7a86117eb03cbe4ee8fde47baeed58bc86c0dfb2 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-07-27FIX: Interface up handlingPeter Mikus1-2/+10
- Increase timeout when trying to check interface (this is useful if there are multiple interfaces and dump command take more than TIMEOUT/NR_IF which is happening quite often). - Reverse the order of applying MTU and interface UP to try to prevent API overload during interface initialization phase. Change-Id: I4e8623963d15b3c0d202172b4c58c43a972bb9cb Signed-off-by: Peter Mikus <pmikus@cisco.com> (cherry picked from commit 584345da4f7330f7517e5defd894b4995c2b57b0)
2018-06-08CSIT-1081 Container VPP configuration refactorPeter Mikus1-28/+89
Adopt code for various topology configurations. Change-Id: Iaf9d7995ab8cd06da0c56c5e5664d57d19e74d7c Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-05-14CSIT-1036 Expose option to install DKMS in containerPeter Mikus1-9/+3
Expose DKMS installation as suite variable. This will allow to use DPDK driver for future tests. Change-Id: I38fd014c8cf6f4bf42881af2196cadc679fe53e0 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-05-12CSIT-1079 Add multiple mount dirs into containerPeter Mikus1-49/+58
Pass the list of mount dirs into container LXC/Docker Change-Id: Ie80062563955273791ab63e156bf0b369e5be649 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-04-25Fix warnings reported by gen_doc.shVratko Polak1-6/+6
+ Docstring warnings fixed. + Multiline param descriptions indented by 4 spaces. - Except the PacketVerifier.py one - I have tried several quote-like blocks, nothing works. - Rst warnings not fixed. - How can I fix them? They refer to temporarily created files. + Other improvements: + Python lines no longer than 80 characters. + :return: -> :returns: + Notes before params. + :raises + closing colon after exception class. + Description is a sentence. + Present tense in conditional sentences. + Bumped copyright year in edited files. Change-Id: I462c194eeecb666dc146e26858486a07c990be9b Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2018-04-20FIX: Restart VPP in container before each testPeter Mikus1-0/+6
Change-Id: Iec7045aadc0675e04b8c74cbe28f8b3f193bcf1f Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-04-19FIX: Memif tests failingPeter Mikus1-0/+3
- CSIT-1049 Change-Id: I073c1e6d8cdda835fbb955cbf79e982bc2cc6228 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-04-05FIX: Change plugin default behavior for Container tests Peter Mikus1-2/+1
Looks like disabling all plugins in container leaving only memif_plugin.so results into issue that could lead into lost of SSH connectivity to TB or in better case to not handling any traffic. This fix is supose to return previous behavior for Container instance of VPP. vpp_config.add_plugin('disable', 'dpdk_plugin.so') Change-Id: I7bca6c73c0f5aaf30d423b90ff7c2d2c38d54700 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-04-05Revert "FIX: Change plugin default behavior for Container tests"Peter Mikus1-1/+2
This reverts commit c754789176b1a3ca00a129d3d207aa5a6bad7c27. Change-Id: Ic1bbe8fac0d98f41aa8b1b57da0c7a147111340b Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-04-05FIX: Change plugin default behavior for Container testsPeter Mikus1-2/+1
Looks like disabling all plugins in container leaving only memif_plugin.so results into issue that could lead into lost of SSH connectivity to TB or in better case to not handling any traffic. This fix is supose to return previous behavior for Container instance of VPP. Change-Id: Ie8b3ce2e35a40c8f3498e490abb6967cd4dd912a Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-03-30Change the default plugin behavior in perf testsPeter Mikus1-1/+2
Currently we are selectively disabling plugins by creating list of disabled plugins for performance tests. Thanks to the new API in VPP we can revert the logic to selectivly enable plugins. This is more stable for future onboarding of new plugins into VPP. Change-Id: Ibdd56d6097230d095a304bbb6984b565d9428f51 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-03-08CSIT-989 Fix: Reflect latest memif API changesPeter Mikus1-8/+14
Change-Id: I0c9cb073a42a8b4b7e573023e784ab9e72d0ad55 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-02-23FIX: LXC/DOCKER exclusive CPUPeter Mikus1-0/+17
By default the cpuset cgroup is using exclusive CPU/MEM. When Docker container is initialized a new cgroup /docker or /lxc is created under cpuset parent tree. This newly created cgroup is inheriting parent setting for cpu/mem exclusive parameter and thus cannot be overriden within /docker or /lxc cgroup. This patch is supposed to set cpu/mem exclusive parameter for both parent and subgroup. Change-Id: I14b44db3f77c842756ec78aa60df7aca508d9545 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2017-10-12CSIT-748 vnf-agent integrationPeter Mikus1-47/+70
CSIT-773 Implement RF keywords for k8s - Implementation of Test Suite Setup for Ligato vnf-agent testing - Implementation of KubernetesUtil for controlling kubectl - Yaml templates for L2XC topology with 1cswitch and 1cnf - Yaml templates for L2BD topology with 1cswitch and 1cnf - ligato bootstrap script for creating vnf-agent image Change-Id: Iebefde0eb984a27a0afcdf29fe549ca4edf8a61e Signed-off-by: Peter Mikus <pmikus@cisco.com>
2017-10-09CSIT-768: Refactor Python container librariesPeter Mikus1-0/+754
CSIT-769: Implement L2 RF keywords for container orchestration Change-Id: I7637d1ecc3a45111522b8d6c578b3f88369aff6b Signed-off-by: Peter Mikus <pmikus@cisco.com>