tests: run all snap-confine tests in c-unit-tests task #2433

Merged
merged 15 commits into from Jan 12, 2017
@@ -27,16 +27,12 @@ EXTRA_DIST = $(all_tests) common.sh
if SECCOMP
if CONFINEMENT_TESTS
-# XXX: This is disabled because those tests fail on 14.04
-# and this is more likely environment than actual failure
-# as regular spread tests work ok
-#
-# TESTS += $(all_tests)
+TESTS += $(all_tests)
endif
endif
check: ../snap-confine
.PHONY: check-syntax
check-syntax:
- shellcheck --format=gcc $(wildcard test_*) common.sh
+ shellcheck --format=gcc $(wildcard $(srcdir)/test_*) common.sh
@@ -3,6 +3,7 @@
get_common_syscalls() {
cat <<EOF
# filter that works ok for true
+
open
close
@@ -25,6 +26,13 @@ exit_group
geteuid
geteuid32
getuid
+getuid32
+setresuid
+setresuid32
+setgid
+setgid32
+setuid
+setuid32
set_thread_area
EOF
@@ -39,6 +47,7 @@ trap 'rm -rf $TMP' EXIT
export SNAPPY_LAUNCHER_SECCOMP_PROFILE_DIR="$TMP"
export SNAPPY_LAUNCHER_INSIDE_TESTS="1"
export SNAP_CONFINE_NO_ROOT=1
+export SNAP_NAME=name.app
FAIL() {
printf ": FAIL\n"
@@ -23,7 +23,8 @@ execute: |
$SPREAD_PATH/cmd/configure \
--prefix=/usr --libexecdir=/usr/lib/snapd --enable-nvidia-ubuntu
# Build and run unit tests
- make -C snap-confine check-unit-tests
+ make -C snap-confine all
+ make -C snap-confine check
restore: |
# Remove autogarbage leftover from testing
find $SPREAD_PATH/cmd/ \( -name Makefile.in -o -name Makefile \) -exec rm -vf {} \;
@@ -34,6 +35,11 @@ restore: |
dpkg --set-selections < pkg-list
rm -f pkg-list
debug: |
+ # Show the test suite failure log if there's one
+ cat $SPREAD_PATH/cmd/autogarbage/snap-confine/tests/test-suite.log || true
+ # Show any autogabare that may need cleaning
cd $SPREAD_PATH/cmd/
find . > after
diff -u $SPREAD_PATH/cmd/before $SPREAD_PATH/cmd/after
+ # Show kernel log as it may contain useful stuff
+ tail /var/log/kern.log