[Intel-gfx] [PATCH 18/23] piglit: Make sure we are running the tests as root

Damien Lespiau damien.lespiau at intel.com
Fri Nov 15 17:33:35 CET 2013


Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 Makefile.am            | 1 +
 tests/Makefile.sources | 1 +
 tests/check_root       | 5 +++++
 3 files changed, 7 insertions(+)
 create mode 100755 tests/check_root

diff --git a/Makefile.am b/Makefile.am
index e790efe..7988d01 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -59,6 +59,7 @@ TEST_TARGETS := #
 TEST_TARGETS += run-test
 run-tests:
 	@[ -z "$(RESUME)" -a -n "$(R)" ] && RESUME=$(R); \
+	$(srcdir)/tests/check_root && \
 	$(srcdir)/tests/check_drm_clients && \
 	if [ -n "$$RESUME" ]; then \
 		[ ! -f $$RESUME/main ] && { \
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index a02b93d..eb2b511 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -187,6 +187,7 @@ HANG = \
 
 scripts = \
 	check_drm_clients \
+	check_root \
 	ddx_intel_after_fbdev \
 	debugfs_wedged \
 	drm_lib.sh \
diff --git a/tests/check_root b/tests/check_root
new file mode 100755
index 0000000..5d49f0d
--- /dev/null
+++ b/tests/check_root
@@ -0,0 +1,5 @@
+#!/bin/sh
+[ `id -u` = 0 ] || {
+	echo "Error: Not running as root"
+	exit 1
+}
-- 
1.8.3.1




More information about the Intel-gfx mailing list