mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
tests: Skip some of the fileutils tests when running as root
The tests which check permissions and errors like EACCES aren’t going to work as root, since root always has permission to do things. Skip them if running as root. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=766390
This commit is contained in:
parent
33749d837c
commit
c8cbfd551c
@ -880,6 +880,13 @@ test_stdio_wrappers (void)
|
||||
struct utimbuf ut;
|
||||
GError *error = NULL;
|
||||
|
||||
/* The permissions tests here don’t work when running as root. */
|
||||
if (getuid () == 0 || geteuid () == 0)
|
||||
{
|
||||
g_test_skip ("File permissions tests cannot be run as root");
|
||||
return;
|
||||
}
|
||||
|
||||
g_remove ("mkdir-test/test-create");
|
||||
ret = g_rmdir ("mkdir-test");
|
||||
g_assert (ret == 0 || errno == ENOENT);
|
||||
|
Loading…
Reference in New Issue
Block a user