- Image Types:
- basesdk-amd64 / minimal-armhf-internal / minimal-armhf / minimal-arm64 / minimal-amd64 / sdk-amd64 / target-armhf-internal / target-armhf / target-amd64
- Image Deployment:
Show some main AppArmor functionalities, like transitions, net access or resource permissions, under the form of tests.
- Ensure Rootfs is remounted as read/write.
- Install dependencies
- Restart the system to restore the filesystem state to read-only before running the test.
- Clone the tests repository from another computer (Note that the branch being tested may change depending on the release, please make sure to clone the correct branch for the release in question):
- Copy the test directory apertis-tests to the target device:
- Log into the target device:
$ sudo mount -o remount,rw /
$ sudo apt install bash apparmor-demo busybox apertis-tests-apparmor-report
$ sudo reboot
$ git clone --branch apertis/v2021pre https://gitlab.apertis.org/pkg/apertis-tests.git
$ scp -r apertis-tests user@$DUT_IP:
$ ssh user@$DUT_IP
- Enter test directory:
- Execute the following commands:
$ cd apertis-tests
$ common/run-test-in-systemd --name=run-lava_run_tests --timeout=90 /usr/lib/apparmor-demo/lava_run_tests
$ sudo journalctl -b -t audit -o cat | /usr/bin/aa_log_extract_tokens.sh ALLOWED DENIED
The /usr/lib/apparmor-demo/lava_run_tests script should return 0. The return value indicates the number of tests which failed. A similar output will be shown:
/usr/lib/apparmor-demo/exec.sh: PASSED - /tmp/apparmor-demo/sdtest.6406-11853-I7WUoO
/usr/lib/apparmor-demo/exec_env.sh: FAILED - /tmp/apparmor-demo/sdtest.6704-7180-0VTgAJ
- Some of the tests included are taken from AppArmor upstream, some are locally developed.