]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add tests of %ldap.uri.attr_option
authorNick Porter <nick@portercomputing.co.uk>
Thu, 5 Jun 2025 08:17:00 +0000 (09:17 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 5 Jun 2025 08:17:00 +0000 (09:17 +0100)
src/tests/modules/ldap/xlat.unlang

index dd2bbdd00faa8e97abfc68b2335dbccacb0e815d..67e1113afe5dbae60dd4a8e32dcfa27928443e73 100644 (file)
@@ -127,4 +127,24 @@ if (result_string != '2.2.2.2') {
        test_fail
 }
 
+result_string := %ldap.uri.attr_option("ldap:///ou=people,dc=example,dc=com?displayName?base?", "lang_en");
+if (result_string != 'ldap:///ou=people,dc=example,dc=com?displayName;lang_en?base?') {
+       test_fail
+}
+
+result_string := %ldap.uri.attr_option("ldap:///ou=people,dc=example,dc=com?displayName;lang_en?base?(uid=john)", "lang_en");
+if (result_string != 'ldap:///ou=people,dc=example,dc=com?displayName;lang_en?base?(uid=john)') {
+       test_fail
+}
+
+result_string := %ldap.uri.attr_option("ldap://localhost/ou=people,dc=example,dc=com?displayName;lang_en?base?(uid=john)", "binary");
+if (result_string != 'ldap://localhost:389/ou=people,dc=example,dc=com?displayName;lang_en;binary?base?(uid=john)') {
+       test_fail
+}
+
+result_string := %ldap.uri.attr_option("ldap://localhost:3890/ou=people,dc=example,dc=com?displayName;binary;lang_en?base?(uid=john)", "binary");
+if (result_string != 'ldap://localhost:3890/ou=people,dc=example,dc=com?displayName;binary;lang_en?base?(uid=john)') {
+       test_fail
+}
+
 test_pass