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
- From a PC, download and unpack the test data tarball from the gitlab test repository:
- Copy the apparmor-bluez-setup-* folder to the target device:
- Log into the target device:
- After log into the DUT, enter the test directory
- 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.
- From a PC, download and unpack the test data tarball from the gitlab test repository:
- Copy the bluez-phone-* folder to the target device:
- Log into the target device:
- After log into the DUT, enter the test directory
- 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.
- 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:
$ wget https://gitlab.apertis.org/tests/apparmor-bluez-setup/-/archive/apertis/v2026dev1/apparmor-bluez-setup.tar.gz
$ tar -xvf apparmor-bluez-setup.tar.gz
$ DUT_IP=<device-ip>
$ scp -r apparmor-bluez-setup-* user@$DUT_IP:
$ ssh user@$DUT_IP
$ cd apparmor-bluez-setup-*
$ wget https://gitlab.apertis.org/tests/bluez-phone/-/archive/apertis/v2026dev1/bluez-phone.tar.gz
$ tar -xvf bluez-phone.tar.gz
$ DUT_IP=<device-ip>
$ scp -r bluez-phone-* user@$DUT_IP:
$ ssh user@$DUT_IP
$ cd bluez-phone-*
$ connmanctl enable bluetooth
Execution Steps
- 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):
- Ensure the audio manager is activated:
- Run btmon before any connection happens:
- Execute the test suite in another terminal:
- 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.
- Now, run the bluez-avrcp-volume test case again in the previous terminal.
- After the bluez-avrcp-volume test ended, answer y to check for complaints.
$ pactl stat
$ sudo btmon | grep -A4 'AV/C: Control'
$ cd $HOME/bluez-phone ; ./bluez-avrcp-volume.sh
$ cd $HOME/apparmor-bluez-setup ; ./aa_get_complaints.sh
$ cd $HOME/bluez-phone ; ./bluez-avrcp-volume.sh
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.