]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add exec test which uses xlat function in its arguments
authorNick Porter <nick@portercomputing.co.uk>
Thu, 21 Sep 2023 11:10:00 +0000 (12:10 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 21 Sep 2023 17:10:50 +0000 (18:10 +0100)
src/tests/modules/exec/module.conf
src/tests/modules/exec/sync.unlang

index 38ea3219246d8de9eca2e19e8358b85fca1eb9d5..bd190a1cf4cae0c639142576cf23fd63fc9fd13a 100644 (file)
@@ -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}}"
+}
index b78d54305391633114b668d7d1ff29117d657ba0..341842d5f12be6b7ecd2ce7bb97018517b91335e 100644 (file)
@@ -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