summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/imagefeatures.py
AgeCommit message (Collapse)Author
2023-08-30classes/image_types: Add vfat image typeJoshua Watt
Adds support for creating FAT formatted file system images (useful for boot partitions on some SoCs). Note that FAT partitions are limited in what they can represent (no symlinks or device files), so they can't really be used for general purpose root file systems. As such, they are skipped when testing for that purpose. (From OE-Core rev: 440fa508d362b8a449beb1b82dd999e980b753b7) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-11selftest: Ensure usrmerge is enabled with systemdRichard Purdie
systemd now requires usrmerge, ensure this is always the case in our test cases. (From OE-Core rev: 465bf84c523403ccc7dc6ed8c2a9c32d85929e8c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-03selftest: imagefeatures.py: don't mix tabs and spaces for indentationMartin Jansa
* introduced in: https://git.openembedded.org/openembedded-core/commit/?id=96d4486df6d870ef19e2055b026729e66bc118f3 (From OE-Core rev: 143f624116802579e7a6804c8d4b562f931880c8) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-30oeqa/selftest/imagefeatures: set a test for mutliubi in test_image_fstypesRomuald Jeanne
Allow 'multiubi' fstype image. Set 'MULTIUBI_BUILD' with two entries to allow configuration for two different '.ubifs'. Configure 'MKUBIFS_ARGS_*' and 'UBINIZE_ARGS_*' for both configurations. (From OE-Core rev: 96d4486df6d870ef19e2055b026729e66bc118f3) Signed-off-by: Romuald Jeanne <romuald.jeanne@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-22selftest: imagefeatures.py: respect IMAGE_LINK_NAME for debugfs and manifest ↵Martin Jansa
as well * these cases were correctly respecting IMAGE_LINK_NAME in most tests * the only exception was relatively wide glob for manifest: "test-empty-image-*.manifest" * and even wider glob for -dbg: "*-dbg.rootfs.tar.bz2" * replace them with the exact filename we expect for given image * be aware that gzip won't accept the symlink in IMAGE_LINK_NAME causing: 2023-03-13 08:58:23,845 - oe-selftest - INFO - ... FAIL 2023-03-13 08:58:23,845 - oe-selftest - INFO - Traceback (most recent call last): File "/OE/build/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py", line 124, in test_bmap self.assertTrue(runCmd('gzip -t %s' % gzip_path)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/OE/build/poky/meta/lib/oeqa/utils/commands.py", line 214, in runCmd raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output)) AssertionError: Command 'gzip -t /OE/build/poky/build/build-st-2023-03-12-todo-patch2/imagefeatures.ImageFeatures.test_bmap/build-st/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.rootfs.ext4.bmap.gz' returned non-zero exit status 1: gzip: skipping: /OE/build/poky/build/build-st-2023-03-12-todo-patch2/imagefeatures.ImageFeatures.test_bmap/build-st/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.rootfs.ext4.bmap.gz is a symbolic link * and "*-dbg.rootfs.tar.bz2" doesn't work if IMAGE_NAME_SUFFIX is changed to anything else than ".rootfs" or moved into IMAGE_LINK_NAME (like I plan in future changes where this will need to be updated again). Luckily we can use the symlink which currently doesn't have IMAGE_NAME_SUFFIX nor the DATETIME, so we don't need to search for it with glob, e.g. currently: core-image-minimal-qemux86-64-dbg-20230313112546-dbg.rootfs.tar.bz2 core-image-minimal-qemux86-64-dbg.tar.bz2 -> core-image-minimal-qemux86-64-dbg-20230313112546-dbg.rootfs.tar.bz2 [YOCTO #12937] (From OE-Core rev: 39285e981343930e41afe4eb8f2db675a85d54c2) 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>
2023-03-08oeqa/selftest/imagefeatures: add test for man-dbRoss Burton
Add a test to verify that manpages are built with api-documentation enabled, and apropos works on the target (so mandb has been ran). (From OE-Core rev: c085c335319bb98e09177c09feb1241a8560b606) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-11oeqa/selftest/imagefeatures: set a .wks in test_fs_typesRoss Burton
Set WKS_FILE to wictestdisk.wks, which is a very simple Wic file that simply contains the root filesystem. It may not actually boot but this test doesn't care, and it does exercise the wic image construction on all machines. (From OE-Core rev: b66a94896193f8d8eeff43b66e9daeb9a74bfed9) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-11oeqa/selftest/imagefeatures: don't use wic images in test_hypervisor_fmtsRoss Burton
There's no need to build a wic image in this test as not all machines (such as qemuarm64 currently) have wic images out of the box. We can simply build ext4 images to work on more machines and save some time. (From OE-Core rev: cdcf858d00eaf54814e23f550f83f3646bf83a24) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-11oeqa/selftest/imagefeatures: remove hardcoded MACHINE in test_image_gen_debugfsRoss Burton
There's no need for this to be built for genericx86-64, we want to test the current MACHINE. (From OE-Core rev: b5a7ebe9627b28b207ccccba4f26c6d4a937d6a8) Signed-off-by: Ross Burton <ross.burton@arm.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-05-29oeqa/imagefeatures: Disable squashfs-lzoRichard Purdie
(From OE-Core rev: c8c8b5265c831a2827a3891c7b326b25eae7f681) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-29oeqa/imagefeatures: Replace lzo with zstRichard Purdie
We may remove lzo so switch the test case to zstd. (From OE-Core rev: f749a8b462b915713912342444f981125938a990) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-16selftest/imagefeatures/overlayfs: Always append to DISTRO_FEATURESRichard Purdie
Using += unintentionally removes all other entries from DISTRO_FEATURES if DISTRO_FEATURES was set by ?= such as by poky.conf. This reduces sstate reusage on the autobuilder. Fix this to speed up builds. (From OE-Core rev: 124b82c32c4545bb216a8249954817f692f9795a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01oeqa/selftest: tag tests that use runqemuRoss Burton
There may be environments or machines which don't have working runqemu, so tag all of the tests which use runqemu() so that they can be skipped. (From OE-Core rev: 3f45ce6d2b1dfde8bc3d554397d55f81846c52d5) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-21imagefeatures: selftest: Change variable to be more descriptiveSaul Wold
This changes a couple of variables to be more representive of their usage. (From OE-Core rev: f776a4afc279f71d362d42303a930fdc47f11755) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-23oeqa: fix warnings for append operators combined with +=Yi Zhao
(From OE-Core rev: f2504115f08b173d919d9abe507a0ba440b0d4df) Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-02Convert to new override syntaxRichard Purdie
This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". (From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-03oeqa: remove Clutter usageRoss Burton
Remove the use of core-image-clutter in selftest and manual Toaster QA. (From OE-Core rev: a634a0555d000d93a23890b68e54f06370f0a97e) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-27oeqa/selftest: transition to weston imagesAlexander Kanavin
For readonly rootfs tests core-image-weston is appended; everywhere else it replaces core-image-sato. (From OE-Core rev: 75e042db853b9bf9a70ff8a5abe6d45ebb0b77a9) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-20oe-selftest: move FIT image tests to their own modulePaul Eggleton
I'm about to add an additional test, and on the assumption that we might also add more in future it seems reasonable to have the tests in their own module. (From OE-Core rev: 89f620cc142df9b4af6d49a13db96452ec838139) Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-10-26imagefeatures: New test case, test_empty_image, addedKhairul Rohaizzat Jamaluddin
An empty image build file exists under the meta-selftest folder, test-empty-image.bb, which builds an image with no additional packages. However, there were no further selftest created to verify its emptiness This change consists of the selftest related to the said image to verify its emptiness and the 'import glob' moved as global import instead of local import. The expected outcome of the test should be TRUE or 1 if the .manifest file content is empty. [YOCTO #8455] (From OE-Core rev: 1f8bdaa746c6e7efc07789256d5c050780c81f4c) Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-08oeqa/selftest/imagefeatures: Add testcase for fitImageUsama Arif
This testcase generates the Image Tree Source and the corresponding fitImage containing a kernel and a ramdisk. It then checks if the these files exist and if the right fields are present in the right order in the Image Tree Source. Tested with: oe-selftest -r imagefeatures.ImageFeatures.test_fit_image (From OE-Core rev: 97e986030ef33dbc43f8e18f7721b98ee381e29b) Signed-off-by: Usama Arif <usama.arif@arm.com> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-18image_types: declare support for wic.zstDiego
Declare images in wic.zst format as supported, as bmaptool now supports zstd: https://github.com/intel/bmap-tools/commit/1b8437d58447d3796dc11fd0f2c62bec5746e5d6 Given the very fast decompression speed of zstd over, for example, gzip, writing images with bmaptool can provide big write speed improvements when decompression speed is the limiting factor (especially with very sparse images). (From OE-Core rev: 704b01f33196cfdeaa57e2f2602ff2d52b25ab93) Signed-off-by: Diego Rondini <diego.rondini@kynetics.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-12selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFSYeoh Ee Peng
Add new testcase to check IMAGE_GEN_DEBUGFS. Test makes sure that debug filesystem is created accordingly. Test also check for debug symbols for some packages as suggested by Ross Burton. [YOCTO #10906] (From OE-Core rev: 727e8819df17f0f959b602e6f7b6af15993fc466) Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-04selftest/imagefeatures: blacklist zstRoss Burton
The dependency isn't in OE-Core so we need to disable this test. (From OE-Core rev: 3646499cb34e91c1d012d057eedfdeff08a4f06c) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-23oeqa/selftest: use specialist assert* methodsRoss Burton
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-09oeqa/selftest/imagefeatures: improve test_hypervisor_fmtsRoss Burton
If this test fails then the output doesn't help in any meaningful way, so improve the test to output the unparsable JSON and display unexpected output. (From OE-Core rev: 6a710ad0b445295991b17545f634684f4f317099) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-16oeqa/selftest/imagefeatures: dump the JSON if it can't be parsedRoss Burton
(From OE-Core rev: 4f7c840349f576f3edb68b16f9bcc9d88bc73b36) Signed-off-by: Ross Burton <ross.burton@intel.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-03-06imagefeatures: Add test to blacklist building busyboxTom Rini
Now that we have a packagegroup that can be used to replace the overall functionality of busybox as base-utils, add a test that we can continue to build a fairly complex image without busybox being available. This also doubles as documentation-by-test of how to do this. (From OE-Core rev: 6319a59c1d30eeb8ad4871d43641e3469fb543ba) Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-16oeqa: Default to buffer mode for testsRichard Purdie
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>
2018-07-09rootfs-postcommands: split ssh_allow_empty_passwordJackie Huang
"allow root login" should not be bundled in ssh_allow_empty_password, because some distro may want only one of "allow root login" and "allow empty password", so split it out into ssh_allow_root_login and add new imagefeature allow-root-login so they can be controlled separately, debug-tweaks will still include both of them. (From OE-Core rev: 1ab494f06a12548a902298afabd0a842161ef10d) Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-23imagefeatures: disable f2fs from test_image_features by defaultSaul Wold
Since the primary f2fs utilities are provided by the meta-openembedded meta-filesystems layer, we disable the testing of that functionality here. (From OE-Core rev: f691ed2572e54fa2af04c1569746c36ce04463ee) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-11oeqa: Markup further tests for stdout/stderr bufferingRichard Purdie
This further cleans up the output of oe-selftest so that runqemu output is hidden unless tests fail. (From OE-Core rev: efa064d5026538ab513edc11869364ce2f14b977) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-08selftest/imagefeatures: add basic test for useradd-staticidsRoss Burton
(From OE-Core rev: 468079140c1f19096bbc628663462beebc194800) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11oeqa/selftest: Add missing IDs to various test casesJose Perez Carranza
Add decorator @OETestID() with Tesopia TC-ID to the test cases that did not have it properly set. [YOCTO #11873] (From OE-Core rev: aa5b9edbd9c4495befe1912a5b401b536be39d5b) Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-30imagefeatures: Add a test for various hypervisor formatsTom Rini
We add a new test that will create core-image-minimal for wic.vmdk, wic.vdi and wic.qcow2. We then confirm via qemu-img that the resulting file is of the expected type. Cc: Ed Bartosh <ed.bartosh@linux.intel.com> (From OE-Core rev: 1392fdeaf6acc7c8d2ff9a5a2bf6ef2f5928957d) Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-30imagefeatures: Add a test for many CONVERSION_CMDs being chainedTom Rini
Add a new test to create a long (and not otherwise useful) image, ext4.bmap.gz.bz2.lzo.xz.u-boot and also the sha256sum of it. Check that the resulting sha256sum is valid. Cc: Ed Bartosh <ed.bartosh@linux.intel.com> (From OE-Core rev: ac4402bff547b017284b12c1874d4094c169419d) Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-30imagefeatures: Extend test_bmap to validate gzipTom Rini
We extend the existing test_bmap test to also produce an ext4.bmap.gz file and then have gzip confirm that it contains valid gzip data. This tests that we are able to chain at least 2 CONVERSION_CMDs together. Cc: Ed Bartosh <ed.bartosh@linux.intel.com> (From OE-Core rev: 1e9ca92f84d9d5b4e56d47dfd4b3d7f9aba3d21b) Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-17imagefeatures: add test_image_fstypes test caseEd Bartosh
Tested if core-image-minimal can be built for existing fstypes by building an image and checking if result file <image>.<fstype> exists in the image deploy directory. (From OE-Core rev: 9db3dbde66e3590aea71400891eaea0ae2caf371) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-23selftest: Add Testopia ID to test casesJose Perez Carranza
Add decorator @OETestID() with proper Tesopia TC ID to the test cases that did not have it set. (From OE-Core rev: d7bc697534db911a3ce98537d772d87482a0f702) Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> 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>