]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove Tmp- attributes from exec module tests
authorNick Porter <nick@portercomputing.co.uk>
Mon, 8 Jan 2024 11:46:24 +0000 (11:46 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 8 Jan 2024 11:46:24 +0000 (11:46 +0000)
src/tests/modules/exec/async.unlang
src/tests/modules/exec/attrs.sh
src/tests/modules/exec/backticks_list.unlang
src/tests/modules/exec/fail.sh
src/tests/modules/exec/module.conf
src/tests/modules/exec/sync.unlang

index 72d248aa7add2ed2636c0e2ad259fb22de65fc5e..299f82f69e9c49686ee9eb701d8d71f7f761d408 100644 (file)
@@ -1,9 +1,11 @@
+string test_string
+
 #
 #  Async calls should always return a zero length string
 #  because we don't wait for the response.
 #
-&Tmp-String-0 := %exec_async('/bin/sh','-c',"'echo -n hello'")
-if &Tmp-String-0 {
+&test_string := %exec_async('/bin/sh','-c',"'echo -n hello'")
+if &test_string {
        test_fail
 }
 
@@ -25,7 +27,7 @@ if (&reply.Reply-Message == 'hello') {
 #  Smoke test - Setup an async process that'll keep running after
 #  after the test exits.
 #
-&Tmp-String-0 := %exec_async('/bin/sh','-c',"'sleep 1'")
-if &Tmp-String-0 {
+&test_string := %exec_async('/bin/sh','-c',"'sleep 1'")
+if &test_string {
        test_fail
 }
index 089cf0e110b0b7dea5a83972e41a8905bd1c492b..727c972671212b63c96940ec335b8523e1cdfd2a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-echo Tmp-String-1 := $1
-echo Tmp-String-2 := \"${CALLED_STATION_ID}\"
+echo Filter-Id := $1
+echo Callback-Id := \"${CALLED_STATION_ID}\"
 
 exit 0;
index bb1261718fdc7ff99830b03f8c511bcff7acef5b..8095bd1a7efee934224f4473e63baba251b9936e 100644 (file)
@@ -1,12 +1,12 @@
+string test_string
+
 #
 #  Sync calls should always return a zero length string
 #  because we don't wait for the response.
 #
-&Tmp-String-0 := %exec('/bin/sh', '-c', 'echo hello')
-if (&Tmp-String-0 != 'hello') {
+&test_string := %exec('/bin/sh', '-c', 'echo hello')
+if (&test_string != 'hello') {
        test_fail
-} else {
-       test_pass
 }
 
 #
index 6999952d6a8b9773725c933c201551ad1f5be87f..2a576d74d96dc5722e9517d3c4915b00c7e74e8f 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-echo Tmp-String-3 := Failure
+echo NAS-Identifier := Failure
 
 # exit status 7 maps to module exit code "notfound"
 exit 7
index 9e4382b9958cdd04ed4898cf0b9278fa86c5c80f..06d17a8225e41eb251783bac7092bd5b72f6c1c1 100644 (file)
@@ -17,7 +17,7 @@ exec exec_async_mod {
        input_pairs = &request
        shell_escape = yes
        timeout = 10
-       program = "/bin/sh -c 'echo \'Tmp-String-0 = welcome\''"
+       program = "/bin/sh -c 'echo \'Called-Station-Id = welcome\''"
 }
 
 exec exec_sync {
@@ -33,7 +33,7 @@ exec exec_sync_mod {
        output_pairs = &control
        shell_escape = yes
        timeout = 10
-       program = "/bin/sh -c 'echo \'Tmp-String-0 = welcome\''"
+       program = "/bin/sh -c 'echo \'Called-Station-Id = welcome\''"
 }
 
 exec exec_sync_attrs {
index 1fa17147fb0c20a0c09ffb9b7cfd7f6bb7bc0ed4..f00219d19e6ac2c9cb623afcabace561fffd604b 100644 (file)
@@ -1,33 +1,33 @@
+string test_string
+
 #
 #  Sync calls return the response
 #
-&Tmp-String-0 := %exec_sync('/bin/sh', '-c', "echo 'hello'")
-if (&Tmp-String-0 != 'hello') {
+&test_string := %exec_sync('/bin/sh', '-c', "echo 'hello'")
+if (&test_string != 'hello') {
        test_fail
 }
 
 #
 #  Call something which will take longer than the timeout
 #
-&request -= &Tmp-String-0
 &request -= &Module-Failure-Message
 
-&Tmp-String-0 := %exec_sync('/bin/sleep', '10')
+&test_string := %exec_sync('/bin/sleep', '10')
 
 if (&Module-Failure-Message != "Execution of external program failed: Timeout running program") {
        test_fail
 }
 
-if &Tmp-String-0  {
+if &test_string  {
        test_fail
 }
 
-&request -= &Tmp-String-0
 &request -= &Module-Failure-Message
 
-&Tmp-String-0 := %exec_sync('/bin/sh', "$ENV{MODULE_TEST_DIR}/fail.sh")
+&test_string := %exec_sync('/bin/sh', "$ENV{MODULE_TEST_DIR}/fail.sh")
 
-if &Tmp-String-0 {
+if &test_string {
        test_fail
 }
 
@@ -40,7 +40,7 @@ if (&Module-Failure-Message != "Execution of external program returned 7") {
 #
 exec_sync_mod
 
-if ((!&control.Tmp-String-0) || (&control.Tmp-String-0 != 'welcome')) {
+if ((!&control.Called-Station-Id) || (&control.Called-Station-Id != 'welcome')) {
        test_fail
 }
 
@@ -51,11 +51,11 @@ if ((!&control.Tmp-String-0) || (&control.Tmp-String-0 != 'welcome')) {
 #
 exec_sync_attrs
 
-if ((!&control.Tmp-String-1) || (&control.Tmp-String-1 != 'tony')) {
+if ((!&control.Filter-Id) || (&control.Filter-Id != 'tony')) {
        test_fail
 }
 
-if ((!&control.Tmp-String-2) || (&control.Tmp-String-2 != 'aabbccddeeff')) {
+if ((!&control.Callback-Id) || (&control.Callback-Id != 'aabbccddeeff')) {
        test_fail
 }
 
@@ -71,17 +71,17 @@ if (notfound) {
        test_fail
 }
 
-if (&control.Tmp-String-3 == "Failure") {
+if (&control.NAS-Identifier == "Failure") {
        test_fail
 }
 
-&control -= &Tmp-String-1[*]
+&control -= &Filter-Id[*]
 #
 #  Call a module which uses an xlat function in its arguments
 #
 exec_sync_xlat_args
 
-if !(&control.Tmp-String-1 == 'TONY') {
+if !(&control.Filter-Id == 'TONY') {
        test_fail
 }