]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove backticks from tests
authorAlan T. DeKok <aland@freeradius.org>
Thu, 17 Apr 2025 19:53:41 +0000 (15:53 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 18 Apr 2025 13:45:23 +0000 (09:45 -0400)
And clean up corresponding use of exec module.  We hoist it to
unit_test_module.conf, and then replace any module-specific
configuration with a module-specific instant of exec

20 files changed:
src/tests/modules/cache_htrie/module.conf
src/tests/modules/cache_memcached/module.conf
src/tests/modules/cache_rbtree/module.conf
src/tests/modules/cache_redis/module.conf
src/tests/modules/detail/module.conf
src/tests/modules/exec/backticks_list.unlang
src/tests/modules/exec/module.conf
src/tests/modules/linelog/linelog.unlang
src/tests/modules/linelog/module.conf
src/tests/modules/mschap/module.conf
src/tests/modules/redis/module.conf
src/tests/modules/redis_ippool/module.conf
src/tests/modules/smtp/module.conf
src/tests/modules/smtp/smtp_attachment/module.conf
src/tests/modules/smtp/smtp_authenticate/module.conf
src/tests/modules/smtp/smtp_crln/module.conf
src/tests/modules/smtp/smtp_stringparse/module.conf
src/tests/modules/sql/map.unlang
src/tests/modules/totp/module.conf
src/tests/modules/unit_test_module.conf

index 87bc486e82d2ee1ffe808c3bc5f0eea1e50848c9..646349afb1b4e6f005c8dcbe083507ba087ca8d4 100644 (file)
@@ -34,7 +34,7 @@ cache cache_update {
                Filter-Id += NAS-Port[*]
 
                # Cache the result of an exec
-               Callback-Id := `/bin/echo 'echo test'`
+               Callback-Id := %exec('/bin/echo', 'echo test')
 
                # Create three string values and overwrite the middle one
                Login-LAT-Service += 'foo'
index 880e2ab62233226822116883b8e2e853b5b29f26..c910ae972c34137f8b5b55ed91170dc073d9131d 100644 (file)
@@ -42,7 +42,7 @@ cache cache_update {
                Filter-Id += NAS-Port[*]
 
                # Cache the result of an exec
-               Callback-Id := `/bin/echo 'echo test'`
+               Callback-Id := %exec('/bin/echo', 'echo test')
 
                # Create three string values and overwrite the middle one
                Login-LAT-Service += 'foo'
index 32e4a6ddedd352114caf5400f41eacb2e0e08ce0..32242edbf5517b94cb33a971d6a0b3d690e397be 100644 (file)
@@ -34,7 +34,7 @@ cache cache_update {
                Filter-Id += NAS-Port[*]
 
                # Cache the result of an exec
-               Callback-Id := `/bin/echo 'echo test'`
+               Callback-Id := %exec('/bin/echo', 'echo test')
 
                # Create three string values and overwrite the middle one
                Login-LAT-Service += 'foo'
index 0ef527ab5adee2319f0a4c5191a5bb84753e2718..7e1c58dc58b1e8a30e0a89a206f4a13a719218ce 100644 (file)
@@ -52,7 +52,7 @@ cache cache_update {
                Filter-Id += NAS-Port[*]
 
                # Cache the result of an exec
-               Callback-Id := `/bin/echo 'echo test'`
+               Callback-Id := %exec('/bin/echo', 'echo test')
 
                # Create three string values and overwrite the middle one
                Login-LAT-Service += 'foo'
index 1154d18f7c61f44f1ed6b06d598771dbbe8ed9b5..10d3ee6ad76d5a113b831a2671ac4f98598d2656 100644 (file)
@@ -28,6 +28,3 @@ detail detail_escape {
        filename = "$ENV{MODULE_TEST_DIR}/%{Net.Src.IP}-%{Calling-Station-Id}"
        escape_filenames = yes
 }
-
-exec {
-}
index e4e60107d7de334458131168a5d623a90d4f8913..8f9efd0d9978b0f99adde02054b5bfc676928da9 100644 (file)
@@ -4,7 +4,7 @@ string test_string
 #  Sync calls should always return a zero length string
 #  because we don't wait for the response.
 #
-test_string := %exec('/bin/sh', '-c', 'echo hello')
+test_string := %exec_wait('/bin/sh', '-c', 'echo hello')
 if (test_string != 'hello') {
        test_fail
 }
@@ -12,7 +12,7 @@ if (test_string != 'hello') {
 #
 #  @todo - list over-rides are not allowed!
 #
-control += %exec('/bin/sh', '-c', "echo Reply-Message := \'hello\'")
+control += %exec_wait('/bin/sh', '-c', "echo Reply-Message := \'hello\'")
 
 if (control.Reply-Message != 'hello') {
        test_fail
index 13789d8556a12fbe4c5f40a3883fb81b8e7dd5df..faaf8a77960544fe373e64efd74984dacefd9493 100644 (file)
@@ -1,4 +1,4 @@
-exec {
+exec exec_wait {
        wait = yes
        input_pairs = request
        shell_escape = yes
index 59df34ef5eab7c403d66d452875073fa46b751e5..6a707c6bf3c298f25e10c5052953e1ab11b05f97 100644 (file)
@@ -219,7 +219,7 @@ if !(test_string == 'bob,olobobob') {
        test_fail
 }
 
-test_integer := %exec('/bin/sh', '-c', "wc -l < $ENV{MODULE_TEST_DIR}/test_e.log")
+test_integer := %exec_wait('/bin/sh', '-c', "wc -l < $ENV{MODULE_TEST_DIR}/test_e.log")
 
 if !(test_integer == 3) {
        test_fail
index 120b328d6d228b1334bbb7451bb603f56ea3e2db..fe959ffb7cdeaf0565024e95946c351275845257 100644 (file)
@@ -165,7 +165,7 @@ linelog linelog_missingref {
        }
 }
 
-exec {
+exec exec_wait {
        wait = yes
        input_pairs = request
        shell_escape = yes
index 5f0f17932d78594fa1265eed44410f1f12c4d1ae..9dc494856d5dc1ad6de28ac96af36adfa162f269 100644 (file)
@@ -73,6 +73,3 @@ mschap mschap_ntlm {
                chap_nt_enc_pw = Vendor-Specific.Microsoft.CHAP-NT-Enc-PW
        }
 }
-
-exec {
-}
index d1165caa89c1d784dbae4217eb4bf5ef38474b97..50cf94fe0f6a38394c1b5eb523b7393b2e4e8bef 100644 (file)
@@ -115,7 +115,3 @@ redis {
 delay {
 }
 
-exec {
-       # Pass through path
-       env_inherit = yes
-}
index 03225e84d05cdbd9a9ba9c2dc614ff7c0440af68..0d2f0746921cbb4abc0a83dcbb51b6725050b7f0 100644 (file)
@@ -109,8 +109,3 @@ redis = ${modules.redis_ippool.redis}
 
 delay {
 }
-
-exec {
-       # Pass through path
-       env_inherit = yes
-}
index 3e6fdeff3c6d997fbb48b1394114de4f94b92fd2..d5adc3a5e0582811ec644ffe6123013ac976f8b1 100644 (file)
@@ -50,6 +50,3 @@ smtp {
 
 delay {
 }
-
-exec {
-}
index 085a7884c0d36a332e8d71c215f487822cbcb705..13036f3bdcac9cc7ceefceb159deee4a9083d36d 100644 (file)
@@ -45,6 +45,3 @@ smtp {
 
 delay {
 }
-
-exec {
-}
index a155618778faacf69a94c24f5baae07ff9168453..4c9792592908eb520a9bd8a18aea64776fd6df83 100644 (file)
@@ -26,6 +26,3 @@ smtp {
 
 delay {
 }
-
-exec {
-}
index 224f6dbfb9c03b7e9dd95ce4e5a13333f355e9eb..a603eee97eb945b5ec356ab0b3abebcee8ab130d 100644 (file)
@@ -36,6 +36,3 @@ smtp {
 
 delay {
 }
-
-exec {
-}
index 33ce8e412d9edee879dd4c33fc25b7e2a7984527..fb3d02453888d80235b3f4ccf2a77a7b909a1161 100644 (file)
@@ -38,6 +38,3 @@ smtp {
 
 delay {
 }
-
-exec {
-}
index 62f0e5f8d228745983ecef31525fc386b1b98b9b..c10a8a8944074b5cd3f4071ebd6b83b4be5ef0ea 100644 (file)
@@ -267,7 +267,7 @@ groupfield := 'name'
 map sql 'SELECT * FROM radusergroup WHERE priority = 0' {
        control.User-Name       = userfield
        control.Filter-Id       = "group%{groupfield}"
-       control.NAS-Port        = `/bin/echo priority`
+       control.NAS-Port        = %exec('/bin/echo', 'priority')
 }
 
 if (!updated) {
index a554e54f20472a1b09bd2bcb0b4d049db107e96f..7d93db8c2eee639fb653f240b2c738d66b699dc3 100644 (file)
@@ -3,9 +3,6 @@ totp {
        time_offset = time_offset
 }
 
-exec {
-}
-
 date {
        utc = yes
 }
index 57d1d1986d490d64581cada11a02efeb71fced16..64503f4410b354840dfa27a694064c0bbcf9c152 100644 (file)
@@ -21,6 +21,10 @@ insert_into_radreply = "INSERT INTO radreply (username, attribute, op, value) VA
 modules {
        $INCLUDE ${raddb}/mods-enabled/always
 
+       exec {
+               env_inherit = yes       # needed by redis_ippool
+       }
+
        $INCLUDE ${raddb}/mods-enabled/pap
 
        $INCLUDE $ENV{MODULE_TEST_DIR}/module.conf