summaryrefslogtreecommitdiffstats
path: root/src/tests/intg/ds_openldap.py
Commit message (Collapse)AuthorAgeFilesLines
* intg: Use bytes for value of attributes in ldifLukas Slebodnik2017-01-161-12/+12
| | | | | | | | 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>
* intg: Fix creating of slapd configurationLukas Slebodnik2017-01-161-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* intg: Use bytes with hash functionLukas Slebodnik2017-01-161-2/+3
| | | | | | | | | | | | | | | | | | 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>
* intg: Fix python2,3 urllibLukas Slebodnik2017-01-161-2/+6
| | | | | | | | 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>
* intg: Change preference of openldap module pathLukas Slebodnik2016-02-091-2/+2
| | | | | | | | | | | 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>
* intg: Fix all PEP8 issuesNikolai Kondrashov2015-10-221-19/+20
| | | | Reviewed-by: Michal Židek <mzidek@redhat.com>
* intg: Do not use non-existent pre-incrementNikolai Kondrashov2015-10-111-2/+4
| | | | | | | | | | 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>
* intg: Fix some PEP 8 violationsMichal Židek2015-09-031-0/+2
| | | | Reviewed-by: Pavel Reichl <preichl@redhat.com>
* intg: Modernize 'except' clausesLukas Slebodnik2015-08-041-1/+1
| | | | | | | The 'as' syntax works from Python 2 on, and Python 3 dropped the "comma" syntax. Reviewed-by: Christian Heimes <cheimes@redhat.com>
* Add integration testsNikolai Kondrashov2015-05-281-0/+279
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>