Skip to content

Test apparmor-chaiwala-system does not work properly on OSTree images

Affected images versions

OSTree images for v2022 and v2023dev1

Type Arch v2021 v2022 v2023dev3
minimal/fixedfunction amd64
minimal/fixedfunction armhf
minimal/fixedfunction arm64
target/hmi amd64
target/hmi armhf x x
target/hmi arm64 x x
basesdk amd64
sdk amd64
nfs amd64
nfs armhf
nfs arm64
lxc amd64
lxc armhf
lxc arm64
image-builder
package-source-builder

Unaffected images versions

Testcase

https://qa.apertis.org/latest/apparmor-chaiwala-system.html

Steps to reproduce

Expected result

Test passes without any strange logs

Actual result

Strange logs appears

+ common/run-test-in-systemd --name=apparmor-chaiwala-system --timeout=90 ./run-test.sh
Received signal: <STARTRUN> 6_apparmor-chaiwala-system 5827464_3.1.3.25
Starting test lava.6_apparmor-chaiwala-system (5827464_3.1.3.25)
Skipping test definition patterns.
WARNING: tempfile is deprecated; consider using mktemp instead.
Error: exec failed. Test 'EXEC /bin/ls (no profile, but inherit)' was expected to 'pass'. Reason for failure 'FAILED, child did not exit normally'
Files retained in: /tmp/apparmor-chaiwala-system-ScQgRbp1uQ-tQ1bC6
/var/lib/lava-5827464/1/tests/6_apparmor-chaiwala-system/apparmor-chaiwala-system/goals/exec.sh: PASSED - /tmp/apparmor-chaiwala-system-ScQgRbp1uQ-tQ1bC6
mkdir: cannot create directory '/Applications/home/Storage/chaiwala': Permission denied
touch: cannot touch '/Applications/home/Storage/chaiwala/foo': No such file or directory
mkdir: cannot create directory '/Applications/home/Storage': Permission denied
touch: cannot touch '/Applications/home/Storage/foo': No such file or directory
Error: read failed. Test 'try to open /Applications/home/Storage/chaiwala/foo (ok)' was expected to 'pass'. Reason for failure 'FAILED: No such file or directory'
Files retained in: /tmp/apparmor-chaiwala-system-yMcTkRjtVI-sYA180
/var/lib/lava-5827464/1/tests/6_apparmor-chaiwala-system/apparmor-chaiwala-system/goals/home.sh: PASSED - /tmp/apparmor-chaiwala-system-yMcTkRjtVI-sYA180
real	0m 2.75s
user	0m 0.01s
sys	0m 0.00s
<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=apparmor-chaiwala-system RESULT=pass>
+ set +x
<LAVA_SIGNAL_ENDRUN 6_apparmor-chaiwala-system 5827464_3.1.3.25>

https://lava.collabora.co.uk/scheduler/job/5827464#L12040

Reproducibility

How often the issue is hit when repeating the test and changing nothing (same device, same image, etc.)?

Put the in the most appropriate entry:

  1. always
  2. often, but not always
  3. rarely

Impact of bug

Test does not run properly

Attachments

Root cause

  • /bin/ls is provided as a link to /usr/bin/coreutils provided by rust-coreutils: AppArmor rules needs to be adapted,
  • ping is provided as a link to /usr/bin/busybox: AppArmor rules needs to be adapted,
  • the legacy /Applications directory has been removed since #v2022 (2021/11/29) and so the test is unable to create and access subdirs of it on OSTree images.

Outcomes

Management data

This section is for management only, it should be the last one in the description.

Phabricator link: https://phabricator.apertis.org/T8668

Edited by Apertis CI robot