summaryrefslogtreecommitdiffstats
path: root/src/test/test-emergency-action.c
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-06-21 11:59:27 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-06-22 11:33:13 +0200
commit3cf848f6cd2151ccff89073bffb102f966d64ced (patch)
tree469a38414f6f16364a7994a03962261a22d0ae92 /src/test/test-emergency-action.c
parentMerge pull request #27863 from DaanDeMeyer/copy-lock (diff)
downloadsystemd-3cf848f6cd2151ccff89073bffb102f966d64ced.tar.xz
systemd-3cf848f6cd2151ccff89073bffb102f966d64ced.zip
core: Add halt and kexec emergency actions
Let's complete the picture by adding the missing halt and kexec emergency actions.
Diffstat (limited to 'src/test/test-emergency-action.c')
-rw-r--r--src/test/test-emergency-action.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test-emergency-action.c b/src/test/test-emergency-action.c
index b2e6af8d62..5c0ce7f053 100644
--- a/src/test/test-emergency-action.c
+++ b/src/test/test-emergency-action.c
@@ -38,6 +38,14 @@ TEST(parse_emergency_action) {
assert_se(parse_emergency_action("exit-force", RUNTIME_SCOPE_SYSTEM, &x) == 0);
assert_se(parse_emergency_action("exit-forcee", RUNTIME_SCOPE_SYSTEM, &x) == -EINVAL);
assert_se(x == EMERGENCY_ACTION_EXIT_FORCE);
+ assert_se(parse_emergency_action("kexec", RUNTIME_SCOPE_SYSTEM, &x) == 0);
+ assert_se(parse_emergency_action("kexec-force", RUNTIME_SCOPE_SYSTEM, &x) == 0);
+ assert_se(parse_emergency_action("kexec-forcee", RUNTIME_SCOPE_SYSTEM, &x) == -EINVAL);
+ assert_se(x == EMERGENCY_ACTION_KEXEC_FORCE);
+ assert_se(parse_emergency_action("halt", RUNTIME_SCOPE_SYSTEM, &x) == 0);
+ assert_se(parse_emergency_action("halt-force", RUNTIME_SCOPE_SYSTEM, &x) == 0);
+ assert_se(parse_emergency_action("halt-forcee", RUNTIME_SCOPE_SYSTEM, &x) == -EINVAL);
+ assert_se(x == EMERGENCY_ACTION_HALT_FORCE);
}
DEFINE_TEST_MAIN(LOG_INFO);