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

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