chiark / gitweb /
01674e6d4a80f1d37d3ee1502731f56bb0b60040
[elogind.git] / src / test / test-helper.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5   This file is part of systemd.
6
7   Copyright 2013 Holger Hans Peter Freyther
8 ***/
9
10 #include "sd-daemon.h"
11
12 #include "macro.h"
13
14 #define TEST_REQ_RUNNING_SYSTEMD(x)                                 \
15         if (sd_booted() > 0) {                                      \
16                 x;                                                  \
17         } else {                                                    \
18                 printf("systemd not booted skipping '%s'\n", #x);   \
19         }
20
21 #define MANAGER_SKIP_TEST(r)                                    \
22         IN_SET(r,                                               \
23                -EPERM,                                          \
24                -EACCES,                                         \
25                -EADDRINUSE,                                     \
26                -EHOSTDOWN,                                      \
27                -ENOENT,                                         \
28                -ENOMEDIUM /* cannot determine cgroup */         \
29                )
30
31 int enter_cgroup_subroot(void);