chiark / gitweb /
tests: skip tests when executed without privileges but which require them
authorKay Sievers <kay@vrfy.org>
Thu, 18 Jul 2013 21:05:29 +0000 (23:05 +0200)
committerKay Sievers <kay@vrfy.org>
Thu, 18 Jul 2013 21:05:29 +0000 (23:05 +0200)
src/test/test-sched-prio.c
src/test/test-unit-name.c

index 509c75f..1bbe867 100644 (file)
@@ -35,7 +35,7 @@ int main(int argc, char *argv[]) {
         /* prepare the test */
         assert_se(set_unit_path(TEST_DIR) >= 0);
         r = manager_new(SYSTEMD_USER, false, &m);
-        if (r == -EPERM) {
+        if (r == -EPERM || r == -EACCES) {
                 puts("manager_new: Permission denied. Skipping test.");
                 return EXIT_TEST_SKIP;
         }
index 2fa0294..6776ef0 100644 (file)
@@ -124,7 +124,7 @@ static int test_unit_printf(void) {
         assert_se(asprintf(&root_uid, "%d", (int) root->pw_uid) > 0);
 
         r = manager_new(SYSTEMD_USER, false, &m);
-        if (r == -EPERM) {
+        if (r == -EPERM || r == -EACCES) {
                 puts("manager_new: Permission denied. Skipping test.");
                 return EXIT_TEST_SKIP;
         }