test-condition: don't assume that all non-root users are normal users (#6409)

Automated builders may run under a dedicated system user, and this test would fail that

Fixes #6366
This commit is contained in:
Felipe Sateler 2017-07-19 20:48:23 -04:00 committed by Zbigniew Jędrzejewski-Szmek
parent 5588612e9e
commit 708d423915
1 changed files with 1 additions and 1 deletions

View File

@ -390,7 +390,7 @@ static void test_condition_test_user(void) {
assert_se(condition);
r = condition_test(condition);
log_info("ConditionUser=@system → %i", r);
if (geteuid() == 0)
if (getuid() < SYSTEM_UID_MAX || geteuid() < SYSTEM_UID_MAX)
assert_se(r > 0);
else
assert_se(r == 0);