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

apparmor/automated: Simplify installation and test procedure


Previously, we computed RESOURCE_DIR from a sourced shell
script fragment that is edited by `make` during install. This is
much more complexity than we actually needed, because in practice
we were locating RESOURCE_DIR from $0 anyway.

Make it a lot simpler by removing the Makefile, not invoking a
sub-make in the apparmor/automated/ directory, and not indirecting
through sourced shell script fragments to calculate RESOURCE_DIR.

TESTDATADIR, TESTLIBDIR and MEDIA_RESOURCE_DIR are not used in this
particular test. We can make that very obvious by just deleting them.

The Makefile previously installed into both /usr/lib/apertis-tests
(via COPY; packaged into apertis-tests) and /usr/share/chaiwala-tests
(via SUBDIRS; packaged into the legacy chaiwala-tests package).
The official test instructions on the Apertis wiki called for this
test to be run via /usr/share/chaiwala-tests until very recently,
so install a transitional symbolic link in chaiwala-tests.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
Reviewed-by: default avatarEmanuele Aina <emanuele.aina@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D6917
parent 2502577d
Branches 18.03
No related tags found
No related merge requests found
...@@ -12,7 +12,6 @@ SUBDIRS = \ ...@@ -12,7 +12,6 @@ SUBDIRS = \
apparmor/tumbler \ apparmor/tumbler \
apparmor/ofono \ apparmor/ofono \
apparmor/pulseaudio \ apparmor/pulseaudio \
apparmor/automated/ \
bluez/ \ bluez/ \
boot-performance/automated/ \ boot-performance/automated/ \
cgroups/automated/ \ cgroups/automated/ \
......
# vim: set ts=8 tw=80 :
progs :=
include ../../global-config.mk
all: $(progs)
get-deps:
$(APT_GET) install iputils-ping
install: .INSTALL
clean: .CLEAN
. "${TESTDIR}/inherit-config.sh"
APPARMOR_PROFILES_DIRS=(
"/etc/apparmor.d"
"/etc/apparmor.d/local"
"/etc/apparmor.d/tunables")
AUDIT_LOG="/var/log/audit/audit.log"
# This file should be symlinked inside your test directory,
# and sourced from config.sh
# It will be modified and copied to the install directory by make
. "${TESTDIR}/../../common/common.sh"
# These variables get modified by `make` during install
TESTDATADIR="${TESTDIR}"
TESTLIBDIR="${TESTDIR}"
RESOURCE_DIR="$(_realpath ${TESTDIR}/../../resources)"
# These are derived from the above
MEDIA_RESOURCE_DIR="${RESOURCE_DIR}/media"
...@@ -19,7 +19,14 @@ while [ "$#" -gt 0 ]; do ...@@ -19,7 +19,14 @@ while [ "$#" -gt 0 ]; do
done done
TESTDIR=$(cd $(dirname $0); pwd; cd - &>/dev/null) TESTDIR=$(cd $(dirname $0); pwd; cd - &>/dev/null)
. "${TESTDIR}/config.sh" . "${TESTDIR}/../../common/common.sh"
APPARMOR_PROFILES_DIRS=(
"/etc/apparmor.d"
"/etc/apparmor.d/local"
"/etc/apparmor.d/tunables")
AUDIT_LOG="/var/log/audit/audit.log"
RESOURCE_DIR="$(cd "${TESTDIR}/../../resources" && pwd)"
######### #########
# Setup # # Setup #
......
usr/lib/apertis-tests/apparmor/automated usr/share/chaiwala-tests/apparmor/automated
usr/lib/apertis-tests/cgroups usr/lib/chaiwala-tests/cgroups usr/lib/apertis-tests/cgroups usr/lib/chaiwala-tests/cgroups
usr/lib/apertis-tests/dbus/dos-match-rules usr/share/chaiwala-tests/dbus-dos-match-rules/manual usr/lib/apertis-tests/dbus/dos-match-rules usr/share/chaiwala-tests/dbus-dos-match-rules/manual
usr/lib/apertis-tests/dbus/dos-reply-time usr/share/chaiwala-tests/dbus-dos-reply-time/manual usr/lib/apertis-tests/dbus/dos-reply-time usr/share/chaiwala-tests/dbus-dos-reply-time/manual
dir_to_symlink /usr/lib/chaiwala-tests/apparmor/automated /usr/lib/apertis-tests/apparmor/automated
dir_to_symlink /usr/lib/chaiwala-tests/cgroups /usr/lib/apertis-tests/cgroups dir_to_symlink /usr/lib/chaiwala-tests/cgroups /usr/lib/apertis-tests/cgroups
symlink_to_dir /usr/share/chaiwala-tests/dbus-dos-match-rules/manual /usr/lib/apertis-tests/dbus/dos-match-rules symlink_to_dir /usr/share/chaiwala-tests/dbus-dos-match-rules/manual /usr/lib/apertis-tests/dbus/dos-match-rules
symlink_to_dir /usr/share/chaiwala-tests/dbus-dos-reply-time/manual /usr/lib/apertis-tests/dbus/dos-reply-time symlink_to_dir /usr/share/chaiwala-tests/dbus-dos-reply-time/manual /usr/lib/apertis-tests/dbus/dos-reply-time
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