apparmor-bluez-avrcp-volume manual

medium

Image Types:
hmi-armhf / hmi-arm64 / 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. 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):
  2. $ git clone --depth 1 --branch  apertis/v2026dev1 https://gitlab.apertis.org/tests/apparmor-bluez-setup
    $ git clone --depth 1 --branch  apertis/v2026dev1 https://gitlab.apertis.org/tests/bluez-phone
  3. Copy the test directory to the target device:
  4. $ DUT_IP=<device-ip>
    $ scp -r apparmor-bluez-setup  bluez-phone user@$DUT_IP:
  5. Log into the target device:
  6. $ ssh user@$DUT_IP
  7. After log into the DUT, enter the test directory, and run respective commands mentioned in the execution steps
  8. 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:
  9. $ 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.