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

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