Skip to content

Fix apparmor's tests

The tests provided by apparmor-chaiwala-system are curently failing with the following log:

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'

tempfile is deprecated and should be replaced by mktemp

ls is now provided by /usr/bin/coreutils from rust-coreutils. This needs to adapt the generated AppArmor profile to be able to access both ls and coreutils binaries.
Moreover this also requests to add access to files used by coreutils, or other binaries provided by coreutils used during the test, e.g. like rm.

ping is now provided by /usr/bin/busybox. This needs to adapt the generated AppArmor profile to be able to access both ping and busybox binaries.

Since 2021/11/29 the /Applications folder has been removed from the Apertis images, preventing this test to be able to create and access files under this folder on OSTree images.

https://phabricator.apertis.org/T8668

Signed-off-by: Frédéric Danis frederic.danis@collabora.com

Edited by Frederic Danis

Merge request reports

Loading