From 8c78b4b4a9e2bb2d0614b121878cf8ae443d1923 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 11 May 2014 17:37:08 +0200 Subject: [PATCH] Avoids to test permission when run as root. --- HISTORY | 6 +++++- Makefile.am | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/HISTORY b/HISTORY index c5b87c87..16247850 100644 --- a/HISTORY +++ b/HISTORY @@ -1,9 +1,13 @@ SnapRAID HISTORY ================ +6.2 2014/5 +========== + * Fixed the regression test when run as root. + 6.1 2014/4 ========== - * Fix build and regression test in Mac OS X. + * Fixed build and regression test in Mac OS X. 6.0 2014/3 ========== diff --git a/Makefile.am b/Makefile.am index d662e3e6..a49b86d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -250,7 +250,10 @@ endif echo RUN > bench/disk1/RUN-RM $(FAILENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-run "rm bench/disk1/RUN-RM" --test-expect-failure sync echo RUN > bench/disk1/RUN-CHMOD - $(FAILENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-run "chmod a-r bench/disk1/RUN-CHMOD" --test-expect-failure sync +# Doesn't run this test as root because the root user overrride permissions + if [[ $$EUID -ne 0 ]]; then \ + $(FAILENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-run "chmod a-r bench/disk1/RUN-CHMOD" --test-expect-failure sync; \ + fi echo RUN > bench/disk1/RUN-SIZE $(FAILENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-run "echo RUNRUN > bench/disk1/RUN-SIZE" --test-expect-failure sync echo RUN > bench/disk1/RUN-TOUCH @@ -265,7 +268,10 @@ endif echo HASH > bench/disk1/HASH-RM $(FAILENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-run "rm bench/disk1/HASH-RM" --test-expect-failure -h sync echo HASH > bench/disk1/HASH-CHMOD - $(FAILENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-run "chmod a-r bench/disk1/HASH-CHMOD" --test-expect-failure -h sync +# Doesn't run this test as root because the root user overrride permissions + if [[ $$EUID -ne 0 ]]; then \ + $(FAILENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-run "chmod a-r bench/disk1/HASH-CHMOD" --test-expect-failure -h sync; \ + fi echo HASH > bench/disk1/HASH-SIZE $(FAILENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-run "echo HASHHASH > bench/disk1/HASH-SIZE" --test-expect-failure -h sync echo HASH > bench/disk1/HASH-TOUCH