aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/ContainerUtils.py
AgeCommit message (Collapse)AuthorFilesLines
2019-06-04VAT-to-PAPI: ContainerUtilsTibor Frank1-18/+19
Change-Id: Id186c3c280a6b876b8212e01b261ad8c65e5f40c Signed-off-by: Tibor Frank <tifrank@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>
2019-02-04CSIT-1416 Remove installation of vpp from containersPeter Mikus1-32/+18
Use parent system (Host, Container) installation of VPP. This will save the internet bandwith by skip installing of prerequisites packages. It will also skip dpkg install and simplify the process of initializing VPP inside container. Previosly initialization of VPP in container takes about 55s. With this patch it is reduced to 2-3s. This patch removes the bloated VOLUME creation between container sidecars (a.k.a nested container) and fixes the hugepage allocation. Change-Id: Ifa2be532edb77354657e1b84568bdc34993b00d0 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2019-01-30FIX: Put back sleep to wait for container to boot.Peter Mikus1-1/+1
Change-Id: Id63fc8670c7816cc71d8d6d8704ff7f1adf3db65 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2019-01-30CSIT-1409 Implement pipeline configuration for l2bd with memif/ip4.Peter Mikus1-61/+147
Change-Id: I7463d47a9d65069332eb2a288ff44f4499a8a467 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2019-01-28CSIT-1403 Implement multichain configuration for l2bd with memif/ip4.Peter Mikus1-53/+47
Change-Id: Ia87156b2ba826eb0a9a93d756b9765c7373ca6ce Signed-off-by: Peter Mikus <pmikus@cisco.com>
2019-01-23Fix PyLint errorsTibor Frank1-9/+9
Change-Id: I5a369f4b9f9b478375fda4a634bf57cc9623e972 Signed-off-by: Tibor Frank <tifrank@cisco.com>
2019-01-23VPP_Device - add baseline tests - part IIb)Jan Gelety1-21/+69
CSIT-1372 Add following baseline tests to VPP_Device: - ip4 eth2p-ethip4-ip4base-eth-2memif-1dcr-dev - ip6 eth2p-ethip6-ip6base-eth-2memif-1dcr-dev - l2bd eth2p-eth-l2bdbasemaclrn-eth-2memif-1dcr-dev - l2xc eth2p-eth-l2xcbase-eth-2memif-1dcr-dev Change-Id: Ic4a3a01b62d800c528a9c9371891dcc26b875220 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-01-09CSIT-1389 Refactor current keywords for multichaining - CNFPeter Mikus1-35/+19
- Add ability to create matrix of containers (chains x nodeness) - Change default Docker image to csit-dut - Use new resource mapping function Change-Id: Iaac0f2efc99146fbaef0b33dc71b38770610023d Signed-off-by: Peter Mikus <pmikus@cisco.com>
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>