History log of /sssd-io/src/tests/intg/ent.py
Revision Date Author Comments Expand
554734a2073eaf1e862bfc08b1e9761931455454 16-Jan-2017 Lukas Slebodnik <lslebodn@redhat.com>

intg: Return list for enumeration functions The documentation of get_passwd_list/get_group_list says that they return group/user database entry list. However, ther return class 'map' with python3 due to changes in high level function "map". Traceback (most recent call last): File "/dev/shm/sssd/src/tests/intg/ent_test.py", line 141, in test_assert_passwd_list ent.assert_passwd_list(ent.contains()) File "/dev/shm/sssd/src/tests/intg/ent.py", line 243, in assert_passwd_list assert not d, d AssertionError: not a list, <class 'map'> Reviewed-by: Martin Basti <mbasti@redhat.com>

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

intg: Avoid using iteritems for dictionary Originally, Python items() built a real list of tuples and returned that. That could potentially take a lot of extra memory. Python iteritems() returned an iterator-generator. The original remains for backwards compatibility. One of Python 3’s changes is that items() now return iterators, and a list is never fully built. The iteritems() method is also gone, since items() in Python 3 works like viewitems() in Python2. But we do not have a lot of values in dictionary; so it does not worth to optimize returned list from "items()" on Python2 Reviewed-by: Martin Basti <mbasti@redhat.com>

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

intg: Avoid using xrange in tests In Python 2 range() returns a list, and xrange() returns an object that will only generate the items in the range when needed, saving memory. In Python 3, the range() function is gone, and xrange() has been renamed range(). We do not strictly require list or iterator in code therefore we can use range which is in poth version. And we do not use big ranges there so the memory overhead with list on python2 is not big. Reviewed-by: Martin Basti <mbasti@redhat.com>

46c89176fd7f140d785bbdc399a94daca269172e 26-Oct-2015 Lukas Slebodnik <lslebodn@redhat.com>

intg_tests: Fix PEP8 warnings Reviewed-by: Michal Židek <mzidek@redhat.com>

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

intg: Fix all PEP8 issues 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>