Beispiel #1
0
 def test_rdn_attr_type_alias(self):
     # is_rdn_equal returns False for same RDNs even when attr type alias is
     # used. Note that this is a limitation since an LDAP server should
     # consider them equal.
     rdn1 = ldap.dn.str2dn('cn=cn1')[0]
     rdn2 = ldap.dn.str2dn('2.5.4.3=cn1')[0]
     self.assertFalse(ks_ldap.is_rdn_equal(rdn1, rdn2))
Beispiel #2
0
 def test_rdn_attr_type_alias(self):
     # is_rdn_equal returns False for same RDNs even when attr type alias is
     # used. Note that this is a limitation since an LDAP server should
     # consider them equal.
     rdn1 = ldap.dn.str2dn('cn=cn1')[0]
     rdn2 = ldap.dn.str2dn('2.5.4.3=cn1')[0]
     self.assertFalse(ks_ldap.is_rdn_equal(rdn1, rdn2))
Beispiel #3
0
 def test_rdn_multi_ava_diff_order(self):
     # is_rdn_equal returns True if the RDNs have the same number of AVAs
     # and the values are the same, even if in a different order
     rdn1 = ldap.dn.str2dn('cn=cn1+ou=ou1')[0]
     rdn2 = ldap.dn.str2dn('ou=OU1+cn=CN1')[0]
     self.assertTrue(ks_ldap.is_rdn_equal(rdn1, rdn2))
Beispiel #4
0
 def test_rdn_diff_length(self):
     # is_rdn_equal returns False if the RDNs have a different number of
     # AVAs.
     rdn1 = ldap.dn.str2dn('cn=cn1')[0]
     rdn2 = ldap.dn.str2dn('cn=cn1+ou=ou1')[0]
     self.assertFalse(ks_ldap.is_rdn_equal(rdn1, rdn2))
Beispiel #5
0
 def test_rdn_same(self):
     # is_rdn_equal returns True if the two values are the same.
     rdn = ldap.dn.str2dn('cn=val1')[0]
     self.assertTrue(ks_ldap.is_rdn_equal(rdn, rdn))
Beispiel #6
0
 def test_rdn_attr_type_case_diff(self):
     # is_rdn_equal returns True for same RDNs even when attr type case is
     # different.
     rdn1 = ldap.dn.str2dn('cn=cn1')[0]
     rdn2 = ldap.dn.str2dn('CN=cn1')[0]
     self.assertTrue(ks_ldap.is_rdn_equal(rdn1, rdn2))
Beispiel #7
0
 def test_rdn_multi_ava_diff_type(self):
     # is_rdn_equal returns False if the RDNs have the same number of AVAs
     # and the attribute types are different.
     rdn1 = ldap.dn.str2dn('cn=cn1+ou=ou1')[0]
     rdn2 = ldap.dn.str2dn('cn=cn1+sn=sn1')[0]
     self.assertFalse(ks_ldap.is_rdn_equal(rdn1, rdn2))
Beispiel #8
0
 def test_rdn_multi_ava_diff_order(self):
     # is_rdn_equal returns True if the RDNs have the same number of AVAs
     # and the values are the same, even if in a different order
     rdn1 = ldap.dn.str2dn('cn=cn1+ou=ou1')[0]
     rdn2 = ldap.dn.str2dn('ou=OU1+cn=CN1')[0]
     self.assertTrue(ks_ldap.is_rdn_equal(rdn1, rdn2))
Beispiel #9
0
 def test_rdn_diff_length(self):
     # is_rdn_equal returns False if the RDNs have a different number of
     # AVAs.
     rdn1 = ldap.dn.str2dn('cn=cn1')[0]
     rdn2 = ldap.dn.str2dn('cn=cn1+ou=ou1')[0]
     self.assertFalse(ks_ldap.is_rdn_equal(rdn1, rdn2))
Beispiel #10
0
 def test_rdn_same(self):
     # is_rdn_equal returns True if the two values are the same.
     rdn = ldap.dn.str2dn('cn=val1')[0]
     self.assertTrue(ks_ldap.is_rdn_equal(rdn, rdn))
Beispiel #11
0
 def test_rdn_attr_type_case_diff(self):
     # is_rdn_equal returns True for same RDNs even when attr type case is
     # different.
     rdn1 = ldap.dn.str2dn('cn=cn1')[0]
     rdn2 = ldap.dn.str2dn('CN=cn1')[0]
     self.assertTrue(ks_ldap.is_rdn_equal(rdn1, rdn2))
Beispiel #12
0
 def test_rdn_multi_ava_diff_type(self):
     # is_rdn_equal returns False if the RDNs have the same number of AVAs
     # and the attribute types are different.
     rdn1 = ldap.dn.str2dn('cn=cn1+ou=ou1')[0]
     rdn2 = ldap.dn.str2dn('cn=cn1+sn=sn1')[0]
     self.assertFalse(ks_ldap.is_rdn_equal(rdn1, rdn2))
Beispiel #13
0
 def test_rdn_multi_ava_same_order(self):
     # is_rdn_equal returns True if the RDNs have the same number of AVAs
     # and the values are the same.
     rdn1 = ldap.dn.str2dn("cn=cn1+ou=ou1")[0]
     rdn2 = ldap.dn.str2dn("cn=CN1+ou=OU1")[0]
     self.assertTrue(ks_ldap.is_rdn_equal(rdn1, rdn2))