From: Nick Porter Date: Thu, 5 Jun 2025 08:17:00 +0000 (+0100) Subject: Add tests of %ldap.uri.attr_option X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b51450ea9dde29f8952fb9d643c852646120a8a;p=thirdparty%2Ffreeradius-server.git Add tests of %ldap.uri.attr_option --- diff --git a/src/tests/modules/ldap/xlat.unlang b/src/tests/modules/ldap/xlat.unlang index dd2bbdd00fa..67e1113afe5 100644 --- a/src/tests/modules/ldap/xlat.unlang +++ b/src/tests/modules/ldap/xlat.unlang @@ -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