summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases
Commit message (Collapse)AuthorAgeFilesLines
* pkgdata.py: avoid target-sdk-dummy-provides to mess things upChen Qi2019-04-091-0/+1
| | | | | | | | | | | | | | | | | | | | | Sometimes we meet the following failure for the test_lookup_recipe test case. AssertionError: 'zlib\nbusybox is in the RPROVIDES of target-sdk-provid[32 chars]ummy' != 'zlib\nbusybox' zlib + busybox- busybox is in the RPROVIDES of target-sdk-provides-dummy: - target-sdk-provides-dummy This is because target-sdk-provides-dummy rprovides busybox. So clean things up to avoid failure. (From OE-Core rev: 7b5a069d4f11e36a1c407c4212aba5aafaf4ee7f) 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>
* resulttool: Improvements to allow integration to the autobuilderRichard Purdie2019-03-261-58/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a combined patch of the various tweaks and improvements I made to resulttool: * Avoid subprocess.run() as its a python 3.6 feature and we have autobuilder workers with 3.5. * Avoid python keywords as variable names * Simplify dict accesses using .get() * Rename resultsutils -> resultutils to match the resultstool -> resulttool rename * Formalised the handling of "file_name" to "TESTSERIES" which the code will now add into the json configuration data if its not present, based on the directory name. * When we don't have failed test cases, print something saying so instead of an empty table * Tweak the table headers in the report to be more readable (reference "Test Series" instead if file_id and ID instead of results_id) * Improve/simplify the max string length handling * Merge the counts and percentage data into one table in the report since printing two reports of the same data confuses the user * Removed the confusing header in the regression report * Show matches, then regressions, then unmatched runs in the regression report, also remove chatting unneeded output * Try harder to "pair" up matching configurations to reduce noise in the regressions report * Abstracted the "mapping" table concept used to pairing in the regression code to general code in resultutils * Created multiple mappings for results analysis, results storage and 'flattening' results data in a merge * Simplify the merge command to take a source and a destination, letting the destination be a directory or a file, removing the need for an output directory parameter * Add the 'IMAGE_PKGTYPE' and 'DISTRO' config options to the regression mappings * Have the store command place the testresults files in a layout from the mapping, making commits into the git repo for results storage more useful for simple comparison purposes * Set the oe-git-archive tag format appropriately for oeqa results storage (and simplify the commit messages closer to their defaults) * Fix oe-git-archive to use the commit/branch data from the results file * Cleaned up the command option help to match other changes * Follow the model of git branch/tag processing used by oe-build-perf-report and use that to read the data using git show to avoid branch change * Add ptest summary to the report command * Update the tests to match the above changes (From OE-Core rev: b4513e75f746a0989b09ee53cb85e489d41e5783) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool: enable merge, store, report and regression analysisYeoh Ee Peng2019-03-261-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OEQA outputs test results into json files and these files were archived by Autobuilder during QA releases. Example: each oe-selftest run by Autobuilder for different host distro generate a testresults.json file. These scripts were developed as a test result tools to manage these testresults.json file. Using the "store" operation, user can store multiple testresults.json files as well as the pre-configured directories used to hold those files. Using the "merge" operation, user can merge multiple testresults.json files to a target file. Using the "report" operation, user can view the test result summary for all available testresults.json files inside a ordinary directory or a git repository. Using the "regression-file" operation, user can perform regression analysis on testresults.json files specified. Using the "regression-dir" and "regression-git" operations, user can perform regression analysis on directory and git accordingly. These resulttool operations expect the testresults.json file to use the json format below. { "<testresult_1>": { "configuration": { "<config_name_1>": "<config_value_1>", "<config_name_2>": "<config_value_2>", ... "<config_name_n>": "<config_value_n>", }, "result": { "<testcase_namespace_1>": { "status": "<PASSED or FAILED or ERROR or SKIPPED>", "log": "<failure or error logging>" }, "<testcase_namespace_2>": { "status": "<PASSED or FAILED or ERROR or SKIPPED>", "log": "<failure or error logging>" }, ... "<testcase_namespace_n>": { "status": "<PASSED or FAILED or ERROR or SKIPPED>", "log": "<failure or error logging>" }, } }, ... "<testresult_n>": { "configuration": { "<config_name_1>": "<config_value_1>", "<config_name_2>": "<config_value_2>", ... "<config_name_n>": "<config_value_n>", }, "result": { "<testcase_namespace_1>": { "status": "<PASSED or FAILED or ERROR or SKIPPED>", "log": "<failure or error logging>" }, "<testcase_namespace_2>": { "status": "<PASSED or FAILED or ERROR or SKIPPED>", "log": "<failure or error logging>" }, ... "<testcase_namespace_n>": { "status": "<PASSED or FAILED or ERROR or SKIPPED>", "log": "<failure or error logging>" }, } }, } To use these scripts, first source oe environment, then run the entry point script to look for help. $ resulttool To store test result from oeqa automated tests, execute the below $ resulttool store <source_dir> <git_branch> To merge multiple testresults.json files, execute the below $ resulttool merge <base_result_file> <target_result_file> To report test report, execute the below $ resulttool report <source_dir> To perform regression file analysis, execute the below $ resulttool regression-file <base_result_file> <target_result_file> To perform regression dir analysis, execute the below $ resulttool regression-dir <base_result_dir> <target_result_dir> To perform regression git analysis, execute the below $ resulttool regression-git <source_dir> <base_branch> <target_branch> [YOCTO# 13012] [YOCTO# 12654] (From OE-Core rev: 39cda3498ec68b91a671ead256231324d74f7d4c) Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/wic: update test case test_qemuKai Kang2019-02-251-2/+4
| | | | | | | | | | | | | | | | | | | | | This test case boots the image in qemu and checks for mounted partitions. But the outputs of mount are different between sysvinit and systemd: sysvinit: /dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt systemd: /dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt So check mounted partitions by egrep rather than check output of runqemu. (From OE-Core rev: 8e3311d45ec68d74e934e966f67cf5102634981c) (From OE-Core rev: 828db9026c61d0a6ad12b8e05929eef31abfd57d) Signed-off-by: Kai Kang <kai.kang@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>
* eSDK.py: unset BBPATH and BUILDDIR to avoid eSDK failureChen Qi2019-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | When executing eSDK test case, the following error appears. WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead. FileExistsError: [Errno 17] File exists: '/.../tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/selftest-esdk-fcuyzsqu/tmp/sysroots/x86_64/bin/pigz' -> '/.../tmp/hosttools/pigz' So unset these two vars to avoid messing things up. (From OE-Core rev: bc07d825ce8bb3b337623c232fef61f2781c82af) (From OE-Core rev: 748f946ee74f7480200a7eb0bb0b695467b08f0a) 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>
* eSDK.py: avoid error in tearDownClass due to race condistionChen Qi2019-02-061-0/+6
| | | | | | | | | | | | | | | | | | | | When removing the temporary directory, it's possible that bitbake.lock file is removed by bitbake during the cleanup. And this leads to the following error. FileNotFoundError: [Errno 2] No such file or directory: 'bitbake.lock' So add a check to remove this file before cleaning up the temporary directory. (From OE-Core rev: 984f56b37bd0014e5bf9509fc8ed181973e61773) (From OE-Core rev: 6a5cce862f1e950439dc8ee1d84a10397a7fac4f) 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: Enable kvm when QEMU_USE_KVM is setRobert Yang2019-02-061-0/+5
| | | | | | | | | | | (From OE-Core rev: 564de3681353fe8e203425388e8be9703a89d2da) (From OE-Core rev: ffea871575d0e80f73daf6b36c90798ce5e055e6) Signed-off-by: Robert Yang <liezhi.yang@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/esdk: Fix typo causing test failureRichard Purdie2018-12-161-1/+1
| | | | | | | | | | | | | 2018-12-06 23:19:24,564 - oe-selftest - INFO - Traceback (most recent call last): File "/media/build1/poky-sumo/meta/lib/oeqa/core/case.py", line 32, in _oeSetUpClass clss.setUpClassMethod() File "/media/build1/poky-sumo/meta/lib/oeqa/selftest/cases/eSDK.py", line 78, in setUpClass cls.tmpdir_eSDKQA = cls.tempdirobj.name AttributeError: type object 'oeSDKExtSelfTest' has no attribute 'tempdirobj' (From OE-Core rev: 75cd4edaa8a42f76c0594ce26df05c7a51d620df) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/esdk: Ensure parent directory existsRichard Purdie2018-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | INFO - ====================================================================== INFO - ERROR: setUpClass (eSDK.oeSDKExtSelfTest) INFO - ---------------------------------------------------------------------- INFO - Traceback (most recent call last): File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/core/case.py", line 32, in _oeSetUpClass clss.setUpClassMethod() File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/selftest/cases/eSDK.py", line 76, in setUpClass cls.tmpdirobj = tempfile.TemporaryDirectory(prefix="selftest-esdk-", dir=bb_vars["WORKDIR"]) File "/usr/lib/python3.5/tempfile.py", line 929, in __init__ self.name = mkdtemp(suffix, prefix, dir) File "/usr/lib/python3.5/tempfile.py", line 507, in mkdtemp _os.mkdir(file, 0o700) FileNotFoundError: [Errno 2] No such file or directory: '/home/pokybuild/yocto-worker/oe-selftest-debian/build/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/selftest-esdk-q7ln84gc' (From OE-Core rev: eca3c0a6aa4bce48f295ba25f613da8dcaefac20) 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: 63eefbe21612e58e88f1eb3fde3d314da53927fa) Signed-off-by: Ross Burton <ross.burton@intel.com> 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: e9c6e974b49b8821cce8f2c7e3ba0dc16a5b46a0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Improve multiprocess_lauch exception handlingRichard Purdie2018-12-161-0/+4
| | | | | | | | | | | | | | | | We've seen a cryptic: "ERROR: Fatal errors occurred in subprocesses, tracebacks printed above" message from oe-selftest with no other traceback information. Improve the traceback logging to try and give a better indication of any errors that is ocurring. (From OE-Core rev: 521dd3d00979a27b6932e58d5497de68abac26e1) (From OE-Core rev: 2696e69af0b32e03692d8644cc01b28dcf221aa1) 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: eee30d799ff892443d21de4128e7d643215b0ac1) 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: a883aa053ddeb4591109c7c1374525e63a59bd80) 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: bddb09a411ce69f49a37260e2188bbd9b02f5902) 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: 8a9fa1597245d13db89361c40db7867786f137ff) 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: 9fcfc43e1a51520a86761cf5534cff9e70167b77) 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: 8c91e74ebcd4b1b851026c7ed5e984aa6a39cf90) 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: 9bb190d5bee70d2d3d5ec2eeee3439cd24548cb8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/recipetool: Fix problems from changing upstream sourceMohamad Noor Alim Hussin2018-11-091-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) Signed-off-by: Mohamad Noor Alim Hussin <mohamad.noor.alim.hussin@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image-buildinfo,oeqa/selftest/containerimage: Ensure image-buildinfo doesn't ↵Richard Purdie2018-11-091-0/+1
| | | | | | | | | | | | | | | | | | | break tests Having image-buildinfo enabled causes containerimage.ContainerImageTests.test_expected_files to fail due to the presence of an unexpected file: ['./', './etc/', - './etc/build', './etc/default/', './etc/default/postinst', Tweak the class to allow it to be disabled and disable it from the test just in case it was enabled. (From OE-Core rev: af67bf422a4df5b7e07894512ff73a5f493682ab) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: Add test for Yocto source mirror functionality/completenessRichard Purdie2018-11-071-0/+23
| | | | | | | | | | | | | | We've had a number of occasions where the Yocto Project source mirrors have not been complete or functioning correctly. This adds a test so that if this happens we find out out it sooner. It also only works over http meaning we should be able to test that anyone behind an http only proxy (no git protocol) also has functional fetches for OE-Core and layers built by the core of the project. (From OE-Core rev: 9a25b2eb9cc13dd77a774dad83067ea5f9bf9716) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: devtool: Support meta being a symbolic linkuninative-2.3Peter Kjellerstedt2018-10-211-1/+2
| | | | | | | | | | | oe-selftest's devtool tests have been broken since commit 2457cd57 (oe-selftest: devtool: avoid parallel races by using temporary copy of core) if meta is a symbolic link. (From OE-Core rev: daba6c5a991b370709d17e51305334f55a3858ec) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstatetests.py: reset TCLIBCAPPENDKai Kang2018-10-161-0/+12
| | | | | | | | | | | | | | It appends TCLIBCAPPEND to TMPDIR in meta/conf/distro/defaultsetup.conf: TMPDIR .= "${TCLIBCAPPEND}" It affects some oe selftest cases in sstatetests.py. Reset TCLIBCAPPEND for these cases. (From OE-Core rev: 4549c9dd96be8db69d520f66f4507939df9e9587) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/runqemu: Handle SystemExitRichard Purdie2018-10-091-8/+11
| | | | | | | | | | | | | | | | | | | The sigchld handler in runqemu can raise a SystemExit when qemu shuts down. Rather than backtracing, accept this as a successful test result. ERROR: runqemu.QemuTest.test_qemu_can_shutdown (subunit.RemotedTestCase) testtools.testresult.real._StringException: Traceback (most recent call last): File "/home/pokybuild/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/runqemu.py", line 183, in test_qemu_can_shutdown qemu_shutdown_succeeded = self._start_qemu_shutdown_check_if_shutdown_succeeded(qemu, shutdown_timeout) File "/home/pokybuild/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/runqemu.py", line 175, in _start_qemu_shutdown_check_if_shutdown_succeeded time.sleep(1) File "/home/pokybuild/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/qemurunner.py", line 100, in handleSIGCHLD raise SystemExit SystemExit (From OE-Core rev: 417245923c1c2c35a60d6db29cbe5a78548860d2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/recipetool: fix non-determinism in cmake testRoss Burton2018-09-131-1/+3
| | | | | | | | | | | | | | The Navit recipe can depend on fribidi which is now part of oe-core. Since the pkgconfig lookup is based on pkgdata the results can change depending on what has been built, which leads to occasional failures. Build gtk+ before the test to ensure that the pkgdata is populated with more of the dependencies, and add fribidi to the generated DEPENDS checklist. (From OE-Core rev: d180dc758710c7259d45eeb9304e7284a8fd8825) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runtime_test: Ensure we build/use gnupg-nativeRichard Purdie2018-09-131-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) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* insane: Recognise BPF as a valid EM_MACHINE typeKhem Raj2018-09-131-0/+1
| | | | | | | | | | | | | | | | BPF Linux ELF objects are generated with kernel-selftests with >= 4.18 kernel and when clang is enabled which packages BPF objects into packages, therefore recongnise this as a valid ELF target Add a selftest for BPF Do not flag BPF objects in target, since they pretty much will be ok for most of kernels architectures we care do support BPF (From OE-Core rev: 3667a8ec016bae3f8026ef7b4c895546804f6368) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* statetests.py: drop test_sstate_allarch_samesigs_multilibKai Kang2018-09-131-9/+2
| | | | | | | | | | | allarch is disabled when multilib is used, so sstate oeqa case test_sstate_allarch_samesigs_multilib is useless. Remove check for allarch part and rename to test_sstate_nativesdk_samesigs_multilib. (From OE-Core rev: 32fe47ea0aea791357d3045c202cdad86b16f2ff) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runtime_test: Fix ↵Richard Purdie2018-09-041-0/+1
| | | | | | | | | | | | | | runtime_test.TestImage.test_testimage_install after ssl changes The test installs socat and expects it to run but assumes all its dependencies are already installed (which includes libssl). Recent changes mean this isn't the case so force libssl into the image in advance to work around this issue for now. (From OE-Core rev: 13b82380abb273e6575b1e74870d3fe8249ebbc1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package_manager: turn postinst failure warnings into bitbake failuresAlexander Kanavin2018-09-041-2/+2
| | | | | | | | | | | | | Sumo release provides a transition period so that deferrals to first boot via 'exit 1' can be converted to pkg_postinst_ontarget(). For the next release however, postinst script failures should be treated as such. [YOCTO #12607] (From OE-Core rev: 42acb0ebde4e88bcdf34a541b700f19d8607abb0) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/package: Add package separated debug symbols hardlink testHongxu Jia2018-08-281-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tweak recipe selftest-hardlink - addition of libexecdir to simulate multiple directories - add gdb.sh to run gdb from script which is invoked at test time. - rename `hello' -> `hello1' to workaround name confliction with the one in lmbench Add test_gdb_hardlink_debug to selftest/package - run a qemu and invoke gdb.sh to gdb binaries of selftest-hardlink - check gdb to read symbols from separated debug hardlink file - check debug symbols works correctly [Test without commit `package.bbclass: only one hardlink of separated debug info file in each directory'] 2018-08-26 01:27:30,195 - oe-selftest - INFO - test_gdb_hardlink_debug (package.PackageTests) 2018-08-26 01:30:29,005 - oe-selftest - INFO - gdbtest /usr/bin/hello1 2018-08-26 01:30:36,539 - oe-selftest - INFO - gdbtest /usr/bin/hello2 2018-08-26 01:30:43,568 - oe-selftest - INFO - gdbtest /usr/libexec/hello3 2018-08-26 01:30:50,157 - oe-selftest - ERROR - No debugging symbols found. GDB result: Reading symbols from /usr/libexec/hello3...(no debugging symbols found)...done.^M (gdb) Function "main" not defined.^M Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]^M (gdb) Starting program: /usr/libexec/hello3 ^M Hello World!^M [Inferior 1 (process 320) exited normally]^M (gdb) The program is not being run.^M (gdb) 2018-08-26 01:30:51,180 - oe-selftest - INFO - ... FAIL 2018-08-26 01:30:51,181 - oe-selftest - INFO - Traceback (most recent call last): File "oe-core/meta/lib/oeqa/selftest/cases/package.py", line 148, in test_gdb_hardlink_debug self.fail('GDB %s failed' % binary) AssertionError: GDB /usr/libexec/hello3 failed [Test without commit `package.bbclass: only one hardlink of separated debug info file in each directory'] [Test with commit `package.bbclass: only one hardlink of separated debug info file in each directory'] 2018-08-26 12:40:30,976 - oe-selftest - INFO - test_gdb_hardlink_debug (package.PackageTests) 2018-08-26 12:42:15,149 - oe-selftest - INFO - gdbtest /usr/bin/hello1 2018-08-26 12:42:24,064 - oe-selftest - INFO - gdbtest /usr/bin/hello2 2018-08-26 12:42:31,078 - oe-selftest - INFO - gdbtest /usr/libexec/hello3 2018-08-26 12:42:38,646 - oe-selftest - INFO - gdbtest /usr/libexec/hello4 2018-08-26 12:42:46,824 - oe-selftest - INFO - ... ok [Test with commit `package.bbclass: only one hardlink of separated debug info file in each directory'] (From OE-Core rev: 104d07e57488f4a414fb5e1f60d0c8b0c02d6b4d) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/package: Improve test to cover sparseness and hardlinking from sstateRichard Purdie2018-08-151-9/+18
| | | | | | | | | | | The sparseness test was sometimes working and sometimes failing depending on whether sstate was valid. This adds an explict test of sstate to the test for both hardlinking and sparseness. Tweak the test name to cover the fact its tests sparseness too. (From OE-Core rev: fe5b37c07b6d07c350516ab6bf849d6d86a84004) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/package: Add test to ensure sparse files are preservedRichard Purdie2018-08-151-0/+6
| | | | | | | | | | Add a new element to the hardlink test to check we also preseve file sparseness during the packing process. This should ensure we don't regress this issue again. (From OE-Core rev: 0a4e6974b49bf68c4a4098d339b5d655e202a3fd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/package: Fix hardlink test when using sstateRichard Purdie2018-08-071-1/+1
| | | | | | | | | | The build target won't cause the package task to run if things were already built and in sstate. Ensure we run the package task explicitly to ensure the test works as intended. (From OE-Core rev: be20eb4f4ad77d9444028ca9632b74d5866d96b8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: devtool: avoid parallel races by using temporary copy of corePaul Eggleton2018-07-311-0/+64
| | | | | | | | | | | | | | | | Some of the devtool tests make changes to files under meta/ - legitimately since we want these tests to be working with real recipes and associated files. Unfortunately with the new oe-selftest parallelisation this can break other tests if files go missing at the wrong time (among other scenarios). To avoid this issue, simply take a copy of the core repository and use that for these tests. (We copy the entire repository since changing the path of meta/ influences COREBASE and thus we need to have things like scripts/ alongside as well). (From OE-Core rev: 2457cd57b4195924ef127f497efa2f34f411e660) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: Add package hardlink testRichard Purdie2018-07-311-1/+14
| | | | | | | | | We keep breaking the preservation of hardlinks during the packaging process. Add a selftest which tests this to try and prevent this breaking again. (From OE-Core rev: 751fc7802f57a836a0be5fc6a8d5fdf8b1769c39) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/wic: Fix/cleanup class setup codeRichard Purdie2018-07-301-16/+15
| | | | | | | | | | | | | | | | The code was using Wic instead of WicTestCase for image_is_ready and native_sysroot which was confusing some tests. Fix image_is_ready. For native_sysroot, convert the only user to just run the call itself as there is no point in executing this for all the other tests which don't use the value. Whilst here, move _get_image_env_path to the base class alongside its parent variabe and fix it to use WicTestCase. (From OE-Core rev: 3e83364ed7031d53f281216214b04c7acace844a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/bbtests: Add test for bitbake execution outside the build directoryRichard Purdie2018-07-251-1/+11
| | | | | | | | Also fix a related test's error message to match what it does. (From OE-Core rev: 662be652ed39f32c3c7bee6539a9e91af191557e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/bblayers: Place the test layer directory in builddirRichard Purdie2018-07-251-1/+1
| | | | | | | | | | | Placing the layer in meta means the directory is in an unclean state which may influence other tests. Use our build directory instead since we 'own' that. This helps keep oe-selftest parallelisation clean. (From OE-Core rev: f2d32bdf3f27a9ef62fe3abb7fdd2e04ab84b5f3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/wic: clean up runCmd error code handlingRichard Purdie2018-07-251-110/+82
| | | | | | | | | | | runCmd handles checking exit 0 internally unless specified otherwise and its error messages are much more useful including the failed command output. Clean up the unneeded 0 exit code checks in the wic tests. (From OE-Core rev: 394f7d4efe80e390e2c9b0be5e6d10954395a82b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/wic: Improve error message for test_fixed_sizeRichard Purdie2018-07-251-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) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: fix for changes to buildhistory-diffPaul Eggleton2018-07-241-2/+15
| | | | | | | | | | | | | Now we're not reporting the related fields (as of openembedded-core 8658b3677b9f7cb70806061c41570c709086ef05) we shouldn't expect to see PR reported here since it's not monitored by buildhistory-diff. However, with a bit of messing about we can check for the exact output that we should now see as a result of the test changing PR to go backwards. (From OE-Core rev: f9c233908e6ada208d7abfdfe3ff98c6b278f405) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* utils: Add multiprocess_launch API and testcaseRichard Purdie2018-07-241-1/+45
| | | | | | | | | | | | | | | | | | | | | The current methods of spawning processes for parallel execution have issues around collection of results or exceptions. Take the code from package_ipk/deb, make it generic, add a results collection mechanism, fix the exception handling and for it into a standard library function. Also add a test case which tests both the success and failure modes of operation to stop this functionality regressiing again. In particular, compared to multiprocess_exec, this fork off the parent approach means we can pass in the datastore and functions work in the same scope as the parent. This removes some of the complexities found trying to scale multiprocess_exec to wider use. (From OE-Core rev: 88f0c214e593a45566df5131bda4c946f5ccc8c2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/wic: Split tests into two class groupsRichard Purdie2018-07-161-5/+9
| | | | | | | | This improves test parallelism. (From OE-Core rev: 26e04b23ba1b6942aa7c7df478d41dfe7b73e6e0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: Split tests into multiple classesRichard Purdie2018-07-161-52/+61
| | | | | | | | | | | | | This allows better parallelism between the different tests as currently this block takes the longest time to execute. devtool tests are still all grouped into the "devtool" module for ease of exection. This also makes it easier to execute some subset of devtool tests for testing devtool changes. (From OE-Core rev: 75148c190dd4823947557e9a07f1722e817c1fea) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Default to buffer mode for testsRichard Purdie2018-07-164-7/+0
| | | | | | | | | | | | Currently some tests run in buffer mode and some don't. Those that don't can corrupt stdout/stderr. Switch to using buffer mode everywhere so we're consistent. If there is useful output on stdout/stderr, it will be displayed if the test fails. (From OE-Core rev: 978548c0abde2cb94c2782538552f39bdf2bf630) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/wic: Ensure initramfs exists for test_iso_imageRichard Purdie2018-07-161-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) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/wic: Use a subdir of builddir, not /var/Richard Purdie2018-07-161-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) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/devtool: Ensure dbus is built befoe running testRichard Purdie2018-07-161-0/+2
| | | | | | | | | | | | | | | If dbus isn't build first the dbus dependency of dbus-wait can't be detected through pkgconfig and the test fails: AssertionError: {'DEPENDS': {'dbus'}} != {} - {'DEPENDS': {'dbus'}} + {} : Some expected variables not found in recipe: {'DEPENDS': {'dbus'}} Ensure dbus is built and present in the sysroot. (From OE-Core rev: 28699b4257436fb6079eafe50ca8cab09a2fdd90) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>