From: Nick Porter Date: Thu, 21 Sep 2023 11:10:00 +0000 (+0100) Subject: Add exec test which uses xlat function in its arguments X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59f6a955fe92ea85c87a06730ebd3beacaf450f7;p=thirdparty%2Ffreeradius-server.git Add exec test which uses xlat function in its arguments --- diff --git a/src/tests/modules/exec/module.conf b/src/tests/modules/exec/module.conf index 38ea3219246..bd190a1cf4c 100644 --- a/src/tests/modules/exec/module.conf +++ b/src/tests/modules/exec/module.conf @@ -44,3 +44,10 @@ exec exec_sync_fail { timeout = 10 program = "/bin/sh $ENV{MODULE_TEST_DIR}/fail.sh" } + +exec exec_sync_xlat_args { + wait = yes + output_pairs = &control + timeout = 10 + program = "/bin/sh $ENV{MODULE_TEST_DIR}/attrs.sh %{toupper:%{User-Name}}" +} diff --git a/src/tests/modules/exec/sync.unlang b/src/tests/modules/exec/sync.unlang index b78d5430539..341842d5f12 100644 --- a/src/tests/modules/exec/sync.unlang +++ b/src/tests/modules/exec/sync.unlang @@ -71,4 +71,14 @@ if (&control.Tmp-String-3 == "Failure") { test_fail } +&control -= &Tmp-String-1[*] +# +# Call a module which uses an xlat function in its arguments +# +exec_sync_xlat_args + +if !(&control.Tmp-String-1 == 'TONY') { + test_fail +} + test_pass