summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2012-07-30 18:19:20 +0200
committerKarel Zak2012-07-30 18:19:20 +0200
commitfc22bff04b90709b7c68b3d3206e79c09efb664d (patch)
tree0175ace44ed20b7382bd17410f1913956d4198f6
parenttests: check for 'make check' (diff)
downloadkernel-qcow2-util-linux-fc22bff04b90709b7c68b3d3206e79c09efb664d.tar.gz
kernel-qcow2-util-linux-fc22bff04b90709b7c68b3d3206e79c09efb664d.tar.xz
kernel-qcow2-util-linux-fc22bff04b90709b7c68b3d3206e79c09efb664d.zip
build-sys: add run.sh to make check for non-root users
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--Makefile.am1
-rw-r--r--tests/Makemodule.am1
-rwxr-xr-xtests/run-nonroot.sh9
3 files changed, 11 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 6a248e602..fe74e6856 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,6 +41,7 @@ dist_usrbin_exec_SCRIPTS =
systemdsystemunit_DATA =
ruman1_DATA =
check_PROGRAMS =
+TESTS =
INSTALL_EXEC_HOOKS =
UNINSTALL_HOOKS =
diff --git a/tests/Makemodule.am b/tests/Makemodule.am
index e25f71391..e7c31af23 100644
--- a/tests/Makemodule.am
+++ b/tests/Makemodule.am
@@ -10,4 +10,5 @@ EXTRA_DIST += \
clean-local-tests:
rm -rf output diff
+TESTS += tests/run-nonroot.sh
CLEAN_LOCALS += clean-local-tests
diff --git a/tests/run-nonroot.sh b/tests/run-nonroot.sh
new file mode 100755
index 000000000..150a99f3a
--- /dev/null
+++ b/tests/run-nonroot.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+MYUID=$(id -ru)
+if [ $MYUID -eq 0 ]; then
+ echo "The automatically executed tests suite is allowed for non-root users only."
+ exit 0
+fi
+
+exec $(cd $(dirname $0) && pwd)/run.sh