platform/tests: skip root tests when we can't mount /sys/devices

This commit is contained in:
Lubomir Rintel 2016-10-10 17:34:37 +00:00
parent 790e23df67
commit 15a26d6192

View file

@ -1554,6 +1554,10 @@ unshare_user (void)
uid_t uid = geteuid ();
gid_t gid = getegid ();
/* Don't try to set up the namespaces if we're in a container. */
if (!nmtstp_is_sysfs_writable ())
return FALSE;
/* Already a root? */
if (gid == 0 && uid == 0)
return TRUE;