From: Nick Porter Date: Mon, 8 Jan 2024 11:44:58 +0000 (+0000) Subject: Remove Tmp- attributes from client module tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa076694fc74e8afa9699457bc9650103b8bc8e4;p=thirdparty%2Ffreeradius-server.git Remove Tmp- attributes from client module tests --- diff --git a/src/tests/modules/client/map.unlang b/src/tests/modules/client/map.unlang index fc9c52344c7..2ffe808a364 100644 --- a/src/tests/modules/client/map.unlang +++ b/src/tests/modules/client/map.unlang @@ -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 diff --git a/src/tests/modules/client/xlat.unlang b/src/tests/modules/client/xlat.unlang index 5663b3127cc..97aea127a3a 100644 --- a/src/tests/modules/client/xlat.unlang +++ b/src/tests/modules/client/xlat.unlang @@ -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 }