summaryrefslogtreecommitdiffstats
path: root/meta/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* oeqa/selftest: Standardize json logging output directoryYeoh Ee Peng2018-12-161-1/+1
| | | | | | | | | | | | Currently sdk & sdkext will output json file to LOG_DIR, while selftest will output json file to TOPDIR/log. Standardize selftest json output file to LOG_DIR. (From OE-Core rev: 9f2e39684cbbe9f87eeef6a81961e6db783439e3) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: Improvements to the json loggingRichard Purdie2018-12-161-14/+11
| | | | | | | | | | | | | | | Tweak the preceeding commit to: * Add STARTTIME to the identifier to make it unique * Use LOG_DIR * Store the layer config in a more natural json format * Drop '_' function prefixes (From OE-Core rev: 173f59acf9722e2ef27fdd49c20f7d3d664917eb) (From OE-Core rev: 3b69099edc7db99c11bfb41eab2af50bd0e3d4f2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/context: write testresult to json filesYeoh Ee Peng2018-12-161-1/+29
| | | | | | | | | | | | | | | | | | | | As part of the solution to replace Testopia to store testresult, OEQA selftest need to output testresult into json files, where these json testresult files will be stored into git repository by the future test-case-management tools. By default, json testresult file will be written to "oeqa" directory under the oe-selftest log directory. To configure multiple instances of bitbake to write json testresult to a single testresult file at custom directory, user will define the variable "OEQA_JSON_RESULT_DIR" with the custom directory for json testresult. (From OE-Core rev: a95218525a4c8228fff9908ffbda85c6b85e101c) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runner: Sort the test result output by result classRichard Purdie2018-12-161-2/+14
| | | | | | | | | | | We want to see failures/errors listed last since this is the most easily visible part of the log on consoles or autobuilder output and makes human processing easier rather than having to scroll up and scan for a single failure. (From OE-Core rev: 2cc07ab253f1ba6a1f07a66051c9ba6d98cd2357) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runner: Always show a summary of success/fail/error/skip countsRichard Purdie2018-12-161-3/+1
| | | | | | | | | Its useful to have the counts of success/failure/error/skipped at the end of the results to allow for easier human reading of what happened. (From OE-Core rev: 5942318a261ce7a885f351e214669068ff9d8931) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime/ptest: Inject results+logs into stored json results fileRichard Purdie2018-12-162-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the ptest results from ptest-runner, run in an image to be transferred over to the resulting json results output. Each test is given a pass/skip/fail so individual results can be monitored and the raw log output from the ptest-runner is also dumped into the results json file as this means after the fact debugging becomes much easier. Currently the log output is not split up per test but that would make a good future enhancement. I attempted to implement this as python subTests however it failed as the output was too confusing, subTests don't support any kind of log output handling, subTest successes aren't logged and it was making things far more complex than they needed to be. We mark ptest-runner as "EXPECTEDFAILURE" since its unlikely every ptest will pass currently and we don't want that to fail the whole image test run. Its assumed there would be later analysis of the json output to determine regressions. We do have to change the test runner code so that 'unexpectedsuccess' is not a failure. Also, the test names are manipuated to remove spaces and brackets with "_" used as a replacement and any duplicate occurrences truncated. (From OE-Core rev: a13e088942e2a3c3521e98954a394e61a15234e8) (From OE-Core rev: 526ceab9d0e43f73635bb92e8dd7763ef75ad33b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/runner: write testresult to json filesYeoh Ee Peng2018-12-161-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the solution to replace Testopia to store testresult, OEQA need to output testresult into single json file, where json testresult file will be stored in git repository by the future test-case-management tools. The json testresult file will store more than one set of results, where each set of results was uniquely identified by the result_id. The result_id would be like "runtime-qemux86-core-image-sato", where it was a runtime test with target machine equal to qemux86 and running on core-image-sato image. The json testresult file will only store the latest test content for a given result_id. The json testresult file contains the configuration (eg. COMMIT, BRANCH, MACHINE, IMAGE), result (eg. PASSED, FAILED, ERROR), test log, and result_id. Based on the destination json testresult file directory provided, it could have multiple instances of bitbake trying to write json testresult to a single testresult file, using locking a lockfile alongside the results file directory to prevent races. Also the library class inside this patch will be reused by the future test-case-management tools to write json testresult for manual test case executed. (From OE-Core rev: 00e03b5004f1eb6d59295544b3a8620504278f51) (From OE-Core rev: 045511425577ccbe89d8eb91e2a87e385390cabf) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/runner: refactor for OEQA to write json testresultYeoh Ee Peng2018-12-161-41/+29
| | | | | | | | | | | | | | | | Refactor the original _getDetailsNotPassed method to return testresult details (test status and log), which will be reused by future OEQA code to write json testresult. Take the opportunity to consolidate and simplify the logic used to gather test status and log within the TestResult instance. (From OE-Core rev: 79ee7d1c371a86edeb61c99679985118da657e5d) (From OE-Core rev: bc444181f9658423856621b2f2c60364642ae5b1) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Remove xmlrunnerRichard Purdie2018-12-161-45/+9
| | | | | | | | | | | | This isn't present on modern distros by default and doesn't work with testtools, needing multiple code paths in the code. Remove it in favour of finding a better replacement for results collection/analysis. (From OE-Core rev: 8001d933a8dc86004db014777f094d718086687d) (From OE-Core rev: 02449e89d62a7714d30ab6e2e58c476dc9441f7a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runner: Simplify codeRichard Purdie2018-12-164-16/+8
| | | | | | | | | | | There doesn't appear to be any reason we need this _results indirection any more so remove it. (From OE-Core rev: b618261811c48ff3b98eab1b340a8cd09ef183c6) (From OE-Core rev: ab271b49d9b55ea271d519c3a4da0b639a07f0bb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/threaded: Remove in favour of using concurrenttestsRichard Purdie2018-12-1611-407/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | We have several options for parallel processing in oeqa, parallel execution of modules, threading and mulitple processes for the runners. After much experimentation is appears the most scalable and least invasive approach is multiple processes using concurrenttestsuite from testtools. This means we can drop the current threading code which is only used by the sdk test execution. oeqa/decorator/depends: Remove threading code Revert "oeqa/sdk: Enable usage of OEQA thread mode" This reverts commit adc434c0636b7dea2ef70c8d2c8e61cdb5c703b1. Revert "oeqa/core/tests: Add tests of OEQA Threaded mode" This reverts commit a4eef558c9933eb32413b61ff80a11b999951b40. Revert "oeqa/core/decorator/oetimeout: Add support for OEQA threaded mode" This reverts commit d3d4ba902dee8b19fa1054330cffdf73f9b81fe7. (From OE-Core rev: a98ab5e560e73b6988512fbae5cefe9e42ceed53) (From OE-Core rev: bb9a85e157e669d7a91c3bbefc8d5138e7b8b6ae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runner: Ensure we don't print misleading results outputRichard Purdie2018-12-161-3/+11
| | | | | | | | | | | | | | | | The current code assumes if something isn't a failure of some kind, it was a pass. When test case IDs weren't matching, this lead to very confusing output where things would fail, then be listed as passing. This adds code to track successes, ensuring we don't end up in this position again with unmatched entries being listed as UNKNOWN. (From OE-Core rev: 4374c296d8963e4f6a1aa7bef7983ad0a1c2fcff) (From OE-Core rev: bcb2948773d76befef2be787be6d25cf544e49a9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/runner: Improve test case comparisionRichard Purdie2018-12-161-2/+2
| | | | | | | | | | | | We can directly compare the test case IDs rather than representations, then if we're using subunit to split the tests, the comparisions still work as intended. (From OE-Core rev: 72e5f46f75454ba4c445c65c1cbc616a9e72fc6e) (From OE-Core rev: 4c53aac5315f9d0a0ed95cbeb48b7704e274e3a9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/context: Improve log file handlingRichard Purdie2018-12-161-4/+10
| | | | | | | | | | | | | | | | | | The existing logfile is simply placed in the current directory. Since the test changes cwd to BUILDDIR, the symlink to the log can be placed in an invalid directory. We also see trackbacks if the symlink is invalid. Improve things by: * Placing logs in LOG_DIR (or BUILDDIR if unset). * Using a full path to the log meaning the log and link are placed in the same directory. * Using lexists instead of exists so invalid symlinks are handled correctly. (From OE-Core rev: 750ece11bed0e62a11e0003d1d16a81f7c219761) (From OE-Core rev: 9c4c3c876dd5d224133571fcad1095af1098ae1d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner.py: Fix python regex warningsRichard Purdie2018-12-161-5/+5
| | | | | | | | | | | | | | | | | | | | | Fix the warnings: meta/lib/oeqa/utils/qemurunner.py:250: DeprecationWarning: invalid escape sequence \. ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1]) meta/lib/oeqa/utils/qemurunner.py:343: DeprecationWarning: invalid escape sequence \- if re.search("root@[a-zA-Z0-9\-]+:~#", output): poky/meta/lib/oeqa/utils/qemurunner.py:350: DeprecationWarning: invalid escape sequence \- if re.search("root@[a-zA-Z0-9\-]+:~#", output): meta/lib/oeqa/utils/qemurunner.py:448: DeprecationWarning: invalid escape sequence \- if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data): by correctly marking the regexs. (From OE-Core rev: 8e6987735002560fca714f77ea8ece9d4b28f7fa) (From OE-Core rev: 7eb1f0be82d7ee12f893cdd40384da306fa597a7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/context: Replace deprecated imp module usageRichard Purdie2018-12-161-2/+2
| | | | | | | | | | | | | | | Avoid the warning: meta/lib/oeqa/selftest/context.py:8: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp In this case importlib is a direct replacement. (From OE-Core rev: db7a60c36a2d3eefc61ae6e1ede01680dc932035) (From OE-Core rev: 351a7b75959593922909d7e1929a6429a2bf94a7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/commands: Avoid unclosed file warningsRichard Purdie2018-12-161-0/+3
| | | | | | | | | | | | | Avoid warnings such as: meta/lib/oeqa/utils/commands.py:213: ResourceWarning: unclosed file <_io.BufferedReader name=4> return runCmd(cmd, ignore_status, timeout, output_log=output_log, **options) (From OE-Core rev: 6a68c42de08cffbadb59ebda63fa5e19f6e5acef) (From OE-Core rev: 682d7b2810b235e86a28a8afe034e3853dbe8c45) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/loader: Fix deprecation warningRichard Purdie2018-12-161-1/+1
| | | | | | | | | | | | Clean up the warning: meta/lib/oeqa/core/loader.py:27: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec() _failed_test_args = inspect.getargspec(unittest.loader._make_failed_test).args (From OE-Core rev: d2deb66830be2d44532fea3d5db763b57778252a) (From OE-Core rev: f9ab10bb08446052fd6af2a21f38d8454e466d51) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/esdk: run selftest inside workdir not /tmpRoss Burton2018-12-161-6/+7
| | | | | | | | | | | | We've seen issues with rootfs size calculations and we've seen systems like opensuse which have btrfs mounted on /tmp causing selftest failures. (From OE-Core rev: 61be3cd748d1b7321a1fc4cfe84efa9b26a6aee0) (From OE-Core rev: d936faabfb29ea377d74e77332a2a91603747ac7) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: don't litter /tmp with temporary directoriesRoss Burton2018-12-162-3/+5
| | | | | | | | | | | | | | | | If we need to create a temporary directory in targetbuild or buildproject use tempfile.TemporaryDirectory so that when the test case is finished, the directory is deleted. Also synchronise the logic and don't possibly store the temporary directory in self.tmpdir as nothing uses that. (From OE-Core rev: db0e658097130d146752785d0d45f46a3e0bad71) (From OE-Core rev: d39252324a13580cc96f0694b88bc10515e030a0) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: Avoid tracebacks on closed filesRichard Purdie2018-12-161-2/+2
| | | | | | | | | | | | | | | | Reorder the shutdown/teardown to avoid: File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/utils/qemurunner.py", line 224, in launch op = self.getOutput(output) File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/utils/qemurunner.py", line 90, in getOutput fl = fcntl.fcntl(o, fcntl.F_GETFL) ValueError: I/O operation on closed file (From OE-Core rev: 8e7d756862d2a8d62f3c87497d6d65ddb3c1b962) (From OE-Core rev: 48979ffbe25351f92179021a973207a71bbe7a4e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runqemu: Improve testcase failure handlingRichard Purdie2018-12-161-12/+20
| | | | | | | | | | | | assertTrue doesn't give good debug information when things fail. Update several to use assertIn which gives information upon failure, for the others print the log information upon failure. (From OE-Core rev: c29cb75d5ce6b0873a934f4709b0c8824f7164d3) (From OE-Core rev: 6f2bb2c12289422396deb793ae4b4e99cfa88c7b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/oelib/path: don't leak temporary directoriesRoss Burton2018-12-161-7/+3
| | | | | | | | | | | | | | | setUp() is used to populate a directory of temporary files, and deleted in __del__. However setUp() is called once *per test* so __del__ would only be able to remove the last directory created. Fix the code by using the natural counterpart to setUp, tearDown(), to clean up. (From OE-Core rev: 68b4723e6fb11d171869185bccf28f32f6284c18) (From OE-Core rev: edd2ecbc86d8b02a0467491451306f67e81d9ead) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/buildoptions: Ensure diskmon tests run consistentlyRichard Purdie2018-12-161-3/+3
| | | | | | | | | | | | | | | | | Heartbeat events default to once a second and we need to ensure we have enough time in the task to see them. Add a nostamp delay task 5s long so we can have a consistently timed task which doesn't need cleanup or have unneeded dependencies. This ensures we should deterministically see the disk moinitor events regardless of the state of the build. This is done in a way which doesn't corrupt build state or need cleanup and is efficient. (From OE-Core rev: ecc49ee8986929e2429d948000a0ca588fe63959) (From OE-Core rev: d5ce38168238181423c9dcd1d258253e3515d0a5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/buildoptions: Improve ccache testRichard Purdie2018-12-161-0/+1
| | | | | | | | | | | | | | | This test occisionally fails as m4 doesn't recompile, meaning the logfile test then doesn't find mention of ccache. To ensure m4 does recompile, clean m4 before force compiling it. (Reading the test is confusing due to the test cleanup also involving a clean) (From OE-Core rev: 6e0b9214a0d57ed45a5df0ba5c9887a9045b89b1) (From OE-Core rev: b729a46820cce38b3d500271df19bdaf31973140) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Remove resource python warningsRichard Purdie2018-12-161-2/+8
| | | | | | | | | | | If runqemu fails it would leak an unclosed socket and file. Ensure we close these in all cases to remove the resource warning. (From OE-Core rev: ed80e46ccbc8fe8e9148d80723152066fa00ba28) (From OE-Core rev: baa8313e492cff8c31633a558792500b10493e9e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/commands: Avoid log message duplicationRichard Purdie2018-12-161-1/+1
| | | | | | | | | | | | | | Each time a runqemu() fails, the log handler would be left behind meaning messages from any subsequent run would be duplicated (or worse/more). This ensures we remove the handler regardless and means we no longer have the duplication. (From OE-Core rev: 532984708436bdfa3a8cac2c684a425eb249bad0) (From OE-Core rev: 600e71ede1977c45fed1958dd5356911e4fcf272) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: Fix python ResourceWarning for unclosed fileRichard Purdie2018-12-161-0/+2
| | | | | | | | | | | | | | Fixes: Stderr: /media/build1/poky/meta/lib/oeqa/utils/qemurunner.py:381: ResourceWarning: unclosed file <_io.BufferedWriter name=16> self.runqemu = None (From OE-Core rev: b9e0bf919e6fc1a58e02145a363ebe7066e5bf4f) (From OE-Core rev: b8a9eec2c9e56181350269acd6b42a14cc4abb3e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/commands: Add extra qemu failure loggingRichard Purdie2018-12-161-1/+5
| | | | | | | | | | | | Rather than just referring the user to the logs containing the failure, print them on the console. This aids debugging with oe-selftest with parallelisation as the logs may otherwise be lost. (From OE-Core rev: 36a018e245a232f520ff946f152cc875927a6fb4) (From OE-Core rev: 0ea441ab6a6fe752cc8820fb371e67eee92353e4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/buildoptions: Improve ccache test failure outputRichard Purdie2018-12-161-2/+3
| | | | | | | | | | | | The current failure mode doesn't show us what the logs actually looked like and later cleans can lose them. Show the whole log in case of failure to aid debugging intermittent problems on the autobuilder. (From OE-Core rev: 7c3a0dc5978cea898b1ca51decf4d6e7cf9d519f) (From OE-Core rev: 60b58e976dcc2a45a036e18cfcc87933a8859c9f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/case: Use bb.utils.remove() instead of shutil.remove()Richard Purdie2018-12-161-1/+3
| | | | | | | | | | | | | | | | | | This avoids problems where shutil.remove will error with: File "/usr/lib/python3.5/shutil.py", line 436, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.extra' when there are races over file deletion (gpg agent may be slow to exit). We already worked around speed and race issues in bb.utils. (From OE-Core rev: 00a8fd5b93a5c19ce0b7498e2bc653ce8ad58aaf) (From OE-Core rev: e7c0d29e063d1a47004acdc07a63996be98c74ef) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/signing: Use do_populate_lic target instead of do_packageRichard Purdie2018-12-161-3/+3
| | | | | | | | | | | This should speed the test up signficiantly without any loss of functionality for the purposes of the test. (From OE-Core rev: 3dde0b749643575878bfbca2f8d2d9ec30bad166) (From OE-Core rev: 51989db2d9eebd9f190994109c2932dac3f3034b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/signing: Allow tests not to need gpg on the hostRichard Purdie2018-12-161-19/+48
| | | | | | | | | | | | | | We ideally don't want to use gpg from the host. This is straightforward for package management but not for sstate. For sstate, create a second build directory to run the test in using gnupg-native from the original build directory. (From OE-Core rev: 10afa94c3f0d7eb7524a26deda86949073d55fde) (From OE-Core rev: c5d68a24b0c6df0a16f50075a690b3aab0e273ee) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/signing: Skip tests if gpg isn't foundRichard Purdie2018-12-161-12/+11
| | | | | | | | | | | | | Raising an assertionError in the class setup isn't a particuarly good way to indicate gpg isn't installed. Instead skip the tests if the required binary isn't present. For the signing tests we do require it to be present and can't use a prebuilt one. (From OE-Core rev: 2d486af97e51b9daa9c40482c31d637c9ab4ae79) (From OE-Core rev: 65403bb556f7e3132722288a62ef36631af0b557) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/recipetool: Fix problems from changing upstream sourceMohamad Noor Alim Hussin2018-11-241-2/+2
| | | | | | | | | | | | | | | | The upstream source tarball checksums changed. Use the copy from our source mirror to avoid failures. [YOCTO #12979] (From OE-Core rev: e97a31e6bbaec5cb56d4750bf5171dbba510ee33) (From OE-Core rev: d637eea4af8b538fb45056f0022975d7c41cdf5f) Signed-off-by: Mohamad Noor Alim Hussin <mohamad.noor.alim.hussin@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/wic: Improve error message for test_fixed_sizeRichard Purdie2018-11-241-2/+0
| | | | | | | | | | | | | | | | | Currently this can fail with a message like 127 != 0 which is unhelpful. If we remove the ignore_status=False, the debugging from runCmd is much more helpful printing status.output. Also remove the now unneeded exit code check. (From OE-Core rev: 1aa7471b11aedc68de5116c461fe73152e3985fd) (From OE-Core rev: d9ad083ee5a1bc8723b01b31a0010128e26375fd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/wic: Ensure initramfs exists for test_iso_imageRichard Purdie2018-11-241-1/+1
| | | | | | | | | | | | | | | | | | AssertionError: Command 'wic create mkhybridiso --image-name core-image-minimal -o /var/tmp/wic.oe-selftest/' returned non-zero exit status 1: ERROR: _exec_cmd: gzip -f -9 -c /var/tmp/wic.oe-selftest/tmp.wic.drhn6edm/initrd.cpio > /var/tmp/wic.oe-selftest/tmp.wic.drhn6edm/initrd.cpio.gz returned '1' instead of 0 output: gzip: /var/tmp/wic.oe-selftest/tmp.wic.drhn6edm/initrd.cpio: No such file or directory This is because in a clean build directory, the initramfs may not be rebuilt. Add a call to ensure it is built to avoid the error. (From OE-Core rev: 2a80fa234d31992691a157425e8990db30158fd1) (From OE-Core rev: cdc226b8d4114ef4ff51d6f13ceb09f8d264bf76) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/wic: Use a subdir of builddir, not /var/Richard Purdie2018-11-241-1/+1
| | | | | | | | | | | | | Using /var/ leave wic open to races with other processes on the system, use a subdir of builddir instead to avoid this. (From OE-Core rev: e07ec908ce7f26143a7bdf0a07a1230c0fd6ac87) (From OE-Core rev: 17223b0045896c9f342e9079d2345b730a3048cc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runtime_test: Ensure we build/use gnupg-nativeRichard Purdie2018-11-161-1/+3
| | | | | | | | | | | | | Without this, we see errors if gpg is missing from the host system for "oe-selftest -r runtime_test.TestImage.test_testimage_dnf". (From OE-Core rev: e91838b63b506e2969582b2b8511fd3724d6aa3f) (From OE-Core rev: 40e0b6244c0c6f276de501765daff660d7a44363) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs: always update the opkg indexIoan-Adrian Ratiu2018-10-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous logic assumed that if $BUILD_IMAGES_FROM_FEEDS=1 then a complete set of ipk feeds from which to build the image is already present under $IPK_FEED_URIS at do_rootfs runtime. $IPK_FEED_URIS usually contains "file://${DEPLOY_DIR_IPK}" which renders the above assumption bad because some recipes in the current build can contain code like do_install[nostamp] = "1" which will cause rebuilds bumping $PR and invalidating the index. Even when the index is manually re-created before an image build ("bitbake package-index"), the nostamp will cause failures because the dependency gets rebuilt before do_rootfs in the "bitbake <image>" call. So make the opkg rootfs index logic the same as for rpm/deb, to always update the index in $DEPLOY_DIR_IPK to fix the above nostamp failure. Feeds outside $DEPLOY_DIR_IPK added to $IPK_FEED_URIS continue to work as usual, for eg. by using a http:// URI. (From OE-Core rev: bce90f48d1cc136fdfdf98b3830f5d99e381271b) (From OE-Core rev: 6e03d1d56587d93b9a9ec936ceb69350234c627a) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-blayers/create: add version for example recipeAnuj Mittal2018-07-021-1/+2
| | | | | | | | | | | | | | | | | | Add version field in recipe name for example recipe created by bitbake-layers. Fixes [YOCTO #12767] (From OE-Core rev: c62f6b9643d31b465ea0e919882e411a5ed35c56) (From OE-Core rev: 963837bde1c0221333883505cc359e54bf98b10c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 425af487a3f6027c83779e7e229217089fae34a4) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/target/ssh.py: increase maximum read bytes from 1024 to 4096Chen Qi2018-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running testimage task for core-image-sato-sdk, the following error appeared. UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 at position 0: invalid start byte Checking the codes, I found it's caused by setting a 1024 limit for the read method of the StreamReader object. Comments from the manual: """ The chars argument indicates the number of decoded code points or bytes to return. The read() method will never return more data than requested, but it might return less, if there is not enough available. """ When running `systemctl status --full' on target, this error occurs. This patch increase the bytes limit to 4096 to fix the error. (From OE-Core rev: f1fad60ae3be4450aca6058d5665fb10a9148b44) (From OE-Core rev: bc64cf4fce0631b689c9818ac24e6a2a9d8effec) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime/cases/multilib.py: fix test_file_connman skipping logicChen Qi2018-07-021-1/+1
| | | | | | | | | | | | | | | | | | | The test_file_connman should be executed only when 'lib32-connman' is installed and 'connman' is not installed. When lib32-connman and connman are both installed, the /usr/sbin/connmand could be from connman or lib32-connman, depending on the installation order. What we want to check is the connmand command from lib32-connman, so we need to make sure that connman is not there to cause chaos. (From OE-Core rev: bc6839394c06bb695b92b2183337e7381da1e86c) (From OE-Core rev: 55eed10368da6b3179e3ad1ab9322cff32fa99cf) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime/cases/multilib.py: skip if needed packages are not availableChen Qi2018-07-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 1) The test cases use 'readelf' command to do the check. This command is from binutils. So skip the test if the needed binutils package is not installed. The related error message in log.do_testimage is like below. Output: sh: readelf: not found 2) The test case tests /lib/libc.so.6 from lib32-libc6. So skip the test if lib32-libc6 is not installed. The related error message in log.do_testimage is like below. Output: readelf: Error: 'lib/libc.so.6': No such file (From OE-Core rev: eae929a5c224f5c3468d6a0466d1bbb3f678a5a1) (From OE-Core rev: cb80105bbd03d8d9cc10139ed6f39b193e79c1b8) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime/cases/rpm.py: skip if rpm not availableChen Qi2018-07-021-0/+1
| | | | | | | | | | | | | | | | This test case should only run when rpm package is installed. So skip it if rpm package is not installed. This fixes: RESULTS - rpm.RpmBasicTest.test_rpm_help - Testcase 1059: FAILED (From OE-Core rev: bb909a60c04248d015d988e4454f0a11b1c287da) (From OE-Core rev: 520c375d49df29453213c3cd4e2155e80e27a0ca) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/decorator/data.py: fix skipIfNotInDataVarChen Qi2018-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The var might not be set, resulting in unexpected error. RESULTS - multilib.MultilibTest.test_check_multilib_libc - Testcase 1593: ERROR The above error is due to MULTILIBS being not set, which is the default for OE. This patch fixes this problem. Also, the debugging message in skipIfNotInDataVar is currently confusing. Instead of DEBUG: Checking if 'MULTILIBS' value is in 'multilib:lib32' to run the test it should be DEBUG: Checking if 'MULTILIBS' value contains 'multilib:lib32' to run the test This patch also fixes it. (From OE-Core rev: 3f5c678664a2bba43d99508779dc2ce227cf52a2) (From OE-Core rev: ea84439d42b578237d03d876992511eec73c5511) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/decorator/__init__.py: use 'cls' instead of 'obj'Chen Qi2018-07-021-3/+3
| | | | | | | | | | | | | | Use 'cls' instead of 'obj' to better reflect that registerDecorator actually serves as a class decorator. (From OE-Core rev: e06e4c859e8be5225d80806a2ebe175f0b152fe1) (From OE-Core rev: 9daf742004f4256bcb429165cfbf8dfc735a9686) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/decorator/__init__.py: set metaclass to ABCMetaChen Qi2018-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | OETestFilter is a subclass of OETestDecorator. It wants to make use of @abstractmethod decorator. But such decorator requires metaclass to be ABCMeta to have effect. So add it now to achieve the designed behaviour. Comments from python's manual: """ Using this decorator requires that the class's metaclass is ABCMeta or is derived from it. """ (From OE-Core rev: 28c4fafb2322ea8c37bcd7710f22f46ef552a902) (From OE-Core rev: 8c3a8c5d9fb31edbc37d8239c4cf5312a815a344) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/loader.py: support the 'auto' keywordChen Qi2018-07-021-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In previous OEQA, having 'auto' in TEST_SUITES results in executing as many test cases as possible. This behaviour is broken for now. From the codes in core/loader.py, I can see that it tries to use another keyword 'all'. But in fact, it does not work. I've checked the current manual. The manual says using 'auto'. Below is the current information in manual. """ Alternatively, you can provide the "auto" option to have all applicable tests run against the image. TEST_SUITES_append = " auto" """ So we should restore this behaviour. This patch does so. Also, output warning message is some module is named as 'auto', as this is a reserved keyword. (From OE-Core rev: a65460a063a958cc887c756db5f7ab18e3f5a8c1) (From OE-Core rev: 8c247f5141f15160d670b49d9963f4143faedff5) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runqemu: qemu nfs testing not ready for deploymentRichard Purdie2018-04-201-1/+3
| | | | | | | | | | | | This test shouldn't have merged yet since we don't run portmap/rpcbind on the autobuilder infrastructure and the test therefore cannot succeed. We need to document this, set it up, then enable the test. The test itself is fine and good to have so its left in the code but disabled for now. (From OE-Core rev: 9640af873d490c5d22b70e32d918c2db37371d21) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>