From ce5cefc1d807591e283b2de83502e9d159673fa9 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Fri, 8 Aug 2025 10:08:05 -0400 Subject: [PATCH] add more tests to check triggers --- src/lib/unlang/interpret.c | 1 - src/tests/modules/test/module.conf | 4 ++++ src/tests/modules/test/trigger.unlang | 8 ++++++++ src/tests/modules/test/triggers.conf | 7 +++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index 582c49d008..31176546b8 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -1004,7 +1004,6 @@ CC_HINT(hot) rlm_rcode_t unlang_interpret(request_t *request, bool running) * Triggers can run modules which pop, and then the stack is empty. */ if (unlikely(stack->depth == 0)) { - fr_assert(top_frame); break; } diff --git a/src/tests/modules/test/module.conf b/src/tests/modules/test/module.conf index 071e8c6b8d..7a04c76793 100644 --- a/src/tests/modules/test/module.conf +++ b/src/tests/modules/test/module.conf @@ -1,2 +1,6 @@ test { } + +linelog log_stdout { + destination = stdout +} diff --git a/src/tests/modules/test/trigger.unlang b/src/tests/modules/test/trigger.unlang index 7187b0b6c5..8d347de6b9 100644 --- a/src/tests/modules/test/trigger.unlang +++ b/src/tests/modules/test/trigger.unlang @@ -2,4 +2,12 @@ if !%test_trigger('test') { test_fail } +if !%test_trigger('test_log') { + test_fail +} + +if !%test_trigger('server.start') { + test_fail +} + test_pass diff --git a/src/tests/modules/test/triggers.conf b/src/tests/modules/test/triggers.conf index 580474259f..f358efd10a 100644 --- a/src/tests/modules/test/triggers.conf +++ b/src/tests/modules/test/triggers.conf @@ -1,3 +1,10 @@ trigger { test = `/bin/echo hello` + + + test_log = %log_stdout('hello') + + server { + start = %log_stdout('server start') + } } -- 2.47.2