#include "specifier.h"
#include "util.h"
#include "macro.h"
+#include "test-helper.h"
static void test_replacements(void) {
#define expect(pattern, repl, expected) \
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;
}
expect(u2, "%H", host);
expect(u2, "%t", "/run/user/*");
+ manager_free(m);
+
return 0;
}
int main(int argc, char* argv[]) {
+ int rc = 0;
test_replacements();
- return test_unit_printf();
+ TEST_REQ_RUNNING_SYSTEMD(rc = test_unit_printf());
+ return rc;
}