apparmor-bluez-avrcp-volume manual

medium

Image Types:
hmi-armhf / hmi-amd64
Image Deployment:
APT, OSTree
Type:
functional

Description

Test AppArmor profile for Bluez AVRCP volume up and down commands.


Resources

  • A Bluetooth adapter.
  • An A2DP Source and AVRCP capable phone (https://www.apertis.org/reference_hardware/extras/)

Pre Conditions

  1. From a PC, download and unpack the test data tarball from the gitlab test repository:
  2. $ wget https://gitlab.apertis.org/tests/apparmor-bluez-setup/-/archive/apertis/v2023dev2/apparmor-bluez-setup.tar.gz
    $ tar -xvf apparmor-bluez-setup.tar.gz
  3. Copy the apparmor-bluez-setup-* folder to the target device:
  4. $ DUT_IP=<device-ip>
    $ scp -r apparmor-bluez-setup-* user@$DUT_IP:
  5. Log into the target device:
  6. $ ssh user@$DUT_IP
  7. After log into the DUT, enter the test directory
  8. $ cd apparmor-bluez-setup-*
  9. Note that the tarball may change depending on the release/branch being tested, please make sure to download the correct tarball for the release in question.
  10. From a PC, download and unpack the test data tarball from the gitlab test repository:
  11. $ wget https://gitlab.apertis.org/tests/bluez-phone/-/archive/apertis/v2023dev2/bluez-phone.tar.gz
    $ tar -xvf bluez-phone.tar.gz
  12. Copy the bluez-phone-* folder to the target device:
  13. $ DUT_IP=<device-ip>
    $ scp -r bluez-phone-* user@$DUT_IP:
  14. Log into the target device:
  15. $ ssh user@$DUT_IP
  16. After log into the DUT, enter the test directory
  17. $ cd bluez-phone-*
  18. Note that the tarball may change depending on the release/branch being tested, please make sure to download the correct tarball for the release in question.
  19. Please note that connman disables bluetooth by default on a fresh image. If it's already enabled, connmanctl will give an "In progress" error that may be ignored. To enable the device:
  20. $ connmanctl enable bluetooth

Execution Steps

  1. First ensure that the bluez-avrcp-volume test case is passing before executing the apparmor-bluez-avrcp-volume test one (otherwise false-negative might occur):
  2. Ensure the audio manager is activated:
  3. $ pactl stat
  4. Run btmon before any connection happens:
  5. $ sudo btmon  | grep -A4 'AV/C: Control'
  6. Execute the test suite in another terminal:
  7. $ cd $HOME/bluez-phone* ; ./bluez-avrcp-volume.sh
  8. After verifying that the bluez-avrcp-volume test is passing, open a new terminal and run the following. Do not yet answer to the question.
  9. $ cd $HOME/apparmor-bluez-setup-*; ./aa_get_complaints.sh
  10. Now, run the bluez-avrcp-volume test case again in the previous terminal.
  11. $ cd $HOME/bluez-phone ; ./bluez-avrcp-volume.sh
  12. After the bluez-avrcp-volume test ended, answer y to check for complaints.

Expected

When the TC has been run, once the log collection script finishes check its output.

On Success, aa_get_complaints.sh will find no complaints:

[...snip useless output...]

>>> Checking for apparmor complaints ...

>>> No complaints found!

If something goes wrong, the output will be similar to:

[...snip useless output...]

>>> Complaints found, creating report ...

aa-dump_20180710-100931/

aa-dump_20180710-100931/complaint_tokens.log

aa-dump_20180710-100931/audit.log

aa-dump_20180710-100931/ps_aux.log

aa-dump_20180710-100931/uname.log

aa-dump_20180710-100931/journalctl.log

aa-dump_20180710-100931/image_version

aa-dump_20180710-100931/os-release

>>> Report created as /home/chaiwala/aa-dump_20180710-100931.tar.bz2

In this case file a bug report against AppArmor attaching the tar.bz2 file created.