Commit Graph

19 Commits

Author SHA1 Message Date
Baruch Siach
0c9d83138e oeqa/selftest/overlayfs: test read-only rootfs
Use the read-only squashfs filesystem to test the read-only case.

(From OE-Core rev: 1a61da196f014dc34a998d3e46f03abc79ebc84d)

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-04 14:05:03 +01:00
Richard Purdie
191645f746 oeqa/selftest/overlayfs: Fix whitespace
My previous fix missed out whitespace with the append, fix that.

(From OE-Core rev: 393c4459851642b8b7e93ff303d6526cd5c97b22)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

    #

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20 12:02:07 +00:00
Richard Purdie
2ad6a0be02 oeqa/selftest/overlayfs: Don't overwrite DISTRO_FEATURES
Whilst debugging an autobuilder failure, I wondered why it was rebuilding qemu-system-native
instead of reusing from sstate. The reason was it was overwriting DISTRO_FEATURES,
in this case removing opengl which caused much to rebuild.

The test doesn't need that so don't do it.

(From OE-Core rev: fdcc011608fd9558a081d0ace3eaf7192d9fcaef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-20 07:47:00 +00:00
Richard Purdie
67a8dcabda selftest: Ensure usrmerge is enabled with systemd
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-08-11 13:22:01 +01:00
Alexander Kanavin
03e900a748 selftest/overlayfs: enable systemd via INIT_MANAGER
Latest systemd version needs the full set of settings enabled
by that (if also r/o rootfs is enabled), and refuses to boot
otherwise.

(From OE-Core rev: 16f7661000a50e58d512a5d47794c5f8be2c49e6)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-11 00:08:40 +00:00
Ross Burton
92c1e7300f oeqa/selftest/overlayfs: overlayfs: skip x86-specific tests
For now, not all machines have a default wks file, so mark the tests
which need a wks as being specific to qemux86-64.

(From OE-Core rev: 152f1a8cdf698b71c956e9910911dcb141a1f5be)

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
Vyacheslav Yurkov
6cd5db1e62 oeqa/selftest: Add lower layer test for overlayfs-etc
Place a test file on the /etc by means of overlayfs-user recipe.
Perform QA checks to make sure that:
- When lower layer is exposed, that it's read-only to avoid undefined behavior
- By default lower layer is not exposed

(From OE-Core rev: 2fc742178675598208b400d9889a1681249d7eea)

Signed-off-by: Vyacheslav Yurkov <v.yurkov@precitec.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-09 12:24:43 +01:00
Vyacheslav Yurkov
9277742901 oeqa/selftest: drop image_feature test from overlayfs
The test checked the incorrect class use with INHERIT. This
functionality is now covered by bitbake

(From OE-Core rev: ec4799b7230ed7e99cf2b13fdf8f6d59a0e12795)

Signed-off-by: Vyacheslav Yurkov <v.yurkov@precitec.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-09 12:24:43 +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
Richard Purdie
88c200c751 selftest/imagefeatures/overlayfs: Always append to DISTRO_FEATURES
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-05-16 23:19:18 +01:00
Claudius Heine
78b4102922 classes: rootfs-postcommands: add skip option to overlayfs_qa_check
The overlayfs_qa_check checks if the current root file system has a
mount configured for each overlayfs, when the overlayfs class is used.

However there are certain instances where this mount point is created at
runtime and not static in a fstab entry or systemd mount unit.

One such case would be if overlayfs-etc is used, where the device is
mounted in the preinit script and not via a mount unit or fstab entry.

However there are other possibilities for this as well, like startup
scripts that support a dynamic partition layout. For instance when
systemd-repart is used.

This adds the `OVERLAYFS_QA_SKIP` variable, which allows to define QA
skips via its flags. In principle it supports multiple QA skip flags
separated by whitespace, but only one (`mount-configured`) is
implemented here. To skip this QA check simply add `mount-configured` to
the flag of `OVERLAYFS_QA_SKIP` with the same name. For instance if a
overlayfs is configured as:

	OVERLAYFS_MOUNT_POINT[data] = "/data"

Skipping this QA check can be done by setting:

	OVERLAYFS_QA_SKIP[data] = "mount-configured"

Also add a testcase and fix a typo (fstat -> fstab).

(From OE-Core rev: 2ce9173169a2a86392c4a85fe9be7fbbd7353b7f)

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-03 17:49:50 +01:00
Ross Burton
416cce968d oeqa/selftest: tag tests that use runqemu
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-04-01 23:11:37 +01:00
Stefan Herbrechtsmeier
6d715aafec oeqa: selftest: overlayfs: add test for image with fstab entry
(From OE-Core rev: 67f1959a46beec5edf133f2f8b02635feea7e599)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-04 17:14:15 +00:00
Stefan Herbrechtsmeier
2126584d61 classes: rootfs-postcommands: include /etc/fstab in overlayfs_qa_check
The systemd init manager support mount point configuration via mount
units and /etc/fstab. 'Mounts listed in /etc/fstab will be converted
into native units dynamically at boot and when the configuration of
the system manager is reloaded. In general, configuring mount points
through /etc/fstab is the preferred approach.' [1]

Read mount points from /etc/fstab to determine dynamic mount units.

[1] https://www.freedesktop.org/software/systemd/man/systemd.mount.html

(From OE-Core rev: 9db988dae6dbf6da7b066728bc13b59a5c45b75c)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-04 17:14:15 +00:00
Vyacheslav Yurkov
5221ca9296 oeqa/selftest: unit tests for overlayfs-etc
(From OE-Core rev: 3ca1ce7a3779d0b875385eb4045bd5a51dc839da)

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-12 11:27:24 +00:00
Vyacheslav Yurkov
ae56b39021 oeqa/selftest: overlayfs helper function
Move helper functions out of class scope so they can be used in other tests

(From OE-Core rev: 439a5a575b8ca27910431c71f01bf310122ff7ab)

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-12 11:27:24 +00:00
Vyacheslav Yurkov
39f3274dd5 oeqa/selftest: extend overlayfs test
Test that overlayfs.bbclass generates one systemd unit, that
applications can set dependencies on, and that this unit mounts all
required overlays

(From OE-Core rev: b0e335268de78cfe163f3cfdc0209ae26309fc78)

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30 22:31:52 +01:00
Vyacheslav Yurkov
8eb35a9558 oeqa/selftest: refactor common functions
(From OE-Core rev: 66de5de793f3c86502d193f7e3abc8fa17642369)

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30 22:31:52 +01:00
Vyacheslav Yurkov
0413829f61 oeqa/selftest: overlayfs unit tests
Unit tests for overlayfs.bbclass

(From OE-Core rev: b393e1982090063d9d0610fdcfd3601e78a501c0)

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-12 06:26:15 +01:00