]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move to new syntax
authorAlan T. DeKok <aland@freeradius.org>
Mon, 9 Oct 2023 16:11:21 +0000 (12:11 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 9 Oct 2023 16:14:13 +0000 (12:14 -0400)
perl -p -i -e 's/%\(([a-zA-Z0-0._-]+):([a-zA-Z0-9.]+)\)/%$1\($2\)/g'   $(git grep -lE '%\([a-z]+:' src/tests/keywords/)

perl -p -i -e 's/%\(([a-zA-Z0-0._-]+):%{([^%{}]+)}\)/%$1\(%{$2}\)/g'   $(git grep -lE '%\([a-z]+:' src/tests/keywords/)

src/tests/keywords/edit-set-fail
src/tests/keywords/escape-sequences
src/tests/keywords/policy.conf
src/tests/keywords/return-within-if-after-policy
src/tests/keywords/suberequest-cancel
src/tests/keywords/truncation
src/tests/keywords/xlat-config
src/tests/keywords/xlat-inline
src/tests/keywords/xlat-integer
src/tests/keywords/xlat-interpreter
src/tests/keywords/xlat-subst

index 64104c2039b29263df6dad4a9240e1ed8a12e7cf..9f4ff6a8cb9ab7e5dfce8aa54dedc727106142f1 100644 (file)
@@ -12,7 +12,7 @@ if !(&NAS-Port == 1812) {
 #
 #  Service-Type doesn't exist, so the ":=" means "delete everything"
 #
-&NAS-Port := %(integer:%{Service-Type})
+&NAS-Port := %integer(%{Service-Type})
 
 #
 #  This should no longer exist.
index a856bd8906b226d855435ef65fcafdbb341511a0..30d4b6453579416e96cfb6de3de69ce188537d96 100644 (file)
 }
 
 
-if (!("%(length:%{Tmp-String-0})" == 39)) {
+if (!("%length(%{Tmp-String-0})" == 39)) {
        test_fail
 }
 
-if (!("%(length:%{Tmp-String-1})" == 42)) {
+if (!("%length(%{Tmp-String-1})" == 42)) {
        test_fail
 }
 
@@ -77,7 +77,7 @@ if (!(&Tmp-String-2[1] == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) {
 #  Other data types
 #
 &Tmp-String-0 := "%{(string) &Tmp-IP-Address-0}"
-if (!(%(length:%{Tmp-String-0}) == 9)) {
+if (!(%length(%{Tmp-String-0}) == 9)) {
        test_fail
 }
 
index ca8db97d57a05d2191792b082750a1319446646b..ca564df0ac146efa972f61fe68babadb9efe1ee2 100644 (file)
@@ -55,12 +55,12 @@ success {
 
 test_fail {
        &reply += {
-               &Result-Status = "Failure in test file %(interpreter:...filename)[%(interpreter:...line)]"
+               &Result-Status = "Failure in test file %interpreter(...filename)[%interpreter(...line)]"
        }
 
        if (&parent.request) {
                &parent.reply += {
-                       &Result-Status = "Failure in test file %(interpreter:...filename)[%(interpreter:...line)]"
+                       &Result-Status = "Failure in test file %interpreter(...filename)[%interpreter(...line)]"
                }
        }
 }
index b7015b16ae4c4159d9043f6578e6cd06f29407c8..df109b851668688270b400eb68f35b93cdf55e53 100644 (file)
@@ -7,7 +7,7 @@ if ('true' == 'true') {
        accept
        success
        if(&User-Name == 'bob') {
-               "%(debug:%(debug:0))"   # Noop
+               "%(debug:%debug(0))"    # Noop
                return
        }
        test_fail
index 63f3b8e6bb9250b0eefeef326f6b6509eba0db26..659409bbbebe2af870250ed6da781c378ebb8180 100644 (file)
@@ -17,7 +17,7 @@ subrequest Access-Request {
 }
 
 # Cancel parent with active subrequest, will run on next timer service
-%(cancel:100ms)
+%cancel(100ms)
 subrequest Access-Request {
        %(delay_10s:1s)
 }
index ce70b12130575b8e82e359b6d1b07073d880da63..edcfc93f979c70a84c4bf22e7dfaaae0ecb3bc81 100644 (file)
@@ -73,7 +73,7 @@ a02f4a3ab98d75992d68a15d393387fe9ef01041569570ad6fe884764e55567311bcacfcffae7655
 3ae4bcef324b9a3f47ba5c835b54a010ca42f3b9cc5368278c148c9b02ea8c4c9f244fd49f
 
 # Actual length of octet string is 4083 bytes
-if (!(%(length:%{Tmp-Octets-0}) == 4083)) {
+if (!(%length(%{Tmp-Octets-0}) == 4083)) {
        test_fail
 }
 
@@ -84,7 +84,7 @@ if !("0x%hex(%{Tmp-Octets-0})" =~ /^0x([0-9a-f]+)$/) {
 
 &Tmp-String-0 := "%{1}"
 
-if (!("%(length:%{Tmp-String-0})" == 8166)) {
+if (!("%length(%{Tmp-String-0})" == 8166)) {
        test_fail
 }
 
index d51b54b619224b8b538ecc7c71674d35758fcfc4..3279ac71dbbf403db072763ac7f43c3d7c660390 100644 (file)
@@ -2,7 +2,7 @@
 # PRE: if
 #
 
-&Tmp-String-0 := "%(config:modules.test.boolean)"
+&Tmp-String-0 := "%config(modules.test.boolean)"
 if (!(&Tmp-String-0 == "no")) {
        test_fail
 }
index 7a3fdf22a6627b5db389134ad3a0350abfc35078..3a2f92da9cc667ace5ead7b929e373a65bab4c11 100644 (file)
@@ -1,16 +1,16 @@
 # Set debug to something high, recording the old level
-&Tmp-Integer-0 := "%(debug:4)"
+&Tmp-Integer-0 := "%debug(4)"
 
 # Check debug level is now 4
-if (!("%(debug:4)" == 4)) {
+if (!("%debug(4)" == 4)) {
        test_fail
 }
 
 # Set debug back to the original level
-"%(debug:%{Tmp-Integer-0})"
+"%debug(%{Tmp-Integer-0})"
 
 # Read out the current debug level to verify it changed
-if (!("%(debug:%{Tmp-Integer-0})" == "%{Tmp-Integer-0}")) {
+if (!("%debug(%{Tmp-Integer-0})" == "%{Tmp-Integer-0}")) {
        test_fail
 }
 
index a40990dc60e60c5da235855f97cfbe352b79a844..c19aeca2962e5402cb928f49cb51588805d57a42 100644 (file)
 }
 
 # String - network order representation of a 4 char string
-&Tmp-Integer-1 := "%(integer:%{Tmp-String-0})"
+&Tmp-Integer-1 := "%integer(%{Tmp-String-0})"
 if (!(((integer)&Tmp-String-0 == &Tmp-Integer-1)) || (!(&Tmp-Integer-1 == 9870))) {
        test_fail
 }
 
 # String - network order representation of a 8 char string
-&Tmp-uint64-0 := "%(integer:%{Tmp-String-1})"
+&Tmp-uint64-0 := "%integer(%{Tmp-String-1})"
 if (!((integer64) &Tmp-String-1 == &Tmp-uint64-0) || (!(&Tmp-uint64-0 == 98709870))) {
        test_fail
 }
 
 # String - Can't convert 12 byte string to integer (our biggest native size is a 64bit unsigned int)
-if ("%(integer:%{Tmp-String-2})") {
+if ("%integer(%{Tmp-String-2})") {
        test_fail
 }
 
 # Octets - network order representation of a 4 byte octet string
-&Tmp-Integer-1 := "%(integer:%{Tmp-Octets-0})"
+&Tmp-Integer-1 := "%integer(%{Tmp-Octets-0})"
 
 if (!(%{Tmp-Octets-0} == (octets)%{Tmp-Integer-1})) {
        test_fail
@@ -47,7 +47,7 @@ if (!(&Tmp-Integer-1 == 959985457)) {
 }
 
 # Octets - network order representation of a 8 byte octet string
-&Tmp-uint64-0 := "%(integer:%{Tmp-Octets-1})"
+&Tmp-uint64-0 := "%integer(%{Tmp-Octets-1})"
 
 if (!(%{Tmp-Octets-1} == (octets)%{Tmp-uint64-0})) {
        test_fail
@@ -58,16 +58,16 @@ if (!(&Tmp-uint64-0 == 4123106143410599729)) {
 }
 
 # String - Can't convert 12 byte octet string to integer (our biggest native size is a 64bit unsigned int)
-if ("%(integer:%{Tmp-Octets-2})") {
+if ("%integer(%{Tmp-Octets-2})") {
        test_fail
 }
 
-&Tmp-String-2  := "%(integer:%{Tmp-IP-Address-0})"
-&Tmp-String-3  := "%(integer:%{Tmp-Date-0})"
-&Tmp-String-4  := "%(integer:%{Tmp-Integer-0})"
-&Tmp-String-6  := "%(integer:%{Tmp-Cast-Ifid})"
-&Tmp-String-7  := "%(integer:%{Tmp-Cast-IPv6Addr})"
-&Tmp-String-8  := "%(integer:%{Tmp-Cast-IPv6Prefix})"
+&Tmp-String-2  := "%integer(%{Tmp-IP-Address-0})"
+&Tmp-String-3  := "%integer(%{Tmp-Date-0})"
+&Tmp-String-4  := "%integer(%{Tmp-Integer-0})"
+&Tmp-String-6  := "%integer(%{Tmp-Cast-Ifid})"
+&Tmp-String-7  := "%integer(%{Tmp-Cast-IPv6Addr})"
+&Tmp-String-8  := "%integer(%{Tmp-Cast-IPv6Prefix})"
 
 # IP Address
 if (!(&Tmp-String-2 == '959985458')) {
@@ -103,11 +103,11 @@ if (!(&Tmp-String-8 == '959985465')) {
        test_fail
 }
 
-&Tmp-String-0  := "%(integer:%{Tmp-Cast-Byte})"
-&Tmp-String-1  := "%(integer:%{Tmp-Cast-Short})"
-&Tmp-uint64-2  := "%(integer:%{Tmp-Cast-Ether})"
-&Tmp-String-3  := "%(integer:%{Tmp-Cast-Integer64})"
-&Tmp-String-4  := "%(integer:%{Tmp-Cast-IPv4Prefix})"
+&Tmp-String-0  := "%integer(%{Tmp-Cast-Byte})"
+&Tmp-String-1  := "%integer(%{Tmp-Cast-Short})"
+&Tmp-uint64-2  := "%integer(%{Tmp-Cast-Ether})"
+&Tmp-String-3  := "%integer(%{Tmp-Cast-Integer64})"
+&Tmp-String-4  := "%integer(%{Tmp-Cast-IPv4Prefix})"
 
 # byte
 if (!(&Tmp-String-0 == '58')) {
@@ -144,7 +144,7 @@ if (!(&Tmp-String-4 == '959985470')) {
 }
 
 &Service-Type := Login-User
-&Tmp-Integer-2 := "%(integer:%{Service-Type})"
+&Tmp-Integer-2 := "%integer(%{Service-Type})"
 if (!(&Tmp-Integer-2 == 1)) {
        test_fail
 }
index f7fd52eff6e0f52c7681f4634acf0d763ad62278..0b4c886b07bf1d480d48435db46403c87ab9fd25 100644 (file)
@@ -1,14 +1,14 @@
 #
 #  PRE: if
 #
-#  Note the test for %(interpreter:.line) is sensitive to the position of the
+#  Note the test for %interpreter(.line) is sensitive to the position of the
 #  instruction we're running.
 #
 
-&Tmp-String-0 := "%(interpreter:.filename)"
-&Tmp-Integer-0 := "%(interpreter:.line)"
-&Tmp-String-1 := "%(interpreter:.name)"
-&Tmp-String-2 := "%(interpreter:.type)"
+&Tmp-String-0 := "%interpreter(.filename)"
+&Tmp-Integer-0 := "%interpreter(.line)"
+&Tmp-String-1 := "%interpreter(.name)"
+&Tmp-String-2 := "%interpreter(.type)"
 
 if (!(&Tmp-String-0 == "src/tests/keywords/xlat-interpreter")) {
        test_fail
index 34cab022c6f3f86291cdb4cbddbb029dfba0b106..ed9d012d077e5eaeeffe995fa51a9676787c5ddd 100644 (file)
@@ -77,7 +77,7 @@ if (!(%(subst:%{Tmp-String-0} /z/ b) == 'aaa')) {
 #
 
 # Check that newlines really are newlines
-if (!("%(length:%{Tmp-String-1})" == 3)) {
+if (!("%length(%{Tmp-String-1})" == 3)) {
        test_fail
 }