]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove Tmp- attributes from client module tests
authorNick Porter <nick@portercomputing.co.uk>
Mon, 8 Jan 2024 11:44:58 +0000 (11:44 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 8 Jan 2024 11:44:58 +0000 (11:44 +0000)
src/tests/modules/client/map.unlang
src/tests/modules/client/xlat.unlang

index fc9c52344c7d793304dc3101f2c702326c0ed125..2ffe808a364127e14605b34a9331c4dc58fc89ee 100644 (file)
@@ -1,32 +1,32 @@
 map client {
-       &Tmp-String-0 := 'nas_type'
+       &Filter-Id := 'nas_type'
 }
 
-if (&Tmp-String-0 != 'a_type') {
+if (&Filter-Id != 'a_type') {
        test_fail
 }
 
 map client 127.0.0.1 {
-       &Tmp-String-0 := 'nas_type'
+       &Filter-Id := 'nas_type'
 }
 
-if (&Tmp-String-0 != 'a_type') {
+if (&Filter-Id != 'a_type') {
        test_fail
 }
 
 map client 127.0.0.2 {
-       &Tmp-String-0 := 'nas_type'
+       &Filter-Id := 'nas_type'
 }
 
-if (&Tmp-String-0 != 'b_type') {
+if (&Filter-Id != 'b_type') {
        test_fail
 }
 
 map client 127.0.0.5 {
-       &Tmp-String-0 := 'nas_type'
+       &Filter-Id := 'nas_type'
 }
 
-if (&Tmp-String-0 != 'b_type') {
+if (&Filter-Id != 'b_type') {
        test_fail
 }
 
@@ -34,51 +34,56 @@ if (&Tmp-String-0 != 'b_type') {
 #  Test multi-valued maps
 #
 map client {
-       &Tmp-String-1 += 'group'
+       &Callback-Id += 'group'
 }
 
-if (&Tmp-String-1[0] != 'a') {
+if (&Callback-Id[0] != 'a') {
        test_fail
 }
 
-if (&Tmp-String-1[1] != 'b') {
+if (&Callback-Id[1] != 'b') {
        test_fail
 }
 
-if (&Tmp-String-1[2] != 'c') {
+if (&Callback-Id[2] != 'c') {
        test_fail
 }
 
+&request -= &Filter-Id[*]
+
 map client 127.0.0.2 {
-       &Tmp-String-2 += 'group'
+       &Filter-Id += 'group'
 }
 
-if (&Tmp-String-2[0] != 'd') {
+if (&Filter-Id[0] != 'd') {
        test_fail
 }
 
-if (&Tmp-String-2[1] != 'e') {
+if (&Filter-Id[1] != 'e') {
        test_fail
 }
 
-if (&Tmp-String-2[2] != 'f') {
+if (&Filter-Id[2] != 'f') {
        test_fail
 }
 
+&request -= &Filter-Id[*]
+&request -= &Callback-Id[*]
+
 #
 #  Test non-existent client properties
 #
 map client {
-       &Tmp-String-3 := 'non-existent-attr'
-       &Tmp-String-4 += 'non-existing-attr2'
+       &Filter-Id := 'non-existent-attr'
+       &Callback-Id += 'non-existing-attr2'
 }
 
-if (&Tmp-String-3) {
+if (&Filter-Id) {
        test_fail
 }
 
-if (&Tmp-String-4) {
+if (&Callback-Id) {
        test_fail
 }
 
-test_pass
\ No newline at end of file
+test_pass
index 5663b3127ccf06a8236af6dfbf22d84dac1a6d85..97aea127a3a093efa0c48e7459d2da8d33192014 100644 (file)
@@ -1,38 +1,39 @@
-&Tmp-String-0 := "%client('nas_type')"
+string test_string
 
-if (&Tmp-String-0 != 'a_type') {
+&test_string := "%client('nas_type')"
+
+if (&test_string != 'a_type') {
         test_fail
 }
 
-&Tmp-String-0 := "%client('nas_type',127.0.0.1)"
+&test_string := "%client('nas_type',127.0.0.1)"
 
-if (&Tmp-String-0 != 'a_type') {
+if (&test_string != 'a_type') {
         test_fail
 }
 
-&Tmp-String-0 := "%client('nas_type',127.0.0.2)"
+&test_string := "%client('nas_type',127.0.0.2)"
 
-if (&Tmp-String-0 != 'b_type') {
+if (&test_string != 'b_type') {
         test_fail
 }
 
-&Tmp-String-0 := "%client('nas_type',127.0.0.5)"
+&test_string := "%client('nas_type',127.0.0.5)"
 
-if (&Tmp-String-0 != 'b_type') {
+if (&test_string != 'b_type') {
        test_fail
 }
 
 #
 #  Test non-existent client properties
 #
-&Tmp-String-3 := "%client('non-existent-attr')"
-&Tmp-String-4 := "%client('non-existing-attr2')"
-
-if !(&Tmp-String-3 == "") {
+&test_string := "%client('non-existent-attr')"
+if !(&test_string == "") {
        test_fail
 }
 
-if !(&Tmp-String-4 == "") {
+&test_string := "%client('non-existing-attr2')"
+if !(&test_string == "") {
        test_fail
 }