History log of /sssd-io/src/tests/intg/ds_openldap.py
Revision Date Author Comments Expand
36df33cd44774a5b5eab52ab222bcd3240b3ca5a 16-Oct-2017 Lukas Slebodnik <lslebodn@redhat.com>

intg: Create FakeAD class based on openldap FakeAD is openldap with ldif schema which allows to load static data from real AD. Instance of class will also contain some predefined users/groups which can be used for basic sanity testing in sssd of AD features. Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

ebbd9a2b551feffd2040f35d938f6800fba1b278 16-Oct-2017 Lukas Slebodnik <lslebodn@redhat.com>

ds_openldap: Extract functionality to protected methods Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

1097a61a8d4a892e126d14631c1b80fc1a5ce976 16-Jan-2017 Lukas Slebodnik <lslebodn@redhat.com>

intg: Use bytes for value of attributes in ldif Python3 version of ldap module require string for name of attribute but bytes for value of attribute. It was not a problem in python2 due to unicode changes in python3 Reviewed-by: Martin Basti <mbasti@redhat.com>

73c9e3d710434857b5e13d5ccfc1f1245b1d2997 16-Jan-2017 Lukas Slebodnik <lslebodn@redhat.com>

intg: Fix creating of slapd configuration The python module subprocess expect bytes as an input. Traceback (most recent call last): File "src/tests/intg/test_ldap.py", line 51, in ds_inst ds_inst.setup() File "src/tests/intg/ds_openldap.py", line 201, in setup self._setup_config() File "src/tests/intg/ds_openldap.py", line 169, in _setup_config slapadd.communicate(config) File "/usr/lib64/python3.6/subprocess.py", line 821, in communicate self._stdin_write(input) File "/usr/lib64/python3.6/subprocess.py", line 776, in _stdin_write self.stdin.write(input) TypeError: a bytes-like object is required, not 'str' Reviewed-by: Martin Basti <mbasti@redhat.com>

e1711a2b2cb904f7edc26cc68566e064896d4f8a 16-Jan-2017 Lukas Slebodnik <lslebodn@redhat.com>

intg: Use bytes with hash function Python3 expects bytes as an input for hash function. We need to convert string to bytes before hashing Traceback (most recent call last): File "src/tests/intg/test_ldap.py", line 51, in ds_inst ds_inst.setup() File "src/tests/intg/ds_openldap.py", line 200, in setup self._setup_config() File "src/tests/intg/ds_openldap.py", line 76, in _setup_config admin_pw_hash = hash_password(self.admin_pw) File "src/tests/intg/ds_openldap.py", line 41, in hash_password hash = hashlib.sha1(password) TypeError: Unicode-objects must be encoded before hashing Reviewed-by: Martin Basti <mbasti@redhat.com>

c46dec3dfad9e83321cc9d3185d93f0e8c38f57e 16-Jan-2017 Lukas Slebodnik <lslebodn@redhat.com>

intg: Fix python2,3 urllib The three modules urllib, urllib2 and urlparse has been reorganized into three new modules, urllib.request, urllib.parse and urllib.error. And urllib.quote was moved into urllib.parse. Reviewed-by: Martin Basti <mbasti@redhat.com>

bf472d2422599d14345e7cd9999289c26455c622 09-Feb-2016 Lukas Slebodnik <lslebodn@redhat.com>

intg: Change preference of openldap module path The /usr/lib64 should be preffered path for searching binary modules for openldap backends. The /usr/lib/ should be used for storing no binary files on 64 bit platform e.g. scripts ... The current vresion of would choose /usr/lib/ even though /usr/lib64 contains real openldap modules. Reviewed-by: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>

efdcf49660505e13607b99ba82eb504cf37b8794 22-Oct-2015 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>

intg: Fix all PEP8 issues Reviewed-by: Michal Židek <mzidek@redhat.com>

c4d2fc3c12656faeb3fb7ca20c922ca62edf13a0 11-Oct-2015 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>

intg: Do not use non-existent pre-increment Do not try to use the pre-increment operator which doesn't exist in Python (and is in fact two "identity" operators - opposites of "negation" operators). Use addition and assignment instead. This fixes infinite loops on failed slapd starting and stopping. Reviewed-by: Michal Židek <mzidek@redhat.com>

60713f738cedb6e4239604baf6619a0ca986fa49 03-Sep-2015 Michal Židek <mzidek@redhat.com>

intg: Fix some PEP 8 violations Reviewed-by: Pavel Reichl <preichl@redhat.com>

872aa0d01d1642f9c8fc204d4c33e5c5640c3352 04-Aug-2015 Lukas Slebodnik <lslebodn@redhat.com>

intg: Modernize 'except' clauses The 'as' syntax works from Python 2 on, and Python 3 dropped the "comma" syntax. Reviewed-by: Christian Heimes <cheimes@redhat.com>

9d453f1e8b28983b363b44c49b7cd701a994fd97 28-May-2015 Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>

Add integration tests Add "intgcheck" make target. Update CI to use it. The "intgcheck" target configures and builds sssd in a sub-directory, installs it into a prefix in another sub-directory, and then makes the "intgcheck-installed" target from within src/tests/intg in that separate build. The "intgcheck-installed" target in src/tests/intg runs py.test for all tests it can find in that directory, under fakeroot and nss_wrapper/uid_wrapper environments emulating running under root. It also adds the value of INTGCHECK_PYTEST_ARGS environment/make variable to the py.test command line. You can use it to pass additional py.test options, such as specifying a subset of tests to run. See "py.test --help" output. There are only two test suites in src/tests/intg at the moment: ent_test.py and ldap_test.py. The ent_test.py runs tests on ent.py - a module of assertion functions for checking entries in NSS database (passwd and group), for use in actual tests. The ent_test.py suite can be used as ent.py usage reference. The ldap_test.py suite sets up and starts a slapd instance, adds a few user and group entries, configures and starts sssd and verifies that those users and groups are retrieved correctly using various NSS functions. The tests are very basic at the moment. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Michal Židek <mzidek@redhat.com>