#
ldap
-if (&control.NAS-IP-Address != 1.2.3.4) {
+if (!(&control.NAS-IP-Address == 1.2.3.4)) {
test_fail
}
-if (&control.Reply-Message != "Hello world") {
+if (!(&control.Reply-Message == "Hello world")) {
test_fail
}
}
# IP netmask defined in profile1 should overwrite radprofile value.
-if (&reply.Framed-IP-Netmask != 255.255.0.0) {
+if (!(&reply.Framed-IP-Netmask == 255.255.0.0)) {
test_fail
}
-if (&reply.Acct-Interim-Interval != 1800) {
+if (!(&reply.Acct-Interim-Interval == 1800)) {
test_fail
}
-if (&reply.Idle-Timeout != 3600) {
+if (!(&reply.Idle-Timeout == 3600)) {
test_fail
}
-if (&reply.Session-Timeout != 7200) {
+if (!(&reply.Session-Timeout == 7200)) {
test_fail
}
&Tmp-String-0 := "%{ldap:ldap://$ENV{TEST_SERVER}/uid=john,ou=people,dc=example,dc=com?description}"
-if (&Tmp-String-0 != "User %{User-Name} authenticated") {
+if (!(&Tmp-String-0 == "User %{User-Name} authenticated")) {
test_fail
}
#
# Resolve using group name attribute
#
-if (&LDAP-Group != 'foo') {
+if (!(&LDAP-Group == 'foo')) {
test_fail
}
-if (&LDAP-Group != 'foo') {
+if (!(&LDAP-Group == 'foo')) {
test_fail
}
# Using paircmp xlat expansion. This is only for internal use,
# and will be removed before v4 alpha.
#
-if (!%{paircmp:&LDAP-Group foo}) {
+if (!%(paircmp:&LDAP-Group foo)) {
test_fail
}
#
# Resolve using group DN
#
-if (&LDAP-Group != 'cn=foo,ou=groups,dc=example,dc=com') {
+if (!(&LDAP-Group == 'cn=foo,ou=groups,dc=example,dc=com')) {
test_fail
}
#
# Check we have these values cached
#
-if (&control.LDAP-Cached-Membership[*] != 'foo') {
+if (!(&control.LDAP-Cached-Membership[*] == 'foo')) {
test_fail
}
-if (&control.LDAP-Cached-Membership[*] != 'cn=foo,ou=groups,dc=example,dc=com') {
+if (!(&control.LDAP-Cached-Membership[*] == 'cn=foo,ou=groups,dc=example,dc=com')) {
test_fail
}
# String with no escaping
&control.Tmp-String-0 := "%{ldap_escape:%{Tmp-String-0}}"
-if (&control.Tmp-String-0 != "safe string") {
+if (!(&control.Tmp-String-0 == "safe string")) {
test_fail
}
# String with some characters to escape
&control.Tmp-String-1 := "%{ldap_escape:%{Tmp-String-1}}"
-if (&control.Tmp-String-1 != 'non safe\2c\2b\22\5c\3c\3e\3b\2a\3d\28\29 string') {
+if (!(&control.Tmp-String-1 == 'non safe\2c\2b\22\5c\3c\3e\3b\2a\3d\28\29 string')) {
test_fail
}
# String where all characters require escaping
&control.Tmp-String-2 := "%{ldap_escape:%{Tmp-String-2}}"
-if (&control.Tmp-String-2 != '\2c\2b\22\5c\3c\3e\3b\2a\3d\28\29') {
+if (!(&control.Tmp-String-2 == '\2c\2b\22\5c\3c\3e\3b\2a\3d\28\29')) {
test_fail
}
&Tmp-String-3 := "%{ldap_unescape:%{control.Tmp-String-0}}"
-if (&Tmp-String-3 != 'safe string') {
+if (!(&Tmp-String-3 == 'safe string')) {
test_fail
}
&Tmp-String-4 := "%{ldap_unescape:%{control.Tmp-String-1}}"
-if (&Tmp-String-4 != 'non safe,+"\<>;*=() string') {
+if (!(&Tmp-String-4 == 'non safe,+"\<>;*=() string')) {
test_fail
}
&Tmp-String-5 := "%{ldap_unescape:%{control.Tmp-String-2}}"
-if (&Tmp-String-5 != ',+"\<>;*=()') {
+if (!(&Tmp-String-5 == ',+"\<>;*=()')) {
test_fail
}
&Tmp-String-6 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=people,dc=example,dc=com?displayName?sub?(uid=john)}"
-if (&Tmp-String-6 != "John Doe") {
+if (!(&Tmp-String-6 == "John Doe")) {
test_fail
}
# Return multiple values - could be in any sequence
&Tmp-String-7 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=clients,dc=example,dc=com?radiusClientIdentifier?sub?(objectClass=radiusClient)}"
-if ((&Tmp-String-7 != "1.1.1.12.2.2.2") && (&Tmp-String-7 != "2.2.2.21.1.1.1")) {
+if (!(&Tmp-String-7 == "1.1.1.12.2.2.2") && !(&Tmp-String-7 == "2.2.2.21.1.1.1")) {
test_fail
}
# Use tainted string in filter - with special characters
&Tmp-String-8 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=people,dc=example,dc=com?cn?sub?(displayName=*%{Tmp-String-9}*)}"
-if (&Tmp-String-8 != "Bob Smith") {
+if (!(&Tmp-String-8 == "Bob Smith")) {
test_fail
}
# A query which should return no results
&Tmp-String-0 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=people,dc=example,dc=com?displayName?sub?(uid=notknown)}"
-if (&Tmp-String-0 != "") {
+if (!(&Tmp-String-0 == "")) {
test_fail
}
# Request an invalid DN
&Tmp-String-0 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=notthere?displayName?sub?(uid=john)}"
-if (&Tmp-String-0 != "") {
+if (!(&Tmp-String-0 == "")) {
test_fail
}
# Query within a dn which will prompt a referral
&Tmp-String-0 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
-if (&Tmp-String-0 != "Fred Jones") {
+if (!(&Tmp-String-0 == "Fred Jones")) {
test_fail
}
# Reference an alternative LDAP server in the xlat
&Tmp-String-1 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:%{expr:$ENV{LDAP_TEST_SERVER_PORT} + 1}/dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
-if (&Tmp-String-1 != "Fred Jones") {
+if (!(&Tmp-String-1 == "Fred Jones")) {
test_fail
}
# This query will follow 2 referrals, the second will present an alternate search base
&Tmp-String-2 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=offsite,dc=subdept,dc=example,dc=com?displayName?sub?(uid=john)}"
-if (&Tmp-String-2 != "John Doe") {
+if (!(&Tmp-String-2 == "John Doe")) {
test_fail
}
# This query will follow 3 referrals - more than our max referral depth
&Tmp-String-3 := "%{ldap:ldap://$ENV{LDAP_TEST_SERVER}:$ENV{LDAP_TEST_SERVER_PORT}/ou=bounce1,dc=subdept,dc=example,dc=com?displayName?sub?(uid=fred)}"
-if (&Tmp-String-3 != "") {
+if (!(&Tmp-String-3 == "")) {
test_fail
}
-if (&Module-Failure-Message != "Maximum LDAP referral depth (2) exceeded") {
+if (!(&Module-Failure-Message == "Maximum LDAP referral depth (2) exceeded")) {
test_fail
}