Commit Graph

23 Commits

Author SHA1 Message Date
Mark Hatle
4462724cab selftest-hardlink: Add additional test cases
Additional test cases for debug symlink generation both binaries
and static libraries.

This also has the side effect of testing for race conditions in the
hardlink debug generation and stripping.

(From OE-Core rev: 7171f41c07a39a7543bb64f075d38b8e74563089)

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-22 16:53:06 +01:00
Fawzi KHABER
3ae3669468 oeqa/selftest/cases/package.py: adding unittest for package rename conflicts
This Unittest tries to rename a package, using an already used name and
fails on do_package.

Reviewed-by: Yoann CONGAL <yoann.congal@smile.fr>
(From OE-Core rev: c3fe173d5196506d89aa464ba56aabcf581a60db)

Signed-off-by: Fawzi KHABER <fawzi.khaber@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-30 12:32:30 +01:00
Ross Burton
31926bd1c1 oeqa/selftest/package: improve test_preserve_ownership
This test was failing very oddly in qemuarm64 runs. Rewriting the test
to be clearer and less fragile fixed it.

(From OE-Core rev: a26fc7c2119df12468b0a834de6fe67aa9c86085)

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-11 13:43:40 +00:00
Ross Burton
8e72283f54 oeqa/selftest/package: generalise test_gdb_hardlink_debug()
When the trivial test binary, which just calls printf(), is compiled for
aarch64 with -O2 -D_FORTIFY=2 (as is the default configuration), gdb
resolves main() to the inlined printf() wrapper in stdio2.h instead of
main.c, so the test fails.

Presumably, this is due to debugging being unreliable with -O2. Solve
this problem by not caring where the main() breakpoint resolves to, just
check that it was resolved at all.

(From OE-Core rev: c51c12154851d04a81c8fbe190e712b3cd8dc941)

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-11 13:43:40 +00: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
Ross Burton
668753b8ed oeqa/selftest: remove unused imports
(From OE-Core rev: 7ef7b03eeefc0a9911fd62c73e346fa5aeeb09eb)

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-01 23:11:37 +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
Trevor Woerner
50734c7f71 selftest-chown: add test for fifos
Verify that fifos are properly handled by the build system.

(From OE-Core rev: 53988b6389ce618d4cff52bd09ae91108beca354)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-12-30 14:01:07 +00:00
Daisuke Yamane
caa530a277 selftest/package: Add test to ensure ownership is preserved
Yocto Bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13806

Add test_preserve_ownership to selftest/package.
This test creates a file, a directory and a symbolic link and changes ownership,
then compares with them installed in rootfs to ensure ownership is preserved.

[Test without a commit 'bitbake: lib/bb/utils.py: Preserve ownership of symlink']
| 2020-03-14 10:01:14,519 - oe-selftest - INFO - test_preserve_ownership (package.PackageTests)
| 2020-03-14 10:56:44,612 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/file
| 2020-03-14 10:56:44,770 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/dir
| 2020-03-14 10:56:44,822 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/symlink
| 2020-03-14 10:56:44,879 - oe-selftest - ERROR - Incrrect ownership /etc/selftest-chown/symlink [root:root]
| 2020-03-14 10:56:45,884 - oe-selftest - INFO -  ... FAIL

[Test with a commit 'bitbake: lib/bb/utils.py: Preserve ownership of symlink']
| 2020-03-14 10:58:49,599 - oe-selftest - INFO - test_preserve_ownership (package.PackageTests)
| 2020-03-14 11:51:39,947 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/file
| 2020-03-14 11:51:40,013 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/dir
| 2020-03-14 11:51:40,063 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/symlink
| 2020-03-14 11:51:41,118 - oe-selftest - INFO -  ... ok

(From OE-Core rev: 88c1824468109d0f78d5fee7b71baa1f3944db7f)

Signed-off-by: Daisuke Yamane <daisuke.yamane@cybertrust.co.jp>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26 14:00:50 +01:00
Ross Burton
42fe4c9068 oeqa/selftest/package: mark string as raw
This regex uses \ so is actually parsed incorrectly, mark it up as a raw
string.

(From OE-Core rev: 120e687bad03ad2cf4df4092e8a3f35a569e09f4)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-28 23:25:41 +00:00
Alistair Francis
ebedc1511d gdb: Upgrade from 8.2.1 to 8.3
Bump GDB and change the oeqa selftest expression to allow ptests to
pass.

(From OE-Core rev: f31986ed9f82c48834b2f25979c93697228acbf7)

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-21 12:56:33 +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
Ola x Nilsson
e798efcc5b selftest/package: Correct format arguments in test_gdb_hardlink_debug
(From OE-Core rev: 7c2c9b876334cc7357f818c3b3744fc97987e38f)

Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-13 16:32:21 +00:00
Hongxu Jia
1c048479af selftest/package: Add package separated debug symbols hardlink test
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>
2018-08-28 10:30:28 +01:00
Richard Purdie
79d72d9045 selftest/package: Improve test to cover sparseness and hardlinking from sstate
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>
2018-08-15 09:44:33 +01:00
Richard Purdie
20c8be711f selftest/package: Add test to ensure sparse files are preserved
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>
2018-08-15 09:44:33 +01:00
Richard Purdie
fc77dc63fe selftest/package: Fix hardlink test when using sstate
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>
2018-08-07 12:13:03 +01:00
Richard Purdie
318595754b oeqa/selftest: Add package hardlink test
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>
2018-07-31 22:47:35 +01:00
Richard Purdie
9a53d315ef oeqa/selftest/package: Use setUpLocal, not setUp
The main setUp function needs to be called and tests are meant to
define setUpLocal. For some reason this one didn't leading to errors
with recent code changes. Fix it.

(From OE-Core rev: aef07f09e224485539d8bc66ddac8bf394e4092a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-16 13:21:34 +01:00
Aníbal Limón
f4a978485f selftest/cases/package: Call parent setUpClass method
Since config paths are now passed in Test context the setUpClass
method is expected to be call.

(From OE-Core rev: 7281c995ff2b009c3fb23c7af1d91fe106ca8f87)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-21 08:44:25 +01:00
Jose Perez Carranza
ab0780dfea selftest: Add Testopia ID to test cases
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-23 11:44:12 +01: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