apparmor-geoclue automated

medium

Image Types:
basesdk-amd64 / minimal-armhf-internal / minimal-armhf / minimal-arm64 / minimal-amd64 / sdk-amd64 / target-armhf-internal / target-amd64
Image Deployment:
APT
Type:
functional

Description

Test that geoclue apparmor profiles are working properly.


Pre Conditions

  1. Ensure Rootfs is remounted as read/write.
  2. $ sudo mount -o remount,rw /

  3. Install dependencies
  4. $ sudo apt install busybox apertis-tests-apparmor-geoclue auditd geoclue-2.0 geoclue-2-demo

  5. Restart the system to restore the filesystem state to read-only before running the test.
  6. $ sudo reboot

  7. 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):
  8. $ git clone --branch apertis/v2020dev0 https://gitlab.apertis.org/infrastructure/apertis-tests.git

  9. Copy the test directory apertis-tests to the target device:
  10. $ DUT_IP=<device-ip>

    $ scp -r apertis-tests user@$DUT_IP:

  11. Log into the target device:
  12. $ ssh user@$DUT_IP


Execution Steps

  1. Enter test directory:
  2. $ cd apertis-tests

  3. Execute the following commands:
  4. $ echo -n | sudo tee /var/log/audit/audit.log

    $ common/run-test-in-systemd --name run-test-geoclue --timeout 90 /usr/lib/apertis-tests/apparmor/geoclue/test-geoclue

    $ sudo journalctl -b -t audit -o cat | /usr/bin/aa_log_extract_tokens.sh ALLOWED DENIED


Expected

Both tests should report pass and not fail:

geoclue.normal.expected: pass

geoclue.malicious.expected: pass

Notes

  • The results of the tests printed to the standard output are enough to determine whether they passed or fail.
  • If you get a failure and need to report a bug please run sudo watch-aa on a terminal and run the case that is failing (separately, if both), and add the logs you get to the bug report.