summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* qemurunner.py: Added raw mode in run_serialMariano Lopez2015-08-161-13/+18
| | | | | | | | | | | | | | | | | | Raw mode allows to send the command without sending 'echo $?' for validation; Also this doesn't remove the command or the prompt from the output returned. In raw mode validation is done if there is output. This raw mode would be useful for validate the prompt when a user logs in. [YOCTO #8118] (From OE-Core rev: b8ead7c0929c4096e50b481a608f5d0c09eab29d) 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>
* qemurunner.py: Added login to start methodMariano Lopez2015-08-161-0/+11
| | | | | | | | | | | | | | | This adds the automatic login after the target finished booting. If the automatic login fails it won't stop the target or any test, it would only send a log to the file. [YOCTO #8118] (From OE-Core rev: cc2b1c28801399c6b525248fa0dabf7c42afc714) 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>
* qemurunner.py: Add method run_serialMariano Lopez2015-08-161-0/+30
| | | | | | | | | | | | | | | | | | | | The only need for the console before this patch was to check if the target has booted. This allows to send commands to the terminal. This new method is based on the method with the same name of the QemuTinyRunner class. The difference here is it will remove the command and the prompt. The other diference is it will send an echo $? to check if the last command was successful. [YOCTO #8118] (From OE-Core rev: a82711fe4520538a732a16795d50573b6f1d4463) 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/qemurunner: Improve runqemu log output debugRichard Purdie2015-08-091-5/+10
| | | | | | | | | | | If runqemu fails, ensure the log output is shown as its invaluable to aid debugging. Its slightly convoluted since we need to ensure we don't block on reading the pipe which may still be executing hence the need for nonblocking IO. (From OE-Core rev: 0e0fa1461863ec586b4f028dfd7d641f091ea928) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Improves checking for server and target IPs on qemus parametersAlejandro Hernandez2015-08-091-5/+8
| | | | | | | | | Fixes OS hanging infinitely waiting for qemus process to release bitbake.lock (From OE-Core rev: d168bf34c553dbe5de7511e158cd83869d7a88bc) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/commands: Increase qemu boot timeout to match testimage.bbclassRichard Purdie2015-08-011-1/+1
| | | | | | | | | This matches the value in testimage.bbclass, which makes sense since the autobuilders are usually contended. (From OE-Core rev: dd5c87900b73bf44cf96735706d7d06e56b4d20e) 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/qemurunner: Fix AttributeError: QemuRunner instance has no attribute ↵Richard Purdie2015-07-271-1/+1
| | | | | | | | | | | | | 'server_socket' If start() returns False due to create_socker() failing, stop() may still get called and currently this gives a track back since server_socket doesn't exist. Avoid this. (From OE-Core rev: 26fb69ec663afd05134822dc5e48fc8928ea5bf1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Show last 25 line of log, not 5Richard Purdie2015-07-271-2/+2
| | | | | | | | | For debugging purposes, 5 lines often isn't useful as it doesn't even cover a full backtrace. Show 25 instead. (From OE-Core rev: 5b3ff562b2c56df301fc402c8b84420d8d4e5705) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/imagefeatures: Use QemuTarget codeRichard Purdie2015-07-271-0/+49
| | | | | | | | | | | | | | | | | | | | | Create a runqemu function which uses the QemuTarget() code from oeqa.targetcontrol to setup the QEMU instance, with all of the added robustness that that gives us. To do this, a datastore is needed for the recipe in question (core-image-minimal) so we do the work needed to set this up. We then use this runqemu function within the imagefeatures tests instead of a hand-rolled implementation. We can then use SSHControl to run the SSH tests rather than rolling our own code to do that as an added bonus. Fixed and extended by Paul Eggleton <paul.eggleton@linux.intel.com>. Part of the fix for [YOCTO #7994]. (From OE-Core rev: 7d18d1169204ee80f1c00b35998f10fffaefa107) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: fix error handling if runqemu exits with an errorPaul Eggleton2015-07-271-1/+14
| | | | | | | | | | | | * Don't wait for QEMU to start if it's never going to (because runqemu exited with an error) * Don't error out if killing the process fails with "no such process" (we don't care if it's already dead) (From OE-Core rev: 1789b89de6c4642464abadd9f8a4746385e6b4a7) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: avoid blocking on stty when running under oe-selftestPaul Eggleton2015-07-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | runqemu-internal runs stty to return the terminal to its previous state in case QEMU hasn't done that properly (which it at least used to do when it crashed). For some reason I have yet to determine, stty blocks (on tcsetattr() according to gdb) when run within QemuRunner() under oe-selftest, with the result that we always wait until the timeout and then we kill the script, which adds an extra delay after QEMU is stopped. Naturally you would assume that this is something to do with the nature of the terminal under which it is being run; however no amount of playing around with stdin/stdout/stderr seemed to fix the issue, apart from passing in subprocess.PIPE as stdin which makes stty error out with "stty: standard input: Inappropriate ioctl for device". I was also unable to come up with a reliable test for the terminal which we could use inside runqemu-internal to avoid calling stty. For now, go with the stdin=subprocess.PIPE workaround to at least avoid the delay with minimal ill effect. (From OE-Core rev: a058d07cd7251749fa9c1c8eca3caa80144664fe) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: fix loggingPaul Eggleton2015-07-271-25/+24
| | | | | | | | | | | | | | | | | | | | | | | | OE-Core commit 519e381278d40bdac79add340e4c0460a9f97e17 unfortunately broke logging in two different ways: 1) it prevented logging to the task log from working within bitbake -c testimage. This is due to the logger object being set up too early which interferes with BitBake's own logging. If we prefix the name with "BitBake." everything works (and we don't need to set the logging level). 2) Additionally because it called the log functions on the logging module and not the logger object it set up, this caused the oe-selftest logging to start printing everything from that point forward. Fix these two issues and return us to the desired behaviour for do_testimage. (From OE-Core rev: 429b1971be06d5146bb1c14f4697966cddab3b33) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: don't assume hostname starts with qemuRoss Burton2015-07-251-1/+1
| | | | | | | | | | It's possible to customise the hostname trivially so don't assume that the hostname hasn't been configured. (From OE-Core rev: faf85728ed9a5a3af336f243f6f3567c773159cf) Signed-off-by: Ross Burton <ross.burton@intel.com> 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/QemuRunner: don't use bb for loggingRoss Burton2015-07-231-29/+32
| | | | | | | | | | | | | Instead of using bb.note() etc for logging use logging.Logger directly, allowing the use of QemuRunner outside of bitbake. Also clean up the logging/errors by moving create_socket() out of __init__()/restart() and into start(). (From OE-Core rev: 519e381278d40bdac79add340e4c0460a9f97e17) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils/commands: ensure get_bb_var() works when value contains =Paul Eggleton2015-06-181-1/+1
| | | | | | | | | | Only split on the first equals character so that values that contain equals characters (such as FAKEROOTENV) can be retrieved. (From OE-Core rev: ff720dd3b77130b2c485d7acad63735fd8751a7d) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: Added timeout decorator for testcases.Lucian Musat2015-06-111-0/+26
| | | | | | | | (From OE-Core rev: c6fe26ade5734efb5250e00c56fdbb4095b0018b) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: add appendfile subcommandPaul Eggleton2015-05-201-0/+11
| | | | | | | | | | | | | | | | | | | | | | Locating which recipe provides a file in an image that you want to modify and then figuring out how to bbappend the recipe in order to replace it can be a tedious process. Thus, add a new appendfile subcommand to recipetool, providing the ability to create a bbappend file to add/replace any file in the target system. Without the -r option, it will search for the recipe packaging the specified file (using pkgdata from previously built recipes). The bbappend will be created at the appropriate path within the specified layer directory (which may or may not be in your bblayers.conf) or if one already exists it will be updated appropriately. Fairly extensive oe-selftest tests are also provided. Implements [YOCTO #6447]. (From OE-Core rev: dd2aa93b3c13d2c6464ef0fda59620c7dba450bb) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: Fixed a problem with get_bb_var not returning right variable.Lucian Musat2015-05-141-2/+3
| | | | | | | | | | It searches using regex now and should be more accurate. (From OE-Core rev: 1ae7e1cc4a5c7a217dee937c330539e5c8ac794d) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: Allow ~ in bblayersEd Bartosh2015-05-031-0/+2
| | | | | | | | | | Bitbake can parse ~ in bblayer's paths. Added this functionality to oeqa code. (From OE-Core rev: b4dc5b271247a1894d66908c5f20973be2a60d43) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetbuild: Use DL_DIR for downloads if presentRichard Purdie2015-04-291-0/+5
| | | | | | | | | This isn't a test of wget so if the files we need are present in DL_DIR, use them from there and save a bit of speed/bandwidth and skip the wget. (From OE-Core rev: dc1d83d021afd77ca8fb948dc47bbd11e3844865) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/decorators: Fix up frame selectionNathan Rossi2015-04-211-1/+3
| | | | | | | | | | | | | Use threading to get the current threads ident to select the current executing frame to ensure that the scanned stack is the expected stack. This allows for the decorators to be used within a process that has multiple threads executing. (From OE-Core rev: a44d27b92baba4ab51f432ec01cdc473436ce406) Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: Add runner for poky-tiny qemu.Lucian Musat2015-04-101-0/+170
| | | | | | | | | The connection and commands are done via serial. (From OE-Core rev: bc6ac3058d7adb6f1bf87e57deaa50347f452e59) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: sort modules based on dependenciesPatrick Ohly2015-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | TEST_SUITES="auto" is useful to run all suitable tests without having to hard-code the list. However, it did not take test dependencies into account, which can be an issue for tests which really depend on some other test to run first. To fix this, modules get loaded in the order determined by TESTS_SUITES, but then get re-ordered based on dependencies derived from @skipUnlessPassed before running them. The original order is used to break ties when there are no dependencies, so reordering only occurs when really necessary. @skipUnlessPassed gets extended such that it makes the test name a method depends on available for inspection by the test loader in oetest.py. Unfortunately Python's unittest offers no API to inspect tests in a TestSuite, so the code has to rely on implementation details to find all tests. The worst that can happen when the implementation changes is that tests are not found and reordering does not happen. (From OE-Core rev: 6e4543a35836c572b23b9f8162b19d1e038d3ed2) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: support getting unexported variable valuesPaul Eggleton2015-03-201-0/+7
| | | | | | | | | | | Allow get_bb_var() to work with unexported variable values such as MACHINE - the workaround is a little crude but should suffice for now. (From OE-Core rev: 48b58466bba084fd3439706d47e0cfbb7e951ee4) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/decorators: Try and improve ugly _ErrorHandler tracebacksRichard Purdie2015-01-231-8/+15
| | | | | | | | | | | | | | | | Currently, if one module is skipped, any other module calling skipModule causes tracebacks about _ErrorHandler not having a _testMethodName method. This reworks the code in a way to avoid some of the problems by using the id() method of the objects. It also maps to the correct name format rather than "setupModule" or just skiping the item entirely. (From OE-Core rev: 78d3bf2e4c88779df32b9dfbe8362dc24e9ad080) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: fix testcase decorator to allow calling tests individuallyPaul Eggleton2014-12-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this, running tests individually failed with a traceback: $ oe-selftest --run-test buildoptions.ImageOptionsTests.test_incremental_image_generation 2014-12-23 14:40:37,636 - selftest - INFO - Checking that everything is in order before running the tests 2014-12-23 14:40:38,408 - selftest - INFO - Running bitbake -p 2014-12-23 14:40:40,235 - selftest - INFO - Loading tests from: oeqa.selftest.buildoptions.ImageOptionsTests.test_incremental_image_generation Traceback (most recent call last): File "/home/user/poky/scripts/oe-selftest", line 179, in <module> ret = main() File "/home/user/poky/scripts/oe-selftest", line 164, in main suite.addTests(loader.loadTestsFromName(test)) File "/usr/lib64/python2.7/unittest/loader.py", line 91, in loadTestsFromName module = __import__('.'.join(parts_copy)) File "/home/user/poky/meta/lib/oeqa/selftest/buildoptions.py", line 12, in <module> class ImageOptionsTests(oeSelfTest): File "/home/user/poky/meta/lib/oeqa/selftest/buildoptions.py", line 14, in ImageOptionsTests @testcase(761) NameError: global name 'func' is not defined (From OE-Core rev: 8e3fbb0bb2c0eabfb39752c25e7c3f5d77881f64) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: replace some tabs with spacesPaul Eggleton2014-12-252-47/+47
| | | | | | | | | Python code should use spaces only for indentation. (From OE-Core rev: a1e22121e521aabf454a850cd7c8be60b7b1adc3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: make get_bb_var() more reliablePaul Eggleton2014-12-231-2/+2
| | | | | | | | | | * Enable querying exported variables * Use strip() to remove quotes so any internal quotes are not disturbed (From OE-Core rev: 418cdf1ca37e06165ebaec86a0098d4750208539) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: Added filter to LogResults decorator to enforce custom log level.Lucian Musat2014-09-291-0/+6
| | | | | | | | (From OE-Core rev: 65c97d4abd26f38917cd89b5f50f7299221b2123) Signed-off-by: Lucian Musat <georgex.l.musat@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/logparser.py: results based log parser utilityLucian Musat2014-09-101-0/+125
| | | | | | | | | | | | | A module for parsing results based logs like ptest, compliance and performance. Supports breaking the logs into multiple sections and also provides a result object to use the parser with. The parser is initialized with the regex required to identify results and section statements in the target log file. (From OE-Core rev: 72308d030fc98982e88b121b052cd2438f6b031c) Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Lucian Musat <georgex.l.musat@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/httpserver: Reset SIGTERM handlerRichard Purdie2014-08-231-0/+2
| | | | | | | | | | With bitbake-worker installing a SIGTERM handler, we now need to reset the one here to ensure that when this process shuts down, it doesn't take the rest of the task with it. This does appear to be the only place in OE that we have this problem. (From OE-Core rev: e1ac67d6470dde70239ca0430b18ca0bffbc0295) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/targetbuild.py: add support for sdk testsCorneliu Stoicescu2014-08-181-15/+79
| | | | | | | | | | | | | | - Create new abstract class BuildProject that provides basic functionality for a project/package building class * contains abstract method _run() that needs to be implemented by all extending classes. - The old TargetBuildProject class now extends the abstract BuildProjct class - Introducing new SDKBuildProject that extends the abstract BuildProjct class NOTE: Original patch made by: Richard Purdie <richard.purdie@linuxfoundation.org> (From OE-Core rev: bc8824fd361dbff96f5b5316ddfda36e96e8ea9b) Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/decorators.py: add import osCorneliu Stoicescu2014-08-021-0/+1
| | | | | | | | | | An 'import os' was omitted here while testing the previous decorators using runtime tests that import the os module before this one. Unfortunately oe-selftest fails because of this missing import. (From OE-Core rev: 5381e6cf6bf7143074800b2949bfa5331fdb6d47) Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Refactor test skipping decorators to use the unittest result objectLucian Musat2014-07-251-6/+34
| | | | | | | | | | | | In order to make the test skipping decorators independent of the oeTest object we rely on the unittest result object to construct skip, fail and error lists used by these decorators. Created a new object getResults that analyses upper frames and retrieves the unittest result object instance, then return a list of failed, skipped and error tests. Also removed the oetest import from decorators.py because it was no longer required. (From OE-Core rev: 4d2d201158236bd4c72546cf8db88681ff921b11) Signed-off-by: Lucian Musat <georgex.l.musat@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Added testcase decorator to use in logging. Added class decorator LogResults ↵Lucian Musat2014-07-031-0/+66
| | | | | | | | | that outputs test results in separate log file. (From OE-Core rev: 7e2b73f1ccfe2968ef780fef2edfaa31c3dae853) Signed-off-by: Lucian Musat <georgex.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/commands.py: add support for postconfig optionCorneliu Stoicescu2014-06-101-9/+22
| | | | | | | | | | | | | | | | | | Adding support for postconfig option to the bitbake() and related methods. This enables us to use 'bitbake -R postconfig_file <command>'. Usage: bitbake(cmd, postconfig="some confguration") 'postconfig_file' would contain what we add in 'postconfig' Other methods affected: get_bb_env(), get_bb_var() (From OE-Core rev: 4fe771940a8f59a0d5f1541978d6d9ff73b222f4) Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: add proper handling for command errors where neededPaul Eggleton2014-04-302-3/+19
| | | | | | | | | | | | For use outside of tests themselves, we want a better error than AssertionError, so create one and allow us to request it when calling runCmd(). This enables us to avoid tracebacks during master image operations if the power control command fails. (From OE-Core rev: 89868383685091b0d3723fb8f29590f3f6610078) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> 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/qemurunner: search for login string in the entire boot logStefan Stanacar2014-03-111-2/+1
| | | | | | | | | | | | If some service is to spammy we might miss the login, so search in the entire log instead of just the last few lines. Use qemu in regex too (to avoid a login string from some service). (From OE-Core rev: 1117d25fdfabbf1afdc7030e05efc6a32df871e3) 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/qemurunner: use the right kill call so we don't send SIGTERM to ↵Stefan Stanacar2014-03-111-2/+2
| | | | | | | | | | | | | | | | | bitbake-worker After recent bitbake-worker changes [1] this was killing the bitbake-worker, which isn't what we want and kill(-pid) was the wrong call anyway. runqemu.pid is the right PGID as the process was started with preexec_fn=setpgrp (so no need to do os.getpgid(self.runqemu.pid)) [1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=15688798520896690561824b2fdc227c8a365c82 (From OE-Core rev: f4bf21b40ec6fa07c4a7bb450e3cfae12128dc2c) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: targetbuild: take proxy into accountStefan Stanacar2014-02-111-2/+18
| | | | | | | | | | A previous commit broke downloads when proxies are involved, let's fix it. (From OE-Core rev: 97e263b99cbe8184a74f80738fd471cfdef29e0c) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils: targetbuild: don't use bb.fetch anymoreStefan Stanacar2014-02-091-19/+8
| | | | | | | | | | | | | When running tests outside of the build system we can't use bb.fetch anymore. It was nice but tests and their modules need to rely on the data storage only as that gets exported. This module is used by the oeqa/runtime/build* tests. (From OE-Core rev: 3caf8e244ea94f62a93f3b40e73e15ea78fc2880) 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>
* lib/oeqa: allow a layer to provide it's own TEST_TARGET classStefan Stanacar2014-01-191-0/+3
| | | | | | | | | | | | Allows a layer to define new classes in <layer>/lib/oeqa/utils/controllers.py and completely control or extend deployment of a target. (core currently has QemuTarget and SimpleRemoteTarget). The value of TEST_TARGET must be the name of the new class. (From OE-Core rev: 9b81aff0aca42353d448b1e9522f89842e23c7b2) 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-032-33/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* scripts/oe-selftest: script to run builds as unittest against bitbake or ↵Stefan Stanacar2013-12-032-0/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | various scripts The purpose of oe-selftest is to run unittest modules added from meta/lib/oeqa/selftest, which are tests against bitbake tools. Right now the script it's useful for simple tests like: - "bitbake --someoption, change some metadata, bitbake X, check something" type scenarios (PR service, error output, etc) - or "bitbake-layers <...>" type scripts and yocto-bsp tools. This commit also adds some helper modules that the tests will use and a base class. Also, most of the tests will have a dependency on a meta-selftest layer which contains specially modified recipes/bbappends/include files for the purpose of the tests. The tests themselves will usually write to ".inc" files from the layer or in conf/selftest.inc (which is added as an include in local.conf at the start and removed at the end) It's a simple matter or sourcing the enviroment, adding the meta-selftest layer to bblayers.conf and running: oe-selftest to get some results. It would finish faster if at least a core-image-minimal was built before. [ YOCTO #4740 ] (From OE-Core rev: 41a4f8fb005328d3a631a9036ceb6dcf75754410) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>