Commit Graph

32 Commits

Author SHA1 Message Date
Yoann Congal
131872001a oeqa/selftest: add a test for bitbake "-e" and "-getvar" difference
This is a non-regression test for [YOCTO #15638]

(From OE-Core rev: 22b508da24e0f7e5ad8ce4e090832bd0829963f0)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-18 22:09:03 +00:00
Richard Purdie
0a9e45a413 oeqa/selftest/bbtests: Tweak to use no-gplv3 inc file
With changes to gcc-runtime around improving debugging, python modules
are needed but this pulls in bash which breaks the tests.

Add an exclusion to the no-gplv3 include file to handle this.

(From OE-Core rev: 803060fa4e8fe98ac8f987b80162110d06788946)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-05 14:06:10 +00:00
Pavel Zhukov
61805f6d60 oeqa/selftest/bbtests: Add test for unexpanded variables in the dirname
Regression test for [Yocto #15255]

(From OE-Core rev: 4c31cc114f2cf13c11b7ffd60db0eda1b63cc27b)

Signed-off-by: Pavel Zhukov <pavel@zhukoff.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 19:17:11 +00:00
Richard Purdie
a83a16b793 oeqa/selftest/bbtests: Improve and update test_non_gplv3
This test no longer worked with fixes to avoid overlapping license files
in deploy. Fix the test but also improve the logging messages so we don't
get "False is not True" messages upon failure.

(From OE-Core rev: 2fc7714dab5cce585bce4d6c4e8ffbefce2a709b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-20 23:51:11 +01:00
Fabien Mahot
617d2303c0 oeqa/selftest/bbtests: add non-existent prefile/postfile tests
Fixes [YOCTO #10725]

(From OE-Core rev: b0c33655fad5b2e7d96a45b6210527dfb766797b)

Signed-off-by: Fabien Mahot <fabien.mahot@smile.fr>
Reviewed-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-15 08:00:41 +01:00
Thomas Roos
6c8fe83bb5 oeqa: adding selftest-hello and use it to speed up tests
Adding a selftest version of hello world to run it in tests where no download is necessary.
Also using this in several tests to speed them up.
Using the -native version wherever possible will also speed up tests a lot.

[YOCTO #11142]

(From OE-Core rev: c3f26b63934888df0e3cd563c1c2804eb78a368e)

Signed-off-by: Thomas Roos <throos@amazon.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-22 10:53:49 +01:00
Richard Purdie
ce08cf4825 lib: Add copyright statements to files without one
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-08-12 12:00:43 +01:00
Paulo Neves
de85c2f47b oeqa: test_invalid_recipe_src_uri expect parse time error
Before this commit the test expected a runtime error but the logic of
the fetcher changed so that files not found for checksumming cause a
fatal interruption of the parse, thuse never reaching the runtime error
this test expected. This commit aligns with the bitbake changes to the
fetcher.

(From OE-Core rev: 8b506bfbdd18dfdb411080f69ef5c0d416b3f2e0)

Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-15 12:22:08 +01:00
Alexandre Belloni
120fec3303 oeqa/selftest/bbtests: Update message lookup for test_git_unpack_nonetwork_fail
bitbake's output changed, update the test

(From OE-Core rev: 7e64b63f96dd1d71e263e7bbbe6591e51e98395a)

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-08 00:09:42 +01:00
Peter Kjellerstedt
68d1a56e98 recipetool: Use SPDX license identifiers
There are still a couple of cases where the license may be set as, e.g.,
"GPL" or "GPL-2.0" since there is not enough information to decide the
actual SPDX license. It is then assumed that the developer will have to
correct the information.

(From OE-Core rev: e7df51f8d2361e9fe2d67669d2e17f0a5d01004e)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-01 23:44:59 +00:00
Pavel Zhukov
da344db43c patch.py: Prevent git repo reinitialization
There were few bugs in the _isInitialized() function which might trigger
git repo to be reinitialized and patches failing to apply.

(From OE-Core rev: 80500ecda4c1bc8812e6e078b6b0db5ec46624de)

Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-25 12:41:23 +00:00
Richard Purdie
9477a309a8 oeqa/selftest/bbtests: Update after license changes
Update the test to match the renamed license in the recipe.

(From OE-Core rev: 3d50ee782e5073c055d72f114619502719a33752)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-20 16:45:25 +00:00
Richard Purdie
cb0ed5a97c oeqa/selftest/bbtests: Update to match changed bitbake output
(From OE-Core rev: 753645155b402c899080349bc741361480c4abe8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-17 17:51:03 +00:00
Richard Purdie
ae00fcd638 selftest/bbtests: Add tests for git floating tag resolution
This test ensures that where a floating tag is used for a git url, there
aren't a number of different bugs such as inconsistent source revisions
for the tag within a given build and that the recipe is reparsed at each
run to ensure the tag is checked.

A test is also added to ensure that the build fails if SRCPV (get_srcrev())
isn't used yet there is a floating tag.

(From OE-Core rev: 33554ba3c034fc31744b27392afe751d645d6c2e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-17 17:51:03 +00:00
Richard Purdie
8d556a72ec oeqa/selftest/bbtests: Use YP sources mirror instead of GNU
The gnu sources server has been known to disappear. Use the YP sources
mirror instead. If that breaks, the autobuilder is broken anyway. This
should reduce test failures from upstream network issues.

(From OE-Core rev: a5459e42f1a6be9c08f303653cc1f73514eca9ef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-20 15:29:01 +00:00
Pavel Zhukov
ae57c83f03 patch.py: Initialize git repo before patching
If PATCHTOOL="git" has been specified but workdir is not git repo
bitbake fails to apply the patches with error message:
Command Error: 'git rev-parse --show-toplevel' exited with 0  Output:
fatal: not a git repository (or any of the parent directories): .git

Fix this by initializing the repo before patching.
This allows binary git patches to be applied.

(From OE-Core rev: 6184b56a7a0fc6f5d19fdfb81e7453667f7da940)

Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-03 23:37:16 +00:00
Richard Purdie
ed18e29bcf base: Use repr() for printing exceptions
Exceptions print more clearly using repr() instead of str(), fix
in fetch and unpack tasks.

Drop part of the test which no longer makes sense after this change.

(From OE-Core rev: c94816259cc1c09746353ad26ca0c811e0c962c2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14 22:32:50 +01:00
Richard Purdie
6a276318af oeqa/selftest/bbtests: Add uuid to force build test
With hash equivalence working properly, this test breaks as it detects
an unchanged tasks and doesn't rerun subsequent tasks.

Add a uuid to the payload to ensure it doesn't ever match
equivalence and the test works as intended.

(From OE-Core rev: d19873b6b5d0068f857a8f9f3686729ba4e67f0f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-02 23:09:22 +01:00
Richard Purdie
bb6ddc3691 Convert to new override syntax
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-08-02 15:44:10 +01:00
Chris Laplante
ed794b740b cases/bbtests.py: ensure PACKAGE_CLASSES is set to RPM for bbtests.BitbakeTests.test_force_task_1
This is because the test expects to find "do_package_write_rpm" in the
bitbake output.

(From OE-Core rev: fbc75aa226e33c5ef5d3696b1c9c0f6652f23a98)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-11-24 10:27:45 +00:00
Ross Burton
9b607c58ff oeqa/selftest: use specialist assert* methods
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-23 16:30:36 +01:00
Robert Yang
c782ef5360 cases/bbtests.py: test_bitbake_g(): Check base-files rather than busybox
It checked whether busybox is in task-depends.dot after run "bitbake -g
core-image-minimal", but busybox is not a must for core-image-minimal since it
is configurable:

VIRTUAL-RUNTIME_base-utils = ""
VIRTUAL-RUNTIME_base-utils-syslog = ""
VIRTUAL-RUNTIME_base-utils-hwclock  =  ""
VIRTUAL-RUNTIME_login_manager = "shadow"
VIRTUAL-RUNTIME_syslog = ""

So the case may fail when busybox is not present, check
base-files which is more reliable.

(From OE-Core rev: f73676b07f6d8a4573a5f46c3e082831b34b7d18)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-27 13:02:16 +01:00
Chen Qi
e97ed8dcaa bbtests.py: remove recipe-depends.dot
This file is giving misleading information. There's a patch
for bitbake to remove the generation of this file. Remove
it from OEQA as well.

(From OE-Core rev: 691a45265a6a451c4bc7720ef39d99b84342822a)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-28 11:31:22 +01:00
Richard Purdie
546c32753b classes/lib: Remove bb.build.FuncFailed
Whilst seemingly a good idea, this exception doesn't really serve any purpose
that bb.fatal() doesn't cover. Wrapping exceptions within exceptions isn't
pythonic.

Its not used in many places, lets clean up those and remove usage of it
entirely. It may ultimately be dropped form bitbake entirely.

(From OE-Core rev: efe87ce4b2154c6f1c591ed9d8f770c229b044ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-06 11:24:26 +01:00
Richard Purdie
2a6094ca8c oeqa/bbtests: Tweak test bitbake output pattern matching
The output from bitbake will change slightly soon due to runqueue changes,
adpat the test now to account for both the old and new cases.

(From OE-Core rev: 78fcea74517de4793cc0ecc97bce7f5c7dcd44c0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-09 23:30:44 +01:00
Joshua Watt
17268ae841 oeqa: Test bitbake --skip-setsecene
Tests the bitbake --skip-setscene option to verify that it correctly
reuses tasks previously restored from sstate, but doesn't execute new
sstate tasks

(From OE-Core rev: af10c620b1496bf5224d0628a92cb42e9cd362a8)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-03 17:00:57 +01:00
Richard Purdie
ffae400179 meta/lib+scripts: Convert to SPDX license headers
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-09 16:31:55 +01:00
Richard Purdie
c7592b0147 oeqa: Drop OETestID
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-05-09 16:31:55 +01:00
Richard Purdie
e1e38c9bd1 lib/oe,oeqa/selftest: Fix DeprecationWarning: invalid escape sequence
Fix another load of regex escape sequence warnings for newer
python versions.

(From OE-Core rev: bd2c125bb9c362b6122e99dfdf4e1cfe12c26a90)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-16 08:19:34 +00:00
Richard Purdie
1b7eccff64 selftest/bbtests: Add test for bitbake execution outside the build directory
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>
2018-07-25 16:48:27 +01:00
Alexander Kanavin
6bb3595ec5 oe-selftest: fix tests to reflect man->man-db transition
Rather than apply a patch twice, an incorrect patch is applied
(as the new man-db recipe does not have any patches yet).

(From OE-Core rev: a8bf4da183824caa5fceaf7546db52daa05f8662)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-24 10:31:45 +00:00
Leonardo Sandoval
157c3be2ca oeqa/selftest/cases: Migrate test cases into the new oe-qa framework
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>
2017-06-06 19:02:43 +01:00