コード例 #1
0
    def test_selectDN(self):
        """
		Select licence by LDAP DN.
		"""
        ret = ul.selectDN('cn=admin,cn=license,cn=univention,%s')
        self.assertEqual(ret, 0)
        ul.free()
コード例 #2
0
    def test_select(self):
        """
		Select licence by LDAP search `(univentionLicenseModule=admin)`
		"""
        ret = ul.select('admin')
        self.assertEqual(ret, 0)
        ul.free()
        ul.free()
コード例 #3
0
    def test_getValues(self):
        """
		Return value from globally selected licence.
		"""
        ret = ul.select('admin')
        self.assertEqual(ret, 0)
        val = ul.getValue('univentionLicenseBaseDN')
        self.assertIsNotNone(val)
        ul.free()
コード例 #4
0
    def test_check(self):
        """
		Just check licence by LDAP DN. Returns bit-field:

		0b0001: Invalid signature
		0b0010: Invalid end date
		0b0100: Invalid base DN
		0b1000: Invalid search path
		"""
        ret = ul.check('cn=admin,cn=license,cn=univention,%s')
        self.assertEqual(ret, 0)
        ul.free()
コード例 #5
0
 def test_double_free(self):
     ul.free()
     ul.free()