aboutsummaryrefslogtreecommitdiff
path: root/lava_dispatcher
AgeCommit message (Collapse)Author
2018-10-01Add overrides for bandit false positivesNeil Williams
Reduce the noise in the SAST report further. Override bandit warnings in lava-dispatcher as bandit is overly based on a web UI mindset. Add overrides and fixes for files in ./share/ Signed-off-by: Neil Williams <neil.williams@linaro.org>
2018-10-01Ignore new PEP8 warning W504Neil Williams
Update for some occurrences of W604 but exclude files where this is unrealistic. Ignore W504 as this currently conflicts with black. Signed-off-by: Neil Williams <neil.williams@linaro.org>
2018-10-01Apply yaml.safe_load to unit testsNeil Williams
Ensure unit tests are testing the same behaviour as the rest of the source code and also reduce the amount of noise in the SAST report so that genuine issues are easier to find. Signed-off-by: Neil Williams <neil.williams@linaro.org>
2018-09-28Explicitly set autoescape to False for YAML.Neil Williams
Jinja2 autoescape defaults to False but this default is likely to change. Autoescape behaviour is predicated on HTML for XSS vulnerabilities, so would be set by Django in handling the UI templates. HTML (escaped or not) would be either invalid YAML or ignored comments. Autoescape also has a performance penalty when enabled, so set to False now to protect against the future change in the default in jinja2. Signed-off-by: Neil Williams <neil.williams@linaro.org>
2018-09-18Fix copy/paste error in 65ba876cb5Neil Williams
Let LXC protocol calls use lists as in base contained an error as self relates to a Protocol object, not an Action. Signed-off-by: Neil Williams <neil.williams@linaro.org>
2018-09-18Use generator expressions when availableRémi Duraffort
When iterating over, using generator expression will use less memory than list comprehension.
2018-09-18Support LXC with IoTNeil Williams
Ensure the connection is picked up from the correct namespace when setting the shared namespace data. Closes: #82 Signed-off-by: Neil Williams <neil.williams@linaro.org>
2018-09-18Allow LXC for FRDM-K64F IoT deviceNeil Williams
Provide support for admin operations in an LXC to fix problems when running a lot of IoT jobs. Signed-off-by: Neil Williams <neil.williams@linaro.org>
2018-09-17Remove python2 leftoverRémi Duraffort
In python3, all classes are inheriting from object by default.
2018-09-17Let LXC protocol calls use lists as in baseNeil Williams
pre-power and pre-os commands can be lists, allow the LXC protocols to use the commands as lists. Signed-off-by: Neil Williams <neil.williams@linaro.org>
2018-09-11Fix pep8 error in test file.Neil Williams
Signed-off-by: Neil Williams <neil.williams@linaro.org>
2018-09-11Check for download files ending with /Neil Williams
It isn't possible to download a directory as part of a LAVA URL. Fail in validate() instead of waiting for a later failure. Signed-off-by: Neil Williams <neil.williams@linaro.org>
2018-09-07Fix vland interface code so it works with python3 tooSteve McIntyre
Needed to add encode/decode logic due to underlying string type change to unicode. Would still also work with python2, if that mattered. Change-Id: If0b4852f05ddb6617a95726ee0d0f3e5b0685c9c
2018-09-03sample_jobs: fix bbb-initrd-nbd NBD usageCorentin LABBE
The sample job could not work without the "port: auto" in NBD protocol. While this sample job cannot work due to bad http link, at least made it a good NBD job example. Change-Id: I52273d6336a9ab5a4259106d896cd0f134161e80
2018-08-03run_command: print the output when failingRémi Duraffort
The message was including the wrong variable. Change-Id: I163bc30a6d6dce5dc3daf639b81077079cc04606
2018-08-02LAVA-1014 add a prefix to tmp directoriesRémi Duraffort
Allow admins to add a prefix to the tmp directory names. Instead of using directly the job_id, allows to use <prefix><job_id> This will allow admins to run many slaves on the same physical machine. Each slave serving a different master (and a different lava instance). Change-Id: I0d333de81cf59dc245fda3db34fff81864e3e19c
2018-08-01LAVA-1156 When running under pytest, fake requestsRémi Duraffort
The lava_dispatcher test suite is now faster and resilient to network errors. Some tests (listed in conftest.py) that do require network access can still use the network. Change-Id: I4df941df68df3ac3dd2a8baf617e2dd68cc2ed80
2018-07-31Portablility support without using 'os'Neil Williams
Add a note to the docs that the posix constants can only be overridden if 'os' is not specified. Add a unit test for the same. Change-Id: I8847a35ffe759e27cbcf276698cc97ef8cbddc49
2018-07-31Revert "pyocd: Run connect action before flashing"Neil Williams
This reverts commit 4efd8586a5e8a103f76e9b56abc3a6b9b8a49090. Change-Id: Ia8945a1250a133434e515dcb7059193ff924f512
2018-07-31pyocd: Run connect action before flashingLoic Poulain
The DUT runs new firmware once flashing via pyocd is completed. This can be very quick and booting potentially happens before we even run the connect action. This can cause job failure because dispatcher misses the booting string (e.g. "BOOTING ZEPHYR OS"). This patch fixes this by moving connect action before flashing. This has been tested with a 96Boards nitrogen + zephyr firmware. Update pyocd pipeline refs accordingly. Change-Id: Icdd48d0913294d2d22f5a7f96fd7a9bb27caebe7
2018-07-27LAVA-1295 iMX8M evk device integration.Neil Williams
The iMX8M evk is NXPs new aarch 64 SoC which supports 4k, HDR10 and is supported under the NXP 10 and 15-year Longevity Program. Ensure that the hard_reset command also resets the USB C connection using the Cambrionix hub. Add support for fastboot deployment without changing the bootloader. Add support for TFTP deployment using U-Boot. Change-Id: I3c28c02a69e91f0f8812cd0f5cb416524c6da047
2018-07-26LAVA-1380 Drop 'os' from functional test jobsNeil Williams
Fix check for 'os:' in LXC deploy. Change-Id: I7df7abebaff602b5043742713ecd0b1d2f849d5a
2018-07-25docker: allow to bind devicesRémi Duraffort
We can for instance bind /dev/kvm and use kvm inside docker. Change-Id: I1f04ff81cb1952926a9cc56c9158714961ab1ad5
2018-07-24Revert "Raise a JobError when a cmd output is empty"Neil Williams
Merge in haste, revert at leisure. This reverts commit 953df9325ae9e8783a141aa7f87686019ef4b938. Change-Id: I934539b3c325878c76f2db99df398136794e7967
2018-07-24Raise a JobError when a cmd output is emptyRémi Duraffort
Change-Id: I1a579ea602c394b0da5489f68b238d5e0984b33d
2018-07-24Check downloaded file size against expectedMatt Hart
If the data stream closes during a download, don't just assume the download is finised. If we have an expected size for calculating the progress, use that to check the file has fully downloaded. Change-Id: I7d6790d867151c991286f46deb0ce320bbe39a37
2018-07-24Use OSError when applicableRémi Duraffort
Since python 3.3, IOError, socket.error has been replaced by OSError. See https://docs.python.org/3/library/exceptions.html#OSError Change-Id: I7318cadf729f9072f80b9537a27eec6da057d993
2018-07-20Output a validation error for missing commands:Neil Williams
If a misconfigured device lacks any commands: then connection.serial needs to report a validate() error instead of the current traceback. Change-Id: I6e3769189bc3388e6efd693356ec3b3cdcf2b6e2
2018-07-19Skip deployment_data test if simg2img not installedNeil Williams
Change-Id: I3845e9587b2a3df003ad6cee102c4c1dca20715c
2018-07-18Rationalise deployment_data for Python3Neil Williams
Various corner cases of the pretend dict deployment_data_dict cause issues and failures. Simplify back to a simple dict and fix the default value of the (little used) os-specific install deps. Change-Id: Ibb121b5d4040bb356729adfbbb8828dea24c7793
2018-07-17Remove lxc_cmd_prefix from Action classRémi Duraffort
Make this an helper function, called when needed as this is only used by Android jobs. Change-Id: I10584f5f37d4edee5b6a8354bbcd5f393d3b4410
2018-07-16Make handle_testcase localNeil Williams
Function only used in one file, move to that file and drop the import. Change-Id: Ib91038c972f0cb07f60a3a6f6c7c70ec417b5ef3
2018-07-16Fix bzr testsRémi Duraffort
When most env variables are unset, bzr can't determine the current commiter, so this should be set manually. Change-Id: Ie2efbf0976af540ebd70150e3a0b791126357b4f
2018-07-16Allow for 'os' to be optional in deploy actionsNeil Williams
Document that 'os' is approximate when it is used. Document when it is still required. Document that other uses are deprecated. Allow the overlay to pick up common POSIX constants. Change-Id: I1f7c8f27615cd33a8d2b505a3f0563373f8111f4
2018-07-13Port 41747ab2 to android lava-test-runnerRémi Duraffort
Change-Id: Idd4d55a81df7a0fd332fdc0d06e23922362370bc
2018-07-11LAVA-1338 Handle STARTTC, ENDTC and TESTCASERémi Duraffort
Send to lava-logs a specific message to mark the start and end of the test case --shell or the creation of a result directly using --result or via patterns. Store the corresponding log line in the TestCase. Add documentation on the limitations of this support. Change-Id: I63c1efd9c23cd8b718b8b235fe19f39a214020be
2018-07-11By default, dict.get() default value is NoneRémi Duraffort
Change-Id: I9d61efc457fb5e49ac1b3ad56acaa1b453b9cc4a
2018-07-10LAVA-960 - remove device-type from device configNeil Williams
device-type is solely for the scheduler to use, based on the test job submission. The template to use is determined solely by the {% extends %} Change-Id: I6325d86e07694b8729a48ed8f47fdb874781ae5f
2018-07-10Some pylint fixesNeil Williams
Change-Id: Ic5c1b533c3479b4fdb8cbfe56d051022d1efa779
2018-07-05Raise JobError if commands do not existNeil Williams
If a test job requires a pre os command or pre power command but none is defined for the device, raise a JobError. Change-Id: I680a0b5462610a6eb9bf13f66330a14d964692b0
2018-07-03Dont send an os.linesep when interrupting grubMatt Hart
- fixed the logic in get_device_constant() which didnt handle a constant being set to False Change-Id: I0f34a437e29073c544cf99659ef5fc8c75985b4e
2018-06-29LAVA-939 Integrate cc3220SF boardRémi Duraffort
Add a new GDB boot method for this device. Change-Id: I3283950494c540debc14959233b7d42a7fbd1299
2018-06-27adb: add missing parameter to super().runRémi Duraffort
Change-Id: I4b4eefad471e4a268f3ec6a63b34294325755795
2018-06-27reduce is part of functools in python3Rémi Duraffort
Change-Id: I65533b7a7cb43cb2b8388258abba32cc860755ab
2018-06-27Move debian_package_(version|arch) to lava_commonRémi Duraffort
Change-Id: I41e4ab0f14cae64cc19eccee900a48bb624889bc
2018-06-27Fix undefined variablesRémi Duraffort
Change-Id: Idb03006480388cab7500a6bfb74a97952bc59598
2018-06-27Remove duplicated or unused importsRémi Duraffort
Change-Id: I4b3d8df3ab04af5bc3f5aa4a672022d03e665275
2018-06-26Add missing super().run callRémi Duraffort
Change-Id: I69dff99e4daea85693fde4786a1fd6e7fbdc8ffc
2018-06-26Extend test_recovery to check the -bl templateNeil Williams
Change-Id: I4adbbf6c19ba576235f00f7b06fc6b52d76e0261
2018-06-26Silence known pytest warningsNeil Williams
Some warnings may be missed with the --disable-warnings option. Change-Id: Ic7daab91b6cdb76a42f81368060b4db3b1ee1ebb