summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2015-11-03 14:09:03 +0300
committerEvgeny Vereshchagin <evvers@ya.ru>2015-11-03 14:09:03 +0300
commitc573dcfeb1abd390cd4c4288056df97752ef18f0 (patch)
treea04c3dae06f55ecaa7fb1af35b257b90a37d1ff8 /src/test
parent534e8f89d6367cd0e9e17fff67880fb430071d01 (diff)
proc-cmdline: add runlevel to target mapping
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test-util.c b/src/test/test-util.c
index 647df4f5c3..f6ed55878c 100644
--- a/src/test/test-util.c
+++ b/src/test/test-util.c
@@ -48,6 +48,7 @@
#include "process-util.h"
#include "rm-rf.h"
#include "signal-util.h"
+#include "special.h"
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
@@ -1638,6 +1639,12 @@ cleanup:
assert_se(rmdir(t) >= 0);
}
+static void test_runlevel_to_target(void) {
+ assert_se(streq_ptr(runlevel_to_target(NULL), NULL));
+ assert_se(streq_ptr(runlevel_to_target("unknown-runlevel"), NULL));
+ assert_se(streq_ptr(runlevel_to_target("3"), SPECIAL_MULTI_USER_TARGET));
+}
+
int main(int argc, char *argv[]) {
log_parse_environment();
log_open();
@@ -1718,6 +1725,7 @@ int main(int argc, char *argv[]) {
test_tempfn();
test_strcmp_ptr();
test_fgetxattrat_fake();
+ test_runlevel_to_target();
return 0;
}