summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/sshcontrol.py
Commit message (Collapse)AuthorAgeFilesLines
* sshcontrol.py: Add methods to copy dirs and delete filesMariano Lopez2016-05-111-0/+84
| | | | | | | | | | | | | | | | | This patch add new methods to SSHControl class. These methods include: - Copy a dir to DUT - Delete a file in the DUT - Delete a directory in the DUT (if empty) - Delete a directory structure in the DUT [YOCTO #9565] (From OE-Core rev: f22afb09fefdcb568d79ccd81277a43dacee2a82) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/sshcontrol: don't source profileRoss Burton2015-12-011-2/+1
| | | | | | | | | | | | | | Instead of sourcing /etc/profile to get $PATH including /usr/sbin, just assign to PATH in the ssh invocation. The remote /etc/profile may not actually be manipulating PATH as we expect, and there may be other commands which can interfere with the tests (such as resize emitting a series of control characters on connection). (From OE-Core rev: 0f3fb5bbf2fd7db82898fed3281af143387316ff) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Test failure/cleanup improvementsRichard Purdie2015-09-061-2/+12
| | | | | | | | | | | | | | | | | Currently, if qemu segfaults, the tests merrily continue trying to execute which takes time for them to timeout and is a bit silly. Worse, no logs about the segfault are shown to the user, its silent! This patch tries to unravel the tangled web of issues and ensures that we: * install a SIGCHLD handler which tells the user qemu exited * check if qemu is running, if it isn't fail the test outright * don't leave processes behind in sshcontrol which would hold bitbake.lock and block shutdown (From OE-Core rev: 5c04b1ca1e989f569d5755a646734d01a0c56cae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sshcontrol: Use os.environ.copy() instead of copy.copy()Richard Purdie2015-07-311-2/+1
| | | | | | | | | | | | | | os.environ is special and copy.copy() doesn't do what we'd expect, changes in the child object change the parent. copy.deepcopy() is also known to have issues with it. Use the dedicated .copy() method which will not influence the parent. This fixes selftest failures where the DISPLAY variable disappears. (From OE-Core rev: 638cd44cc9a9eb435350aac7e8eeec585d74f8db) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/sshcontrol: Ensure we don't trigger ssh-askpassRichard Purdie2015-07-251-0/+7
| | | | | | | | | | If DISPLAY is set, ssh-askpass can be triggered which is not what we want in the middle of sanity tests. We can disable this by unsetting DISPLAY. (From OE-Core rev: 085681a1418a29a8331cdde0f477f4e223de84be) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: sshcontrol: realtime logging of outputStefan Stanacar2014-04-291-4/+15
| | | | | | | | | | | | Log the output of the command as it runs not when it finished, else tail -f tmp/work/minnow-poky-linux/core-image-sato/1.0-r0/testimage/ssh_target_log isn't as useful as it could be. (From OE-Core rev: be8f766f43d85c364b9706b464ed0a59d0fbf0b7) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: sshcontrol: rewrite the SSHControl classStefan Stanacar2014-02-021-83/+92
| | | | | | | | | | | | | | | | | | Split the class in two, one to handle the process and the timeout based on output and one for the actual ssh/scp commands. The ssh/scp methods now use the same run method. It does the same thing as before but: - it looks cleaner. - adds support for using a different user than root - optionally, raises an exception when exit code != 0 (that's useful for code outside of tests, where you wouldn't want to check the return code every time as the tests do) (From OE-Core rev: bb14a7598d3c0636dc249f719bde0d9d65b2694d) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa: sshcontrol: Allow alternate port for SSHControlSipke Vriend2014-01-281-1/+3
| | | | | | | | | | Add an optional parameter to SSHControl so the user can specify and alternate port to the default (22). (From OE-Core rev: 091d395e43836575587112ee1696a18c401505bb) Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa: sshcontrol: fix false timeout failuresStefan Stanacar2014-01-221-2/+2
| | | | | | | | | | | | | Ocasionally AB shows odd false fails like: http://autobuilder.yoctoproject.org/main/builders/nightly-arm/builds/1/steps/Running%20Sanity%20Tests/logs/stdio This should fix that by checking for eof instead of polling the return code of the ssh process, because the process might still be there. (From OE-Core rev: 3a22b5df5aa38a98b35bc2931d646a2b7702fbec) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: use the new targetcontrol.py module for running testsStefan Stanacar2013-12-031-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the necessary changes for using the targetcontrol.py module so that one can run the same tests on a qemu instance or a remote machine based on the value of TEST_TARGET variable: "qemu" or "simpleremote". The default value is "qemu" which starts a qemu instance and it's the with what we currently have. With "simpleremote", the remote machine must be up with network and ssh and you need to set TEST_TARGET_IP with the IP address of the remote machine (it can still be a qemu instance that was manually started). Basically testimage.bbclass now does something along the lines of: - load tests -> deploy (prepare) / start target -> run tests. There were a couple of changes necessary for tests and also some cleanups/renames that were needed to adjust this change. (use ip everywhere when refering to target and server_ip when refering to host/build machine) Also two unnecessary and unsed methods were dropped from sshcontrol. [ YOCTO #5554 ] (From OE-Core rev: a7820350fa3271d78ed7476e02f4aef593be1125) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils: sshcontrol: make timeout depend on outputStefan Stanacar2013-11-081-14/+27
| | | | | | | | | | | | | Instead of running the commands with a fixed timeout, we should kill the command if there is no output for timeout seconds. Also changed some strings/comments. (From OE-Core rev: beea86fa9637fd629719980e14beea758847b8f3) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils: sshcontrol: log how long the last command takeStefan Stanacar2013-09-221-3/+6
| | | | | | | | | It might be useful for debugging to have in the ssh log the number of seconds a command has run. (From OE-Core rev: 48b9e45b9716130b015ae2ab7398d6aa243933dc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/sshcontrol: tweak ssh optionsMihai Lindner2013-09-061-11/+12
| | | | | | | | | | | | Add ssh_options to be used, the same, by ssh and scp: Decrease LogLevel to ERROR, to suppress warnings (e.g. ssh host verifications, two warnings in case of having openssh with hpn patches); We no longer presume that the first line is a warning. (From OE-Core rev: 1f18d04eec03e586134b6d77ca1c6151c22353dd) Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/sshcontrol: increase and log timeout in outputStefan Stanacar2013-08-031-4/+6
| | | | | | | | | | | | Increase a bit the timeout for ssh commands and also write in the output that the command timed out (it's easier to see that in a test fail than checking the ssh log) (From OE-Core rev: 652a1762c8adc3b8cb1c6db2ee4a5234a7436c8d) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage.bbclass, lib/oeqa: add headers and commentsStefan Stanacar2013-07-161-0/+9
| | | | | | | | | | | Adds some comments to testimage.bbclass and the files it calls, just to give an ideea of what it does. (From OE-Core rev: 8bbb7116cf02466dfc59a17dc7bb51287aeea55b) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils/sshcontrol.py: fix passing command to subprocessStefan Stanacar2013-07-161-23/+17
| | | | | | | | | | | | | | | Don't use shlex.split in subprocess call and also prepend . /etc/profile, because PATH over ssh is always /usr/bin:/bin which isn't what many tests expect. Changed in v2: We now need to use a separate call for scp command. (From OE-Core rev: 1988de2fad86e8e34070ed6573a7be09fff5c0a2) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils/sshcontrol.py: helper module for running remote commandsStefan Stanacar2013-07-091-0/+100
Provides a class for setting up ssh connections, running commands and copying files to/from a target. (From OE-Core rev: 683cac9768e0d38fa15ddc5451e6b2333f184033) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>