Commit e6c93c2b authored by Sjoerd Simons's avatar Sjoerd Simons

Initial commit

parents
{
"phabricator.uri": "https:\/\/phabricator.apertis.org\/",
"lint.engine": "ArcanistConfigurationDrivenLintEngine"
}
{
"linters": {
"pep8-default": {
"type": "pep8",
"include": "(\\.py$)"
}
}
}
*.swp
*~
a.out
*.so
*.so.*
*.o
apparmor/goals/exec
apparmor/goals/read
apparmor/session-lockdown/MxLauncher
apparmor/session-lockdown/test-launcher
apparmor/webkit-clutter/webkit-clutter
/build/
/install/
/sdk/automated/backtrace
/sdk/automated/fib
/sdk/automated/gmon.out
/sdk/automated/leak
/sdk/automated/linty
/sdk/automated/multipath
/sdk/automated/multipath.c.gcov
/sdk/automated/multipath.gcda
/sdk/automated/multipath.gcno
/sdk/automated/sysprof-out.xml
# Misc compiled files
/clutter-zoom/clutter-zoom-test
/emulated-soft-keys/keyevent_waiter
/contacts/folks-extended-info
/contacts/folks-sync-only
# gettext .gmo files
*.gmo
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
all:
pkglibdir = /usr/lib/apertis-tests
SUBDIRS = \
apparmor/goals \
apparmor/dbus \
apparmor/folks \
apparmor/geoclue \
apparmor/gstreamer1.0 \
apparmor/libreoffice \
apparmor/tracker \
apparmor/tumbler \
apparmor/webkit-clutter \
apparmor/ofono \
apparmor/pulseaudio \
apparmor/session-lockdown \
apparmor/automated/ \
bluez/ \
boot-performance/automated/ \
btrfs/automated/ \
cgroups/automated/ \
clutter-bigger-reactive-area/ \
clutter-i18n/manual/ \
clutter-performance/ \
clutter-rotate/ \
clutter-transparent-stage/ \
clutter-zoom/ \
common/ \
dbus-dos-match-rules/manual/ \
dbus-dos-reply-time/manual/ \
emulated-soft-keys/ \
firewall/automated/ \
geoclue/automated/ \
gettext/automated/ \
glib/automated/ \
grilo/automated/ \
gstreamer-buffering/automated/ \
gupnp/automated/ \
libreoffice/automated/ \
librest/automated/ \
libsoup/automated/ \
resources/ \
sqlite/automated/ \
tracker/automated/ \
tracker-configuration/automated/ \
tracker/manual/ \
traffic-control/manual/ \
tumbler/automated/ \
v4l/automated/ \
sdk/automated/ \
connman \
contacts \
gstreamer-decode \
gstreamer-viv-direct-texture/automated/ \
x-out-of-screen-events \
telepathy \
rfkill \
$(NULL)
# Bits that are architecture-independent and can just be copied
COPY = \
$(wildcard apparmor/*.sh) \
$(wildcard apparmor/*.yaml) \
apparmor/folks \
apparmor/run-aa-test \
clutter \
common \
folks \
misc \
predeployed-misc \
sdk \
templates \
$(NULL)
all:
for path in $(SUBDIRS); do \
if test -x $$path/autogen.sh; then \
( cd $$path && ./autogen.sh --prefix=/usr ) || exit $$?; \
fi; \
$(MAKE) -C $$path all || exit $$?; \
done
$(patsubst %,install-%,$(COPY)): install-%:
install -d $(DESTDIR)$(dir $(pkglibdir)/$*)
cp -a $* $(DESTDIR)$(dir $(pkglibdir)/$*)
install: $(patsubst %,install-%,$(COPY))
install -d $(DESTDIR)$(pkglibdir)
install -d $(DESTDIR)$(pkglibdir)/apparmor
install -d $(DESTDIR)/usr/lib/chaiwala-apparmor-tests
for path in $(SUBDIRS); do $(MAKE) -C $$path install || exit $$?; done
clean:
for path in $(SUBDIRS); do $(MAKE) -C $$path clean || exit $$?; done
check:
misc/syntax-check.py
= Templates for Apertis tests =
The templates contains the set of templates we use for lava testing for Apertis
and a set of default profiles. These are intended to be used with the lqa tool,
available from: http://cgit.collabora.com/git/singularity/tools/lqa.git/
For lqa usage see the readme in the lqa source tree, minimal examples
for Apertis below:
To submit e.g. a minimal boot test to minnowboard (daily 15.09) targets use:
lqa submit -g templates/profiles.yaml \
-p apertis-15.09-daily-minnowboard-max-target \
-t image_date:150624-001801 \
-t image_version:14.00.25 \
templates/minimal-tpl.json
The image_date variable specifies the image data of the image to use, see
https://images.apertis.org/daily/15.09/ for the list of
available images.
The image_version variable is also part of the image's filename.
The first part is incremented every quarter, the second part is 00
for daily builds or 01 for quarterly releases and the third is the
ISO week number (date +%W).
Note that lqa can replace any variable (either json items or {{variable}}) this
can for example be used to change the git-repo value to non-standard repository
to test tests before merging them for example:
lqa submit -g templates/profiles.yaml \
-p apertis-15.09-daily-minnowboard-max-target \
-t image_date:150624-001801 \
-t image_version:14.00.25 \
-t git-repo:https://...@git.apertis.org/git/users/me/apertis-tests.git \
-t revision:test \
templates/minimal-tpl.json
For developer testing, some machines have a predeployed image available, saving
the time to re-deploy images on every test boot. An example minimal template
for that is available in templates/minimal-predeployed-1503-target-tpl.json (at
the time of this writing only setup for minnowboard max). Note that this images
are fully ephemeral, all changes to the filesystem will disappear on each boot
metadata:
name: apparmor-basic-profiles
format: "Lava-Test-Shell Test Definition 1.0"
description: "Test basic apparmor profiles. Only parsing and
syntax of profiles are tested for now."
maintainer: "luis.araujo@collabora.co.uk"
scope:
- functional
devices:
- i386
environment:
- lava-test-shell
install:
deps:
- busybox
- chaiwala-tests
run:
steps:
- common/run-test-in-systemd --user=user --timeout=90 --basename /usr/share/chaiwala-tests/apparmor/automated/run-test.sh
parse:
pattern: ^(?P<test_case_id>[a-zA-Z0-9_\-\./]+):\s*(?P<result>pass|fail|skip|unknown)$
metadata:
name: apparmor-chaiwala-system
format: "Lava-Test-Shell Test Definition 1.0"
description: "Run chaiwala-apparmor test suite"
maintainer: "luis.araujo@collabora.co.uk"
scope:
- functional
devices:
- i386
environment:
- lava-test-shell
install:
deps:
- busybox
- apertis-tests-apparmor-goals
- apertis-tests-apparmor-report
run:
steps:
- echo -n | sudo tee /var/log/audit/audit.log
- common/run-test-in-systemd --timeout=90 --basename /usr/lib/apertis-tests/apparmor/goals/lava_run_tests
- sudo cat /var/log/audit/audit.log | aa_log_extract_tokens.pl PERMITTING REJECTING
parse:
fixupdict:
FAILED: fail
PASSED: pass
SKIP: skip
pattern: ^(?P<test_case_id>.+)\:\s(?P<result>PASS|pass|FAIL|fail|SKIP|skip|UNKNOWN|unknown)\s-
metadata:
name: apparmor-dbus
format: "Lava-Test-Shell Test Definition 1.0"
description: "Tests that the D-Bus mediation in AppArmor works properly."
maintainer: "luis.araujo@collabora.co.uk"
scope:
- functional
devices:
- i386
environment:
- lava-test-shell
install:
deps:
- busybox
- apertis-tests-apparmor-dbus
- apertis-tests-apparmor-report
run:
steps:
- echo -n | sudo tee /var/log/audit/audit.log
- "common/run-test-in-systemd --name=load-profiles --timeout=90 apparmor_parser --reload --skip-cache /etc/apparmor.d/usr.lib.apertis-tests.apparmor.dbus.dbus-*.py"
- "common/run-test-in-systemd --name=run-test-dbus --timeout=90 /usr/lib/apertis-tests/apparmor/dbus/test-dbus"
- sudo cat /var/log/audit/audit.log | aa_log_extract_tokens.pl PERMITTING REJECTING
parse:
pattern: ^(?P<test_case_id>[\w\-\.]+):\s(?P<result>PASS|pass|FAIL|fail|SKIP|skip|UNKNOWN|unknown)$
metadata:
name: apparmor-folks
format: "Lava-Test-Shell Test Definition 1.0"
description: "Run apparmor-folks test suite"
maintainer: "luis.araujo@collabora.co.uk"
scope:
- functional
devices:
- i386
environment:
- lava-test-shell
install:
deps:
- apparmor
- apparmor-profiles
- busybox
- chaiwala-apparmor-profiles
- apertis-tests-apparmor-report
- chaiwala-tests
- evolution-data-server
- folks-tools
- syncevolution
- python3
run:
steps:
- echo -n | sudo tee /var/log/audit/audit.log
- common/run-test-in-systemd --name=run-test-folks --timeout=300 apparmor/folks/test-folks
- sudo cat /var/log/audit/audit.log | aa_log_extract_tokens.pl PERMITTING REJECTING
parse:
pattern: ^(?P<test_case_id>.+)\.expected:\s*(?P<result>PASS|pass|FAIL|fail|SKIP|skip|UNKNOWN|unknown)$
metadata:
name: apparmor-functional-demo
format: "Lava-Test-Shell Test Definition 1.0"
description: "Run apparmor-demo test suite"
maintainer: "luis.araujo@collabora.co.uk"
scope:
- functional
devices:
- i386
environment:
- lava-test-shell
install:
deps:
- apparmor-demo
- busybox
- apertis-tests-apparmor-report
run:
steps:
- echo -n | sudo tee /var/log/audit/audit.log
- common/run-test-in-systemd --name=run-lava_run_tests --timeout=90 /usr/lib/apparmor-demo/lava_run_tests
- sudo cat /var/log/audit/audit.log | aa_log_extract_tokens.pl PERMITTING REJECTING
parse:
fixupdict:
FAILED: fail
PASSED: pass
SKIP: skip
pattern: ^(?P<test_case_id>.+)\.sh:\s*(?P<result>PASS|PASSED|pass|FAIL|FAILED|fail|SKIP|skip|UNKNOWN|unknown)\s*-
metadata:
name: apparmor-geoclue
format: "Lava-Test-Shell Test Definition 1.0"
description: "Tests that the geoclue profile works properly does not allow arbitrary
reading of files in the home directory."
maintainer: "luis.araujo@collabora.co.uk"
scope:
- functional
devices:
- i386
environment:
- lava-test-shell
install:
deps:
- busybox
- apertis-tests-apparmor-geoclue
run:
steps:
- echo -n | sudo tee /var/log/audit/audit.log
- common/run-test-in-systemd --name run-test-geoclue --timeout 90 /usr/lib/apertis-tests/apparmor/geoclue/test-geoclue
- sudo cat /var/log/audit/audit.log | aa_log_extract_tokens.pl PERMITTING REJECTING
parse:
pattern: ^(?P<test_case_id>[\w\-\.]+):\s(?P<result>PASS|pass|FAIL|fail|SKIP|skip|UNKNOWN|unknown)$
metadata:
name: apparmor-gstreamer1-0
format: "Lava-Test-Shell Test Definition 1.0"
description: "Run apparmor-gstreamer1.0 test suite"
maintainer: "luis.araujo@collabora.co.uk"
scope:
- functional
devices:
- i386
environment:
- lava-test-shell
install:
deps:
- busybox
- apertis-tests-apparmor-gstreamer1.0
- apertis-tests-apparmor-report
run:
steps:
- echo -n | sudo tee /var/log/audit/audit.log
# Use a timeout of 300s because some of the media file handling on embedded
# devices can be slow. This test is purely for AppArmor, not multimedia
# performance.
- common/run-test-in-systemd --name run-test-sh --timeout 300 --user=user /usr/lib/apertis-tests/apparmor/gstreamer1.0/lava_run_tests
- sudo cat /var/log/audit/audit.log | aa_log_extract_tokens.pl PERMITTING REJECTING
parse:
fixupdict:
FAILED: fail
PASSED: pass
SKIP: skip
pattern: ^(?P<test_case_id>.+)\.sh:\s*(?P<result>PASS|pass|FAIL|fail|SKIP|skip|UNKNOWN|unknown)\s*-
metadata:
name: apparmor-libreoffice
format: "Lava-Test-Shell Test Definition 1.0"
description: "Tests that the libreoffice profile works properly does not allow arbitrary
reading of files in the home directory."
maintainer: "luis.araujo@collabora.co.uk"
scope:
- functional
devices:
- i386
environment:
- lava-test-shell
install:
deps:
- busybox
- apertis-tests-apparmor-libreoffice
- apertis-tests-apparmor-report
run: