def setUp(self): self.usersFile = self._mkstempTestFile(USERS_FILE) self.groupsFile = self._mkstempTestFile(GROUPS_FILE) # Set up the plugin self.options = { 'usersfile': self.usersFile, 'groupsfile': self.groupsFile, 'opennmsgroup': 'Accounting', 'usernameattribute': 'uid', 'fullnameattribute': 'cn', 'emailattribute': 'mail' } self.slapd = slapd.LDAPServer() self.conn = ldapclient.Connection(slapd.SLAPD_URI) self.hc = plugin.HelperController('test', 'splat.helpers.opennms', 5, 'dc=example,dc=com', '(objectClass=sshAccount)', False, self.options) self.entries = self.conn.search(self.hc.searchBase, ldap.SCOPE_SUBTREE, self.hc.searchFilter, self.hc.searchAttr) # We test that checking the modification timestamp on entries works in # plugin.py's test class, so just assume the entry is modified here. self.modified = True
def setUp(self): self.slapd = slapd.LDAPServer() conn = ldapclient.Connection(slapd.SLAPD_URI) self.ctx = daemon.Context(conn) self.hc = plugin.HelperController('test', 'splat.test.test_daemon', 1, 'ou=People,dc=example,dc=com', '(uid=john)', False, None) self.done = False self.failure = None
def setUp(self): self.slapd = slapd.LDAPServer() self.conn = ldapclient.Connection(slapd.SLAPD_URI) options = {'test': 'value'} self.hc = plugin.HelperController('test', 'splat.test.test_plugin', 5, 'dc=example,dc=com', '(uid=john)', False, options) MockHelper.context = None MockHelper.success = False MockHelper.modified = False
def setUp(self): self.slapd = slapd.LDAPServer() self.conn = ldapclient.Connection(slapd.SLAPD_URI) self.options = self._getDefaultOptions() self.hc = plugin.HelperController('test', 'splat.helpers.homeDirectory', 5, 'dc=example,dc=com', '(objectClass=sshAccount)', False, self.options) self.entries = self.conn.search(self.hc.searchBase, ldap.SCOPE_SUBTREE, self.hc.searchFilter, self.hc.searchAttr)
def setUp(self): self.slapd = slapd.LDAPServer() self.conn = ldapclient.Connection(slapd.SLAPD_URI) self.hc = plugin.HelperController('test', 'splat.helpers.purgeUser', 5, 'dc=example,dc=com', '(objectClass=purgeableAccount)', False, self._getDefaultOptions()) self.entries = self.conn.search(self.hc.searchBase, ldap.SCOPE_SUBTREE, self.hc.searchFilter, self.hc.searchAttr) # We test that checking the modification timestamp on entries works in # plugin.py's test class, so just assume the entry is modified here. self.modified = True
def setUp(self): self.options = { 'home':'/home', 'minuid':'0', 'mingid':'0', 'command':'/bin/sh', 'makehome':'true' } self.slapd = slapd.LDAPServer() self.conn = ldapclient.Connection(slapd.SLAPD_URI) self.hc = plugin.HelperController('test', 'splat.helpers.sshPublicKeys', 5, 'dc=example,dc=com', '(objectClass=sshAccount)', False, self.options) self.entries = self.conn.search(self.hc.searchBase, ldap.SCOPE_SUBTREE, self.hc.searchFilter, self.hc.searchAttr) # We test that checking the modification timestamp on entries works in # plugin.py's test class, so just assume the entry is modified here. self.modified = True
def setUp(self): self.slapd = slapd.LDAPServer() self.conn = ldapclient.Connection(slapd.SLAPD_URI)
def setUp(self): self.slapd = slapd.LDAPServer() self.conn = ldapclient.Connection(slapd.SLAPD_URI) self.entry = self.conn.search(slapd.BASEDN, ldap.SCOPE_SUBTREE, '(uid=john)')[0]