unit-tests: Don't assert failures for unreadable settings files as root
The file can still be read by root even if nobody has read privileges.
This commit is contained in:
@@ -675,11 +675,14 @@ START_TEST(test_load_files_section)
|
|||||||
ck_assert(!settings->load_files_section(settings, include1".conf", TRUE, ""));
|
ck_assert(!settings->load_files_section(settings, include1".conf", TRUE, ""));
|
||||||
verify_include();
|
verify_include();
|
||||||
|
|
||||||
/* unreadable files are too */
|
/* unreadable files are too (only fails when not running as root) */
|
||||||
ck_assert(chunk_write(contents, include1".no", 0444, TRUE));
|
if (getuid() != 0)
|
||||||
ck_assert(!settings->load_files_section(settings, include1".no", TRUE, ""));
|
{
|
||||||
unlink(include1".no");
|
ck_assert(chunk_write(contents, include1".no", 0444, TRUE));
|
||||||
verify_include();
|
ck_assert(!settings->load_files_section(settings, include1".no", TRUE, ""));
|
||||||
|
unlink(include1".no");
|
||||||
|
verify_include();
|
||||||
|
}
|
||||||
|
|
||||||
ck_assert(settings->load_files_section(settings, include2, FALSE, "main"));
|
ck_assert(settings->load_files_section(settings, include2, FALSE, "main"));
|
||||||
verify_null("main.key1");
|
verify_null("main.key1");
|
||||||
|
|||||||
Reference in New Issue
Block a user