From c573dcfeb1abd390cd4c4288056df97752ef18f0 Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Tue, 3 Nov 2015 14:09:03 +0300 Subject: proc-cmdline: add runlevel to target mapping --- src/test/test-util.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/test') 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; } -- cgit v1.2.3-54-g00ecf