aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/SetupFramework.py
AgeCommit message (Collapse)AuthorFilesLines
2022-05-31Framework: exclude env and .git when copyingJuraj Linkeš1-3/+4
The tarball is unnecessarily big, remove superflous directories. Change-Id: I55f6fae64973cfac34a1dc18cbdc688cd416e8b9 Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
2021-12-15UTI: Export resultsVratko Polak1-3/+5
+ Model version 1.0.0. - Only some result types are exported. + MRR, NDRPDR and SOAK. - Other result types to be added later. + In contrast, all test types are detected. + Convert custom classes to JSON-serializable equivalents. + Sort dict keys before converting to JSON. + Override the order for some known keys. + Export sets as sorted arrays. + Convert to info content from serialized raw content. + Also export outputs for suite setups and teardowns. + Info files for setup/teardown exist only temporarily. + The data is merged into suite.info.json file. + This simplifies presentation of total suite duration. + Define model via JSON schema: - Just test case, suite setup/teardown/suite to be added later. - Just info, raw to be added later. + Proper descriptions. + Json is generated from yaml. + This is a convenience for maintainers. + The officially used schema is the .json one. + TODOs written into a separate .txt file. + Validate exported instance against the schema. + Include format checking. + Update CSIT requirements for validation dependencies. + This needs python-dateutil==2.8.2, only a patch bump. + Compute bandwidth also for soak tests. + This unifies with NDRPDR to simplify schema definition. - PAL may need an update for parsing soak test message. + Include SSH log items, raw output only. + Generate all outputs in a single filesystem tree. + Move raw outputs into test_output_raw.tar.xz. + Rename existing tar with suites to generated_robot_files.tar.xz. Change-Id: I69ff7b330ed1a14dc435fd0ef008e753c0d7f78c Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2021-07-22Framework: increase framework setup timeoutJuraj Linkeš1-1/+1
With increasing number of tests the amount of time needed to extract the framework also increases. Double the timeout to leave some headroom as well. Change-Id: Ia012272a9a33f2d5d346277cc982e10603a4d3db Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
2021-06-21FrameworkSetup: fix timeout in Arm setupJuraj Linkeš1-1/+1
Framework extraction in Arm jobs is taking longer than the current timeout. Increase the timeout to fix this. Change-Id: Iaddbbe9690eabbed47b19d5264a4f4502e5ed948 Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
2021-04-21FrameworkSetup: increase timeoutJuraj Linkeš1-1/+1
We're hitting a SSHTimeout exception when copying the framework, increase the timeout to fix this. Change-Id: Ic72b9b8b96290c3f0e705d79742bbd39b0bf1e71 Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
2021-04-07SetupFramework: Log env activation outputsVratko Polak1-3/+11
Useful for verifying how much is SUT ready for requirements.txt content. Change-Id: I1e8443f2f9391d646e79a451a88df961845700e4 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2021-03-24FrameworkSetup: fix timeout in Arm setupJuraj Linkeš1-1/+1
Framework extraction in Arm jobs is taking longer than the current timeout. Increase the timeout to fix this. Change-Id: I436d3131fcd7c25fd1f9607095712b4a8aa2d28c Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
2021-03-24FrameworkSetup: catch all exceptions in threadsJuraj Linkeš1-15/+32
Any uncaught exception in a thread running setup_node or cleanup_node will prevent the result of that thread's execution from being passed to the main thread. Since the main thread assumes there will be a result for each thread, this leads to false positives. Catch all exceptions in those background threads to fix this. Change-Id: I64013dfc671e576290c8376a58c754ed21b9ba3e Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
2021-03-19FrameworkSetup: Detect socket.timeoutVratko Polak1-2/+3
Otherwise setup "passes" leading to confusing errors later. Example: https://logs.fd.io/production/vex-yul-rot-jenkins-1/csit-vpp-perf-mrr-daily-master-2n-skx/1251/archives/log.html.gz#s1-s1-s1-k1-k2 Change-Id: I56b14e2eb75679c7c10b00b3f9c6bf07902e5166 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2021-02-16Infra: Ansible 2.10Peter Mikus1-2/+3
Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: I6b058ff30628c7e066372fec2141a8bcc18c3997
2019-11-28Python3: resources and librariesJan Gelety1-66/+102
Change-Id: I1392c06b1d64f62b141d24c0d42a8e36913b15e2 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-11-29Python3: PIP requirementPeter Mikus1-2/+3
- Install via PIP3 - Use virtualenv Python3 interpret Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: Iad22b344b418a1d91774d23d5ea17bfd48d394b3
2019-08-15Add testbed info to output_info.xmlTibor Frank1-2/+3
Change-Id: I2ff45926a754647c1be6263cf8e5e0c7cbfedfef Signed-off-by: Tibor Frank <tifrank@cisco.com>
2019-08-13Add testbed info to output_info.xmlTibor Frank1-1/+3
- Needed for trending Change-Id: I59fc115ce62d1ad839e7c8a39c74af0497b9012d Signed-off-by: Tibor Frank <tifrank@cisco.com>
2019-07-17Use PapiSocketProvider for most PAPI callsVratko Polak1-1/+1
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-06-21SetupFramework: log thread error to consoleVratko Polak1-74/+53
Because logger.error from a non-main thread is lost. + Increase verbosity of virtualenv exception. + Introduce LocalExecution.py library. + Include multiple other style improvements. + Add some ssh.py improvements: + Accept also commands of OptionString type. + Introduce a limited form of raise_from for exception chaining. + Add include_reason argument to exec_cmd_no_error. Change-Id: I0cd92bcdaa1a5c4cc20cb99067593fc3b40d2c31 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-05-29Fix args order in setup_node calljuraj.linkes1-2/+2
Change-Id: I484cda8c8410e2f38d68da82761b1154dda26b1c Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
2019-05-28Use threads for fw setup and cleanupjuraj.linkes1-54/+62
Using multiprocessing sometimes causes scp to hang when copying files. Threading is also more lightweight. Change-Id: I047b4835bbf1584c80469b27af5394d89087e8a9 Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
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-08-10CSIT-1193 De-duplicate bootstrap scripts into onePeter Mikus1-1/+1
- 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-02Compatibility fixes with Ubuntu 18.04Peter Mikus1-2/+5
Currently we are using ip:port socket to for VPP to listen for incoming connections. There is only one place in code this socket is used for detection if VPP is responding after restart. This patch is supposed to change ip:port to sock:file which is default preffered way in VPP. This way we can start using vppctl. netcat on the other side with ip:port remains hanged in console for infinite time not returning back. There is also need to check whether uio_module is loaded and eventually load it. As uio_pci_generic is not working there, we will fallback to main igb_uio (uio_pci_generic being only lightweight subset of igb_uio). This patch also add additional verbose output to console during setup to better understand if failure happens during copy/extract/setup. Change-Id: I0b8a3b76dce3316496a3ad928f58718b6e73057d Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-06-29SetupFramework to detect failures, part IIPeter Mikus1-10/+4
- This patch is enforcing evaluation and aligning all __init__.robot files to use the same logic. Change-Id: I9e2bf5e904bb6d22f4e6a153c951c3b3c233e2fb Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-06-28FIX: SetupFramework to detect failuresPeter Mikus1-65/+57
- Fix behavior of setup framework to properly detect and raise exception in case of any issue occurs during framework setup on any node - General code cleanup Change-Id: Id4cf36e221817600164b25d5551582838b0f0d5e Signed-off-by: Peter Mikus <pmikus@cisco.com>
2017-12-01Exclude RPMs and output xml files from framework packingJan Gelety1-2/+2
Change-Id: Id79c3c54b9bacc10f15c5881492592e69ef3649b Signed-off-by: Jan Gelety <jgelety@cisco.com>
2017-11-29CSIT-864: Add cleanup frameworkJan Gelety1-5/+113
- workaround to avoid disc space issue on nodes when running more test loops Change-Id: I0be2fe0304c80c717a29d6544502e139e69bcdfa Signed-off-by: Jan Gelety <jgelety@cisco.com>
2017-05-12Fix: SetupFramework sparse file handlingPeter Mikus1-1/+2
- Fix the issue during packing of the framework when source directory contains sparse files. By default tar is throwing warning resulting in return code other then 0. Change-Id: I39a9c1956685158e2e0fd9ef9545f90e3ef2a89f Signed-off-by: Peter Mikus <pmikus@cisco.com>
2016-12-16Pylint fixesTibor Frank1-7/+5
- Fix PyLint errors - Fix comments in touched python modules Change-Id: I26db2d292a41969cf38b9b0bdd49c4fb15349102 Signed-off-by: Tibor Frank <tifrank@cisco.com>
2016-10-14CSIT-351: Testing Ubuntu 16.04.1 changespmikus1-1/+2
- Update the repository to get xenial packages - Update phy topology files with new pass - Update bootstrap to use new VIRL image - Update framework to reflect 16.04 dependencies - CSIT-116: Modify VIRL username/password Change-Id: I4de44755170fd0481acef34c7c2d9c299bc300da Signed-off-by: pmikus <pmikus@cisco.com>
2016-10-04Fix pylint warnings in python librariesselias1-3/+3
- no functional changes - fixes 80+ PEP-8 violations Change-Id: Icf414778ec40d5cb44364fa69a876f9a1870c3c7 Signed-off-by: selias <samelias@cisco.com>
2016-09-25Use tmp directory for log filesJan Gelety1-2/+2
- store log files in tmp directory and exclude all files in this directory from archiving when creating tarballs Change-Id: Ie3e11670c9d466c5fcf41d03ccd0a7bbb04ffeb0 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2016-09-21CSIT-360: Fix: Parallel test sets run.Matej Klotton1-6/+9
- fix typos Change-Id: I5292b27ae584c86cb4986df5439bdebd5fa40b67 Signed-off-by: Matej Klotton <mklotton@cisco.com>
2016-09-20CSIT-360: Parallel test sets runJan Gelety1-1/+11
- use parallel test set runs on as many VIRL sessions as needed for defined test sets Change-Id: I7640f15894a1451aba963989fab4dc838f2ab6d8 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2016-07-28CSIT-212 SetupFramework scp result - logging fixMiroslav Miklus1-9/+17
Change-Id: I23a8090a117acd9cd0bef8bd69689751742d63e9 Signed-off-by: Miroslav Miklus <mmiklus@cisco.com>
2016-06-02CSIT-114: Eliminate repeated download of PIP packagesCarsten Koester1-1/+1
Allow VirtualEnv to use existing system-wide packages if they already exist. Change-Id: I6f39178d56e81affea0bee7b9065bef66712ddaa Signed-off-by: Carsten Koester <ckoester@cisco.com>
2016-04-22Reformat python libraries.Matej Klotton1-19/+20
PEP8 reformat fix typos docstrings reformat Change-Id: Ic48ba4e06490630808b8e2ab1ab0b046ec7eeed7 Signed-off-by: Matej Klotton <mklotton@cisco.com>
2016-04-08Add Vagrantfile for local testing.Stefan Kobza1-12/+53
Vagrantfile contains 3 VMs as of now, 2 DUTs 1 TG, with these notes: - login is csit/csit - by default provision script installs all deb packages from the dir where Vagrantfile is - developed for, and only tested on vbox (someone can pick up vmware) - All nodes have 1 shared mgmt network: 192.168.255.0/24 - hosts have these IP addresses in host-only network TG : 192.168.255.100 DUT1 : 192.168.255.101 DUT2 : 192.168.255.102 - script created to download MAC address information - PCI addresses are always the same for vbox (not sure about vmware) HOWTO (will create a wiki page once one is created for CSIT project): - copy Vagrantfile to separate dir on host - vagrant up --parallel sit-back-and-relax - from VM that has access to the same host-only network (192.168.255.0 above) - copy your ssh-key to csit@192.168.255.{101,102,250} using ssh-copy-id - cd ${csit_dir} - virtualenv & pip as in README - export PYTHONPATH=${csit_dir} - resources/tools/topology/update_topology.py -v -f -o topologies/available/vagrant_pci.yaml \ topologies/available/vagrant.yaml - pybot -L TRACE \ -v TOPOLOGY_PATH:topologies/available/vagrant_pci.yaml -s \ "ipv4" tests - see tests results Change-Id: Ic27626605a9c820bca977b38f4e8ca37d1504ff5 Signed-off-by: Stefan Kobza <skobza@cisco.com>
2016-03-18Remove apt-get call to install dependencies.Carsten Koester1-15/+0
Change-Id: I309a13bc857b89f1f342d659ab80b70d7a5fc686 Signed-off-by: Carsten Koester <ckoester@cisco.com>
2016-02-27Minor change in virtual env creationJan Gelety1-1/+3
- increase timeout for virtualenv creation - confirm successful virtualenv creation Change-Id: Ic973f97e23ccf35c677849f31251637bf8551fef Signed-off-by: Jan Gelety <jgelety@cisco.com>
2016-02-23Automate VIRL simulation life cycle.Stefan Kobza1-0/+14
Change-Id: I126c42b994c1356acc202f4ec1b153c790c43d46 Signed-off-by: Stefan Kobza <skobza@cisco.com>
2016-02-08New version of RF tests.Stefan Kobza1-0/+137
Change-Id: I241a2b7a7706e65f71cfd4a62e2a40f053fc5d07 Signed-off-by: Stefan Kobza <skobza@cisco.com>