apparmor-bluez-avrcp-volume manual

medium

Image Types:
target-armhf-internal / target-amd64
Image Deployment:
APT
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 (Galaxy Nexus)

Pre Conditions

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

  3. Install dependencies
  4. $ sudo apt install chaiwala-tests apertis-tests-apparmor-report

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

  7. 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:
  8. $ connmanctl enable bluetooth

  9. Start simple agent:
  10. $ /usr/lib/chaiwala-tests/bluez/simple-agent -y

  11. Pair both devices initiating from the phone side
  12. Pay attention to the simple-agent window as it requires input during the pairing process.

Execution Steps

  1. Be sure that the bluez-avrcp-volume TC passes before executing this one, otherwise false-negative might occur.
  2. Ensure Pulse Audio is activated:
  3. $ pactl stat

  4. Clean the audit.log file, so no old entries are evaluated:
  5. $ echo -n | sudo tee /var/log/audit/audit.log

  6. Get the bluetooth device address by running hcitool scan and in another terminal, execute:
  7. $ /usr/lib/chaiwala-tests/bluez/test-avrcp.py -i hci0 <device_address>

  8. Collect AppArmor auditd logs, by running:
  9. $ aa_get_complaints.sh

  10. And press 'y' when asked, so the script can proceed.

Expected

On Success the script will find no complaints:

[...snip uselss output...]

>>> No complaints found!

While if something goes wrong, the output will be similar to:

[...snip useless output...]

>>> Complaints found, creating report ...

aa-dump_20130222-100931/

aa-dump_20130222-100931/complaint_tokens.log

aa-dump_20130222-100931/audit.log

aa-dump_20130222-100931/ps_aux.log

aa-dump_20130222-100931/uname.log

aa-dump_20130222-100931/chaiwala_version

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

In this case file a bug report against development/apparmor attaching the tar.bz2 file created.