Blame SOURCES/0011-Clearly-state-that-tests-cannot-be-run-under-root.patch

9d8306
From 81a744f1b18475221feaffc8da120628a4ab5da4 Mon Sep 17 00:00:00 2001
9d8306
From: Jakub Filak <jfilak@redhat.com>
9d8306
Date: Mon, 13 Jul 2015 15:36:20 +0200
9d8306
Subject: [PATCH] Clearly state that tests cannot be run under root
9d8306
9d8306
Signed-off-by: Jakub Filak <jfilak@redhat.com>
9d8306
---
9d8306
 Makefile | 2 +-
9d8306
 README   | 4 ++++
9d8306
 2 files changed, 5 insertions(+), 1 deletion(-)
9d8306
9d8306
diff --git a/Makefile b/Makefile
9d8306
index 8802256..15df319 100644
9d8306
--- a/Makefile
9d8306
+++ b/Makefile
9d8306
@@ -67,4 +67,4 @@ distclean:
9d8306
 
9d8306
 .PHONY: check
9d8306
 check: build
9d8306
-	cd $(OUT_DIR) && make test
9d8306
+	if [ "_0" != "_$$(id -u)" ]; then cd $(OUT_DIR) && make test; else echo "Cannot run tests under root user."; exit 1; fi
9d8306
diff --git a/README b/README
9d8306
index 2657b11..30d0bef 100644
9d8306
--- a/README
9d8306
+++ b/README
9d8306
@@ -141,3 +141,7 @@ $ make rpm
9d8306
 $ make distclean
9d8306
 
9d8306
 All build results are stored in ./bin directory.
9d8306
+
9d8306
+The `check' make target will fail if you run it under root user. There are some
9d8306
+test cases that try to generate 'File Access Denied' exceptions and the easiest
9d8306
+way to achieve that is to try to access a root's file.
9d8306
-- 
9d8306
2.4.6
9d8306