aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases
AgeCommit message (Collapse)Author
2018-03-06selftests: Add test case for booting a generic EFI boot partition imageCalifornia Sullivan
Simple test case that adds 'efi' to MACHINE_FEATURES, sets WKS_FILE to "efi-bootdisk.wks.in", installed required boot items, and attempts to boot the wic image. Quick check to make sure that the feature actually works. Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24sstatetests: pass the right files when comparing sigfilesRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-02-24oe-selftest: add a test for recipes without maintainersAlexander Kanavin
'bitbake -c checkpkg world' is moved to class initializer to avoid it being run twice in a row. The no-maintainers test checks only oe-core recipes, as other layers may be be configured, and assigning maintainership to specific people via maintainers.inc is known to be used only in oe-core. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-02-24oe-selftest: fix tests to reflect man->man-db transitionAlexander Kanavin
Rather than apply a patch twice, an incorrect patch is applied (as the new man-db recipe does not have any patches yet). Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-02-09oe-selftest: meta_ide: add tests for meta-ide-supportYeoh Ee Peng
QA team were testing meta-ide-support manually. Add automated tests to test that bibtake meta-ide-support will create the toolchain and environment setup script. Also test that after using environment setup script, one can compile c program and build cpio project. Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.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. Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-14selftest/cases/devtool.py: fix workspace layer checkingRobert Yang
Fixed: $ oe-selftest -r devtool.DevtoolTests.test_create_workspace [snip] 2017-12-20 18:28:59,404 - oe-selftest - INFO - Traceback (most recent call last): File "/workspace2/lyang1/poky/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f return func(*args, **kwargs) File "/workspace2/lyang1/poky/meta/lib/oeqa/selftest/cases/devtool.py", line 177, in test_create_workspace self.assertTrue('/workspace' not in result.output, 'This test cannot be run with a workspace layer in bblayers.conf') AssertionError: False is not true : This test cannot be run with a workspace layer in bblayers.conf [snip] $ bitbake-layers show-layers NOTE: Starting bitbake server... layer path priority ========================================================================== meta /workspace2/lyang1/poky/meta 5 meta-poky /workspace2/lyang1/poky/meta-poky 5 meta-yocto-bsp /workspace2/lyang1/poky/meta-yocto-bsp 5 meta-selftest /workspace2/lyang1/poky/meta-selftest 5 There is no workspace layer, but I'm in /workspace2, this patch can fix the problem. [YOCTO #12442] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-01-06bitbake.conf: Set AUTOREV to have a vardepvalueRichard Purdie
If you have a recipe which does not include SRCPV in PV but does set SRCREV = "${AUTOREV}" and you run do_fetch, then change the repo to a new commit then run do_unpack, do_unpack will fail since the new commit doesn't exist in the repo that was fetched. The problem is the revision chosen is not represented in the do_fetch task hash. It if were, the fetch would rerun first and the commit would be present. It works when PV includes SRCPV since that does contain the chosen commit from the AUTOREV. The solution is to include the SRCPV value into the representation of AUTOREV used for checksum calculation purposes. Add a selftest for this issue. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-02oe-selftest: devtool: switch away from mkelfimagePaul Eggleton
mkelfimage is about to be removed, so test_devtool_modify_git needs to use a different recipe. psplash is a reasonable choice given it uses a git repository (and probably will forever), and doesn't have too many dependencies, so change the test to use that recipe instead. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-21rpm: update to 4.14.0Alexander Kanavin
Previously oe-core had a development snapshot of rpm, it's better to update to something more stable. Removed patches: 0001-Add-PYTHON_ABI-when-searching-for-python-libraries.patch (upstream is using pkg-config) 0001-When-nice-value-cannot-be-reset-issue-a-notice-inste.patch (functionality has been moved to a plugin, we disable plugins for rpm-native) 0012-Use-conditional-to-access-_docdir-in-macros.in.patch (merged upstream) Changed patches: 0001-Fix-build-with-musl-C-library.patch (one previous musl issue has been resolved upstream; another has been added) Rest of the patches are trivial rebases. Update the signing oe-selftest so that the reference output matches the upstream changes. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-12-21oeqa/selftest/cases/wic: update OETestID decorator for test_qemuJoshua Lock
Test case ID 1422 is not correct for this issue, the correct test case ID for test_qemu is 1424. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-20oeqa/selftest/buildoptions: Add test for fortran compiler buildingRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-20oeqa/selftest/archiver: Add test for srpm archiver mode dependenciesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18meta-selftest: wic: Add test for --use-uuid / --fsuuidTom Rini
- Mount a '/media' partition to wic-image-minimal.wks with a known UUID. - In test_qemu, sort our output from checking the output of 'mount' as it may not be stable. Also, do not check the exit code as passing any output to cut ensures a 0 exit code. - Check for a 'UUID=' line in /etc/fstab with out expected output. Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-12-10oe-selftest: devtool: fix test for changes in lzo recipePaul Eggleton
acinclude.m4 is about to be removed from the lzo recipe which breaks test_devtool_update_recipe_local_files_2. Create a synthetic recipe in meta-selftest with some local files and use that instead. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-12-02oeqa/selftest/runtime_test: simplify postinst testingRoss Burton
Update the packages and file names to reflect the new postinst recipe. Fix a sh syntax error in the run_serial file exists test which was hidden by a logic problem in the status code. Remove the older test_verify_postinst as it's effectively a subset of test_postinst_rootfs_and_boot, and doesn't work: when booting under systemd the strings it searches for are not output to the console, but the test still passes. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-10oeqa: 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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa: Clean up logger handlingRichard Purdie
The logger handling in oeqa was confused at best. This patch: a) Passes in a logger through various qemu runner pieces b) Uses that logger consistently in the code c) Creates a logger for QemuRunner outside the bitbake namespace meaning we don't conflict with the tinfoil logging changes The result of this is more consistency. For runtime tests in testimage, the logs always contain the debug info, nothing is shwon on the console. For the oe-selftests, logs are intercepted and only shown if the test fails. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa/runqemu: Only show stdout/stderr upon test failureRichard Purdie
In general we don't need to see the output of runqemu however if it fails we do. Use the buffer option that already exists in TestResult but allow us to trigger it on a per test basis. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-08selftest/imagefeatures: add basic test for useradd-staticidsRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08lib/oeqa/selftest/cases/gotoolchain: add selftest for the Go toolchainJoshua Lock
Add a simple test case to being testing of the Go toolchain: 1) build meta-go-toolchain 2) create a temp directory and install the generated Go toolchain within 3) fetch an archive of the Go Dep tool 4) create an appropriately laid out GOROOT and inflate the dep archive there 5) build the dep command with the SDK's Go toolchain and check it returned successfully. [YOCTO #12152] Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08oeqa/selftest/runtime_test: use console in postinst_rootfs_and_bootRoss Burton
Use a console login not SSH for simplicity. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-07oeqa/selftest/runtime_test: fix postinst_rootfs_and_bootRoss Burton
This test overrides IMAGE_FEATURES but failed to include package-management, which is essential for postinsts to work under dpkg. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05oeqa/selftest/runtime: force empty root password, use helpers to access qemuRoss Burton
2017-10-06license.py: Correct selection of licenses in is_included()Peter Kjellerstedt
When faced with multiple sets of licenses combined with | (OR), it was possible for oe.license.is_included() to choose a set of licenses with a blacklisted license and then report failure, even if choosing another set of licenses would have resulted in a successful result. This happened when the chosen set still contained more whitelisted licenses than the other set. This change makes sure a set with any blacklisted license is always considered with a lower weight than a set with only whitelisted licenses. Example: Faced with the license string "GPL-3.0 & GPL-2.0 & LGPL-2.1 | Proprietary" and with "GPL-3.0" being blacklisted, the old code would report a failure since "GPL-3.0 & GPL-2.0 & LGPL-2.1" still contains more whitelisted licenses than "Proprietary" does. This change also adds a unit test for oe.license.is_included(). Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-26selftest/cases/runtime_test: ignore removal errors when cleaning temporary ↵Leonardo Sandoval
gpg directory The high-level method tempfile.TemporaryDirectory give us no way to ignore erros on removal thus use tempfile.mkdtemp instead. Ignoring possible issues on removal is neccesary because it contains gpg sockets that are automatically removed by the system once the process terminates, otherwise the following log is observed: 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.browser' This is the same fix as 7e3a7cd2426feac757def81850dc44156cd0f33e, but this applies to runtime (instead of signing). [YOCTO #11821] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-18oeqa/selftest/recipetool: use stable tarball for recipetool create testRoss Burton
GitHub dynamically generates the /archive/ tarballs but we're encoding checksums in the test suite. Change the URL to use a static tarball, and update the checksums. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-18devtool: rework source extraction so that dependencies are handledPaul Eggleton
Since it was first implemented, devtool's source extraction (as used by the devtool modify, extract and upgrade subcommands) ignored other recipe dependencies - so for example if you ran devtool modify on a recipe that fetches from svn or is compressed using xz then it would fail if those dependencies hadn't been built first. Now that we can execute tasks in the normal way (i.e. tinfoil.build_targets()) then we can rework it to use that. This is slightly tricky in that the source extraction needs to insert some logic in between tasks; luckily we can use a helper class that conditionally adds prefuncs to make that possible. Some side-effects / aspects of this change worth noting: * Operations are a little slower because we have to go through the task dependency graph generation and other startup processing. There's not really any way to avoid this though. * devtool extract didn't used to require a workspace, now it does because it needs to create a temporary bbappend for the recipe. (As with other commands the workspace be created on the fly if it doesn't already exist.) * I want any existing sysroot files and stamps to be left alone during extraction since we are running the tasks off to the side, and especially devtool extract should be able to be used without touching these. However, this was hampered by the automatic removal process in sstate.bbclass triggered by bb.event.ReachableStamps when the task signatures change, thus I had to introduce a way to disable this removal on a per-recipe basis (we still want it to function for any dependencies that we aren't working on). To implement this I elected to use a file written to tmp/sstate-control which gets deleted automatically after reading so that there's less chance of stale files affecting future sessions. I could have used a variable but this would have needed to be whitelisted and I'd have to have poked its value in using the setVariable command. Fixes [YOCTO #11198]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-09-13oe-selftest: devtool: fix test_devtool_add hanging on some machinesPaul Eggleton
The code in scriptutils which implements the logic for running the editor used by devtool edit-recipe looks at the VISUAL environment variable before EDITOR, and thus if VISUAL is set in the environment it will override the EDITOR value we are setting here, the editor (usually vim) launches and there's nothing to stop it running forever short of manually killing it. Set VISUAL instead to fix this. Apparently VISUAL is in fact the variable we should really be preferring here - I don't think I knew that but somehow I got it right in the code, just not in the test. Here are the details for the curious: https://unix.stackexchange.com/questions/4859/visual-vs-editor-whats-the-difference Fixes [YOCTO #12074]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12selftest/cases/signing: ignore removal errors when cleaning temporary gpg ↵Leonardo Sandoval
directory The high-level method tempfile.TemporaryDirectory give us no way to ignore erros on removal thus use tempfile.mkdtemp instead. Ignoring possible issues on removal is neccesary because it contains gpg sockets that are automatically removed by the system once the process terminates, otherwise the following log is observed: .. .. 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.browser' [YOCTO #11821] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12selftest/devtool: Avoid writing on TOPDIR on kernel test caseJose Perez Carranza
Use a tempdir to copy the .config file from the kernel instead of being copied to build directory. Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11wic: selftest: add test_wic_rm_ext test caseEd Bartosh
Tested if 'wic rm' correctly removes files from the ext4 partition of the wic image. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11wic: selftest: add test_wic_cp_ext test caseEd Bartosh
Tested if 'wic cp' correctly copies files to the ext4 partition of the wic image. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11wic: selftest: add test_wic_ls_ext test caseEd Bartosh
Tested if 'wic ls' correctly lists directory contents of the ext* partition. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11oeqa: Replace "append +=" with normal "append =" in layerappend.pyRobert P. J. Day
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Ross Burton <ross.burton@intel.com>
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] Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-08-31selftest/prservice: Adapt to BB_SERVER_TIMEOUTRichard Purdie
In the memory resident mode, the user may not see a message about the server starting, it would be in the cookerdeamon logfile. We don't need this to test the server is functioning correctly so just drop the test. Add in an extra check that the file we expected to be created was created when exporting PR values. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31oe-selftest: tinfoil: add a test for variable historyPaul Eggleton
I recently found that variable history wasn't working properly for recipes when we enable history tracking, resulting in minor functionality loss in devtool upgrade, so add a test to ensure this doesn't regress now that it's fixed. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31oe-selftest: devtool: test find-recipe and edit-recipePaul Eggleton
We weren't testing the devtool find-recipe and edit-recipe subcommands, with the result that when they regressed recently we didn't notice. Add some code into the test_devtool_add to test this (since we need a recipe in the workspace, and adding a new test with all that preamble would seem a bit excessive for these simple checks). Also take the opportunity to refactor the test a little bit so that the recipe name and version are variables rather than hardcoding them everywhere. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-27wic: setlftest: test expanding MBR imageEd Bartosh
Added test_expand_mbr_image test case to the wic oe-selftest suite. The test expands directdisk wic image to 1Gb target, checks if it's expanded correctly and boots it in qemu to make sure the image is bootable, i.e. bootloader, kernel, boot and root partitions are still functional. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23runqemu: Use virtio to mount cdrom drivesRichard Purdie
The IDE driver in the kernel is fragile and in 4.12 is causing backtraces. To unblock 4.12 kernel merging use the virtio CD driver instead to mount iso images which should be faster and more stable. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-16dnf: expand dnf selftest to test signed package feedsMarkus Lehtonen
[YOCTO #11209] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-16oeqa: fix dnf testsMarkus Lehtonen
Rename one dnf runtime test that it will recognized as a python module and thus also found by the oe test loader. Also, fix value of TEST_SUITES in dnf selftest so that all test dependencies are satisfied and the runtime test may be successfully run from there. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-16selftest/tinfoil: Filter LogRecords in test_event_waitRichard Purdie
As the code stands today, an event mask does not mask LogRecord events since the log levels are controlled separately. We therefore need to accept (and ignore) LogRecord events in this test to avoid errors. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-16selftest: fix distrodata.py to use per-recipe UPSTREAM_VERSION_UNKNOWN settingAlexander Kanavin
... instead of a global exception list which was problematic. [YOCTO #11896] Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-11sstatetests: limit the number of signature comparisons when differLeonardo Sandoval
For perfomance reasons, limit the number of signature comparisons when stamps differ. The limit set is hardcoded to 20. [YOCTO #11651] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-08-11oeqa/buildoptions: remove unsafe-references-in-script testRoss Burton
This QA test is about to be deleted, so remove it from selftest. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-08-11oeqa/runtime_test: use subtests in test_postinst_rootfs_and_bootRoss Burton
As this test has two nested loops and actually runs six times, use UnitTest.subTest() so we can tell which instance is failing, and to run all variations instead of failing on the first one. Also set PACKAGE_CLASSES to just the type we need to reduce the verboseness of the output, and consolidate the feature generation to be neater. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-08-08sstatetests: Use python function instead of bitbake-diffsigs scriptLeonardo Sandoval
Using a python function instead of launching a subprocess fasten the diffsigs computation. [YOCTO #11651] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.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> Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>