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