Skip to content
Snippets Groups Projects
Commit 5139b671 authored by Simon McVittie's avatar Simon McVittie
Browse files

apparmor-pulseaudio: run as much as possible from cwd


Auto-discovering ${top directory}/resources instead of
/usr/share/chaiwala-tests/resources means we don't have to depend
on the legacy chaiwala-tests package.

We still need to hard-code /usr/lib/apertis-tests to load the
LD_PRELOAD hack that we use to simulate a compromised pulseaudio
process, but we can reduce the test/fix cycle for the rest by
running it directly from a git checkout.

Reviewed-by: default avatarPhilip Withnall <philip.withnall@collabora.co.uk>
Signed-off-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D4382
parent ed159320
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ install:
run:
steps:
- echo -n | sudo tee /var/log/audit/audit.log
- common/run-test-in-systemd --name run-test-pulseaudio --timeout 90 /usr/lib/apertis-tests/apparmor/pulseaudio/test-pulseaudio
- common/run-test-in-systemd --name run-test-pulseaudio --timeout 90 apparmor/pulseaudio/test-pulseaudio
- sudo cat /var/log/audit/audit.log | aa_log_extract_tokens.pl PERMITTING REJECTING
parse:
......
#!/bin/bash
# vim: set sts=4 sw=4 et tw=0 :
# Default value. Can be overriden by setting it in the env.
: ${RESOURCE_DIR:="/usr/share/chaiwala-tests/resources/media"}
pkglibdir="$(cd "$(dirname "$0")/../.." && pwd)"
if [[ ${#@} -eq 1 ]] && [[ $1 =~ (normal|malicious) ]]; then
:
......@@ -19,7 +18,7 @@ test_pulseaudio() {
echo ">> 2"
pactl set-sink-volume 0 0
echo ">> 3"
paplay "${RESOURCE_DIR}/audio/generic.wav"
paplay "$pkglibdir/resources/media/audio/generic.wav"
echo ">> 4"
pactl set-sink-volume 0 50%
echo ">> 5"
......
#!/bin/bash
# vim: tw=0
TEST_DIR="${TEST_DIR:-/usr/lib/apertis-tests/apparmor/pulseaudio}"
TEST_DIR="$(cd "$(dirname "$0")" && pwd)"
# We want to use the pre-existing session bus.
export LAUNCH_DBUS="no"
......
......@@ -273,7 +273,6 @@ Depends:
apparmor (>= 2.8.0-0ubuntu5co4),
apparmor-profiles,
chaiwala-apparmor-profiles,
chaiwala-tests,
pulseaudio-utils,
Description: Functional tests for PulseAudio AppArmor profiles/abstractions
This package tests Apertis AppArmor profiles for PulseAudio.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment