예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
    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
예제 #4
0
 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)
예제 #5
0
    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
예제 #6
0
 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
예제 #7
0
 def setUp(self):
     self.slapd = slapd.LDAPServer()
     self.conn = ldapclient.Connection(slapd.SLAPD_URI)
예제 #8
0
 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]