summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2013-10-04 12:20:20 -0700
committerPhilip Chimento <philip@endlessm.com>2013-10-04 12:20:20 -0700
commit9a9c4dc84905ee7125d4114c79fb6484734bd37b (patch)
tree9094b8fed65c31be17101be1403a2b5a0e5074b9 /test
parent949c51de5e283da9d45e45dff7d4c09f3f1e7150 (diff)
As root, 'make check' must succeed
The test that checks that EosApplication fails when the user config dir is not writable, is now disabled if UID == 0 or EUID == 0. [endlessm/eos-sdk#334]
Diffstat (limited to 'test')
-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);
+ }
}