summaryrefslogtreecommitdiff
path: root/src/test/test-install-root.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-09-13 14:31:13 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-09-14 09:29:57 +0200
commit6d7c403324091b0ac0797dbd26b9fe61d4aea9a3 (patch)
treec1e977d368f861961955db8624b61729d30943d2 /src/test/test-install-root.c
parent8b81c382c390d69e48d653c357b4d820bfc149a6 (diff)
downloadsystemd-6d7c403324091b0ac0797dbd26b9fe61d4aea9a3.tar.gz
tests: use a helper function to parse environment and open logging
The advantages are that we save a few lines, and that we can override logging using environment variables in more test executables.
Diffstat (limited to 'src/test/test-install-root.c')
-rw-r--r--src/test/test-install-root.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test-install-root.c b/src/test/test-install-root.c
index fe1ca5b16f..c0956fa4bb 100644
--- a/src/test/test-install-root.c
+++ b/src/test/test-install-root.c
@@ -7,6 +7,7 @@
#include "rm-rf.h"
#include "special.h"
#include "string-util.h"
+#include "tests.h"
static void test_basic_mask_and_enable(const char *root) {
const char *p;
@@ -14,7 +15,7 @@ static void test_basic_mask_and_enable(const char *root) {
UnitFileChange *changes = NULL;
size_t n_changes = 0;
- log_set_max_level(LOG_DEBUG);
+ test_setup_logging(LOG_DEBUG);
assert_se(unit_file_get_state(UNIT_FILE_SYSTEM, root, "a.service", NULL) == -ENOENT);
assert_se(unit_file_get_state(UNIT_FILE_SYSTEM, root, "b.service", NULL) == -ENOENT);