From 9e2cf9c56b0a775dd1239cc558c856ddc1b9f6c8 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Thu, 13 Aug 2015 00:43:24 +0200 Subject: [PATCH] tests: Build and run selftests --- debian/templates/tests-control.main.in | 2 +- debian/tests/selftests | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/debian/templates/tests-control.main.in b/debian/templates/tests-control.main.in index 511c10e89..5d4262ae0 100644 --- a/debian/templates/tests-control.main.in +++ b/debian/templates/tests-control.main.in @@ -1,3 +1,3 @@ Tests: selftests Restrictions: breaks-testbed, needs-root, isolation-machine -Depends: kexec-tools, python3 +Depends: kexec-tools, python3, gcc, make, libpopt-dev, gcc-multilib [amd64], bc diff --git a/debian/tests/selftests b/debian/tests/selftests index 734a6de9b..6c2e2feea 100644 --- a/debian/tests/selftests +++ b/debian/tests/selftests @@ -38,11 +38,18 @@ if [ "$step" -ge 0 ]; then if [ "$(uname -r)" != "$ver" ]; then echo >&2 "Should be running: $ver" echo >&2 "Actually running: $(uname -r)" + else + cp -lR . $ADTTMP/build + cd $ADTTMP/build + make headers_install + + # Enable testing CLONE_USERNS by unprivileged users + sysctl kernel.unprivileged_userns_clone=1 + + make -C tools/testing/selftests run_tests fi fi -# TODO: build and run tests - step=$((step + 1)) if [ "$step" -lt "$steps" ]; then