]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add map tests with nested LHS
authorNick Porter <nick@portercomputing.co.uk>
Tue, 29 Jul 2025 09:56:51 +0000 (10:56 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Tue, 29 Jul 2025 10:02:10 +0000 (11:02 +0100)
src/tests/keywords/map-list
src/tests/modules/sql/map.unlang

index e11ae8a367eea4a0c3af037581568796cc1749a0..c8f5beaea8a44a3da9bf02557cc1bf55caa1f728 100644 (file)
@@ -24,4 +24,12 @@ if (result1 != 'baa') {
        test_fail
 }
 
+map list %str.split('local main other', ' ') {
+       control.IP-Pool.Name := 1
+}
+
+if (control.IP-Pool.Name != 'main') {
+       test_fail
+}
+
 success
index c10a8a8944074b5cd3f4071ebd6b83b4be5ef0ea..69f00ba31486888610a5e7f8b9be41acb86aa4be 100644 (file)
@@ -319,4 +319,13 @@ if !(control.NAS-IP-Address == 10.11.12.13) {
        test_fail
 }
 
+# Check using nested path on the LHS
+map sql "SELECT * FROM radusergroup WHERE priority = 0" {
+       control.IP-Pool.Name := 'username'
+}
+
+if (control.IP-Pool.Name != 'bob') {
+       test_fail
+}
+
 test_pass