summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/eSDK.py
AgeCommit message (Collapse)Author
2023-03-30selftest: eSDK rename to esdkMartin Jansa
* I was hit by oe-selftest -r eSDK.oeSDKExtSelfTest.test_install_libraries_headers running all tests except only this selected one: poky $ oe-selftest -v -r eSDK.oeSDKExtSelfTest.test_install_libraries_headers -K -B /OE/build/poky/build-eSDK 2023-03-13 14:00:52,955 - oe-selftest - DEBUG - Selected tests with -r: ['eSDK.oeSDKExtSelfTest.test_install_libraries_headers'] 2023-03-13 14:00:55,531 - oe-selftest - INFO - Changing cwd to /OE/build/poky/build .. 2023-03-13 14:00:58,128 - oe-selftest - INFO - test_archiver_allows_to_filter_on_recipe_name (archiver.Archiver.test_archiver_allows_to_filter_on_recipe_name) this is caused by _built_modules_dict(modules) function which filters out eSDK.oeSDKExtSelfTest.test_install_libraries_headers based on the regexp and then it runs all loaded tests, because modules are empty the initial regexp and comment from 2017: https://git.openembedded.org/openembedded-core/commit/?id=80db3d999ae26d298d9d5418a32b11a4f27af9d5 # Assumption: package and module names do not contain upper case # characters, whereas class names do m = re.match(r'^([^A-Z]+)(?:\.([A-Z][^.]*)(?:\.([^.]+))?)?$', module) might still be valid, but it was loosened in 2018 to accept upper case in module: https://git.openembedded.org/openembedded-core/commit/?id=1ecf48fd286a77078451b67879a44f9c9dc7a894 Some test cases (eSDK.oeSDK*, runtime_test/*) does not match with current regex, fix it accept all. Then skipping the not matching modules was added later in 2018: https://git.openembedded.org/openembedded-core/commit/?id=f2042bf3638ed4edfb167e7f7d4be6da60997ead and regexp was updated again in 2020 not to accept upper case in modules: https://git.openembedded.org/openembedded-core/commit/?id=ad81ea90a815389e45ff302a85151724c71f71c3 oeqa/core/loader: refine regex to find module test case in format <module name>.<class name>.<test case name> this is clear when test cases is only 3 item deep. but confused when it is 4 item deep, eg, oelib.types.TestList.test_list_nosep I'm afraid that changing this regexp again to accept eSDK will break someone's favorite test case, renaming eSDK looks much safer option There is only 1 such case in poky: $ oe-selftest --list-modules | grep INFO.- | sed 's/^.*INFO - //g' | grep -v '^[a-z_\.]*$' Listing all available test modules: eSDK Most modules are just a-z (52x), then oelib.<foo> (6x) and 7 modules with underscore '_'. (From OE-Core rev: 173ef4397b5be19f72385b1a0d892a1fa8979d53) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12lib: Add copyright statements to files without oneRichard Purdie
Where there isn't a copyright statement, add one to make it explicit. Also add license identifiers as MIT if there isn't one. (From OE-Core rev: bb731d1f3d2a1d50ec0aed864dbca54cf795b040) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01oeqa/selftest: remove unused importsRoss Burton
(From OE-Core rev: 7ef7b03eeefc0a9911fd62c73e346fa5aeeb09eb) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-21meta/scripts: Automated conversion of OE renamed variablesRichard Purdie
(From OE-Core rev: aa52af4518604b5bf13f3c5e885113bf868d6c81) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-16oeqa: Update cleanup code to wait for hashserv exitRichard Purdie
We sometimes see exceptions from code seeing the hashserv DB files being removed at directory cleanup time. Add a check to ensure the hashserv has written the data base journal (and hence likely exited) before cleaning up. This will hopefully avoid errors like: Traceback (most recent call last): File "[...]/meta/lib/oeqa/sdk/buildtools-cases/build.py", line 30, in test_libc delay = delay - 1 File "/usr/lib/python3.6/tempfile.py", line 948, in __exit__ self.cleanup() File "/usr/lib/python3.6/tempfile.py", line 952, in cleanup _rmtree(self.name) File "/usr/lib/python3.6/shutil.py", line 486, in rmtree _rmtree_safe_fd(fd, path, onerror) File "/usr/lib/python3.6/shutil.py", line 424, in _rmtree_safe_fd _rmtree_safe_fd(dirfd, fullname, onerror) File "/usr/lib/python3.6/shutil.py", line 444, in _rmtree_safe_fd onerror(os.unlink, fullname, sys.exc_info()) File "/usr/lib/python3.6/shutil.py", line 442, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'hashserv.db-wal' (From OE-Core rev: 0b07d9add687d78495176cda0f3011c10ffa4d4b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09meta/lib+scripts: Convert to SPDX license headersRichard Purdie
This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09oeqa: Drop OETestIDRichard Purdie
These IDs refer to testopia which we're no longer using. We would now use the test names to definitively reference tests and the IDs can be dropped, along with their supporting code. (From OE-Core rev: 8e2d0575e4e7036b5f60e632f377a8ab2b96ead8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-24eSDK.py: unset BBPATH and BUILDDIR to avoid eSDK failureChen Qi
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) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-24eSDK.py: avoid error in tearDownClass due to race condistionChen Qi
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) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08oeqa/selftest/esdk: Ensure parent directory existsRichard Purdie
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: 48719bc4d108df7e357e7f22f9f356cd72b3ebbd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-06oeqa/selftest/esdk: Fix typo causing test failureRichard Purdie
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: c6de27c2f6f598849dcb8036ee849f449ba7f327) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05oeqa/selftest/esdk: run selftest inside workdir not /tmpRoss Burton
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) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-21oeqa/eSDK: Ignore errors during directory cleanupRichard Purdie
The cleanup can fail with: ERROR [0.000s]: tearDownClass (eSDK.oeSDKExtSelfTest) FileNotFoundError: [Errno 2] No such file or directory: 'bitbake.sock' which is due to bitbake taking a small amount of time to shut down the server. The easiest fix is just to ignore these kinds of errors, bitbake shouldn't create any new files during shutdown. (From OE-Core rev: 68009f4eb323e07cec8c4421d546bd3125dec033) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-06oeqa/selftest/cases: Migrate test cases into the new oe-qa frameworkLeonardo Sandoval
New framework has different classes/decorators so adapt current test cases to support these. Changes include changes on base classes and decorators. Also include paths in selftest/__init__.py isn't needed because the loader is the standard unittest one. (From OE-Core rev: ddbbefdd124604d10bd47dd0266b55a764fcc0ab) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>