summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorP. F. Chimento <philip.chimento@gmail.com>2013-10-04 12:33:22 -0700
committerP. F. Chimento <philip.chimento@gmail.com>2013-10-04 12:33:22 -0700
commit98d92f34527071eabf01e72a2b3a8ae85b48d03a (patch)
tree9094b8fed65c31be17101be1403a2b5a0e5074b9
parent949c51de5e283da9d45e45dff7d4c09f3f1e7150 (diff)
parent9a9c4dc84905ee7125d4114c79fb6484734bd37b (diff)
Merge pull request #336 from endlessm/issues/334
#334 As root, 'make check' must succeed
-rw-r--r--test/test-application.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/test/test-application.c b/test/test-application.c
index 74b9c49..065f3f8 100644
--- a/test/test-application.c
+++ b/test/test-application.c
@@ -155,9 +155,15 @@ add_application_tests (void)
config_dir_setup,
test_config_dir_exists,
config_dir_teardown);
- g_test_add ("/application/config-dir-fails-if-not-writable", ConfigDirFixture,
- NULL,
- config_dir_setup,
- test_config_dir_fails_if_not_writable,
- config_dir_teardown);
+
+ /* Only run this test if UID is not root; root can write to any directory no
+ matter what its permissions. */
+ if (getuid() > 0 && geteuid() > 0)
+ {
+ g_test_add ("/application/config-dir-fails-if-not-writable",
+ ConfigDirFixture, NULL,
+ config_dir_setup,
+ test_config_dir_fails_if_not_writable,
+ config_dir_teardown);
+ }
}