]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: add run.sh to make check for non-root users
authorKarel Zak <kzak@redhat.com>
Mon, 30 Jul 2012 16:19:20 +0000 (18:19 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 30 Jul 2012 16:19:20 +0000 (18:19 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
Makefile.am
tests/Makemodule.am
tests/run-nonroot.sh [new file with mode: 0755]

index 6a248e6025ab3b198ce9f1f9982dc84865815060..fe74e6856428da89f47e95d43b20c9352ecbce62 100644 (file)
@@ -41,6 +41,7 @@ dist_usrbin_exec_SCRIPTS =
 systemdsystemunit_DATA =
 ruman1_DATA =
 check_PROGRAMS =
+TESTS =
 
 INSTALL_EXEC_HOOKS =
 UNINSTALL_HOOKS =
index e25f71391ae9a4f6dfb9254dcdaeae1e672350e1..e7c31af23f15bb57048e628380a88b80b7c40c4d 100644 (file)
@@ -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 (executable)
index 0000000..150a99f
--- /dev/null
@@ -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