Skip to content

tox fails #370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jugmac00 opened this issue Jul 31, 2020 · 22 comments
Open

tox fails #370

jugmac00 opened this issue Jul 31, 2020 · 22 comments

Comments

@jugmac00
Copy link

Please describe the issue and your environment here.

I tried to run tox on my machine and it fails.

Steps to reproduce:

❯ tox -e py38
GLOB sdist-make: /home/jugmac00/Projects/python-ldap/setup.py
py38 inst-nodeps: /home/jugmac00/Projects/python-ldap/.tox/.tmp/package/1/python-ldap-3.3.0.zip
py38 installed: pyasn1==0.4.8,pyasn1-modules==0.2.8,python-ldap @ file:///home/jugmac00/Projects/python-ldap/.tox/.tmp/package/1/python-ldap-3.3.0.zip
py38 run-test-pre: PYTHONHASHSEED='3830792126'
py38 run-test: commands[0] | /home/jugmac00/Projects/python-ldap/.tox/py38/bin/python -bb -Werror -m unittest discover -v -s Tests -p 't_*'
ERROR
ERROR
test_cidict (t_cidict.TestCidict)
test function is_dn() ... ok
test_cidict_data (t_cidict.TestCidict)
test the deprecated data atrtribute ... ok
test_strlist_deprecated (t_cidict.TestCidict) ... ok
ERROR
test_deprecated (t_ldap_asyncsearch.TestLdapAsyncSearch) ... ok
test_assertioncontrol (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_matchedvalues (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_pagedresults_decode (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_pagedresults_encode (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_ppolicy_graceauth (t_ldap_controls_ppolicy.TestControlsPPolicy) ... ok
test_ppolicy_timebefore (t_ldap_controls_ppolicy.TestControlsPPolicy) ... ok
test_create_sss_request_control (t_ldap_controls_sss.TestControlsPPolicy) ... ok
test_dn2str (t_ldap_dn.TestDN)
test function dn2str() ... ok
test_escape_dn_chars (t_ldap_dn.TestDN)
test function escape_dn_chars() ... ok
test_explode_dn (t_ldap_dn.TestDN)
test function explode_dn() ... ok
test_explode_rdn (t_ldap_dn.TestDN)
test function explode_rdn() ... ok
test_is_dn (t_ldap_dn.TestDN)
test function is_dn() ... ok
test_str2dn (t_ldap_dn.TestDN)
test function str2dn() ... ok
test_escape_filter_chars_mode0 (t_ldap_filter.TestDN)
test function escape_filter_chars() with escape_mode=0 ... ok
test_escape_filter_chars_mode1 (t_ldap_filter.TestDN)
test function escape_filter_chars() with escape_mode=1 ... ok
test_escape_filter_chars_mode2 (t_ldap_filter.TestDN)
test function escape_filter_chars() with escape_mode=2 ... ok
test_escape_str (t_ldap_functions.TestFunction)
test function escape_string_tmpl() ... ok
test_ldap_strf_secs (t_ldap_functions.TestFunction)
test function ldap_strf_secs() ... ok
test_ldap_strp_secs (t_ldap_functions.TestFunction)
test function ldap_strp_secs() ... ok
test_addModlist (t_ldap_modlist.TestModlist) ... ok
test_modifyModlist (t_ldap_modlist.TestModlist) ... ok
test_cafile (t_ldap_options.TestGlobalOptions) ... ok
test_client_controls (t_ldap_options.TestGlobalOptions) ... ok
test_invalid (t_ldap_options.TestGlobalOptions) ... ok
test_network_timeout (t_ldap_options.TestGlobalOptions) ... ok
test_readonly (t_ldap_options.TestGlobalOptions) ... ok
test_server_controls (t_ldap_options.TestGlobalOptions) ... ok
test_timeout (t_ldap_options.TestGlobalOptions) ... ok
test_uri (t_ldap_options.TestGlobalOptions) ... ok
ERROR
ERROR
test_attributetype_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of an AttributeType object's attributes ... ok
test_empty_attributetype_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of attributes of a minimal AttributeType ... ok
test_empty_objectclass_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of attributes of a minimal ObjectClass ... ok
test_objectclass_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of an ObjectClass object's attributes ... ok
test_subschema_file (t_ldap_schema_subentry.TestSubschemaLDIF) ... ok
test_urlfetch_file (t_ldap_schema_subentry.TestSubschemaUrlfetch) ... ok
ERROR
test_origin_multi_valued (t_ldap_schema_subentry.TestXOrigin) ... ok
test_origin_multi_valued_str (t_ldap_schema_subentry.TestXOrigin)
Check string representation of an attr with multi-value X-ORIGIN ... ok
test_origin_none (t_ldap_schema_subentry.TestXOrigin) ... ok
test_origin_none_str (t_ldap_schema_subentry.TestXOrigin)
Check string representation of an attribute without X-ORIGIN ... ok
test_origin_string (t_ldap_schema_subentry.TestXOrigin) ... ok
test_origin_string_str (t_ldap_schema_subentry.TestXOrigin)
Check string representation of an attr with single-value X-ORIGIN ... ok
test_set_origin_list (t_ldap_schema_subentry.TestXOrigin)
Check that setting X-ORIGIN to a list makes entry unusable ... ok
test_set_origin_str (t_ldap_schema_subentry.TestXOrigin)
Check that setting X-ORIGIN to a string makes entry unusable ... ok
test_set_origin_tuple (t_ldap_schema_subentry.TestXOrigin)
Check that setting X-ORIGIN to a tuple works ... ok
test_basic (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_BASIC ... ok
test_broken (t_ldap_schema_tokenizer.TestSplitTokens) ... ok
test_broken_oid (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_BROKEN_OID ... ok
test_escaped_quotes (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_ESCAPED_QUOTES ... ok
test_utf8 (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_BASIC ... ok
test_syncidset_message (t_ldap_syncrepl.DecodeSyncreplProtoTests)
A syncrepl server may send a sync info message, with a syncIdSet ... ok
ERROR
ERROR
ERROR
ERROR
test_isLDAPUrl (t_ldapurl.TestIsLDAPUrl) ... ok
test_bad_urls (t_ldapurl.TestLDAPUrl) ... expected failure
test_combo (t_ldapurl.TestLDAPUrl) ... ok
test_parse_attrs (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_attrs (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_extensions (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_filter (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_hostport (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_scope (t_ldapurl.TestLDAPUrl) ... ok
test_parse_dn (t_ldapurl.TestLDAPUrl) ... ok
test_parse_empty_dn (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions_5questions (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions_novalue (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions_nulls (t_ldapurl.TestLDAPUrl) ... ok
test_parse_filter (t_ldapurl.TestLDAPUrl) ... ok
test_parse_hostport (t_ldapurl.TestLDAPUrl) ... ok
test_parse_schemes (t_ldapurl.TestLDAPUrl) ... ok
test_parse_scope (t_ldapurl.TestLDAPUrl) ... ok
test_parse_scope_default (t_ldapurl.TestLDAPUrl) ... ok
test_ldapurl (t_ldapurl.TestParseLDAPUrl) ... ok
test_bad_change_records (t_ldif.TestChangeRecords) ... ok
test_empty (t_ldif.TestChangeRecords) ... ok
test_missing_trailing_dash_separator (t_ldif.TestChangeRecords) ... ok
test_mod_increment (t_ldif.TestChangeRecords) ... ok
test_simple (t_ldif.TestChangeRecords) ... ok
test_weird_empty_lines (t_ldif.TestChangeRecords) ... ok
test_big_binary (t_ldif.TestEntryRecords) ... ok
test_binary (t_ldif.TestEntryRecords) ... ok
test_binary2 (t_ldif.TestEntryRecords) ... ok
test_comments (t_ldif.TestEntryRecords) ... ok
test_empty (t_ldif.TestEntryRecords) ... ok
test_empty_attr_values (t_ldif.TestEntryRecords) ... ok
test_folded (t_ldif.TestEntryRecords) ... ok
test_ignored_attr_types (t_ldif.TestEntryRecords) ... ok
test_max_entries (t_ldif.TestEntryRecords) ... ok
test_missing_trailing_line_separator (t_ldif.TestEntryRecords) ... ok
test_multiple (t_ldif.TestEntryRecords) ... ok
test_multiple_empty_lines (t_ldif.TestEntryRecords)
test malformed LDIF with multiple empty lines ... ok
test_simple (t_ldif.TestEntryRecords) ... ok
test_simple2 (t_ldif.TestEntryRecords) ... ok
test_sorted (t_ldif.TestEntryRecords) ... ok
test_unencoded_unicode (t_ldif.TestEntryRecords) ... ok
test_unicode (t_ldif.TestEntryRecords) ... ok
test_weird_empty_lines (t_ldif.TestEntryRecords) ... ok
test_context_manager (t_slapdobject.TestSlapdObject) ... ERROR
test_context_manager_after_start (t_slapdobject.TestSlapdObject) ... ERROR

======================================================================
ERROR: setUpClass (t_bind.TestBinds)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_cext.TestLdapCExtension)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_cext.py", line 31, in setUpClass
    super(TestLdapCExtension, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_edit.EditionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_edit.py", line 16, in setUpClass
    super(EditionTests, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldap_options.TestLDAPObjectOptions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldap_sasl.TestSasl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldap_sasl.py", line 50, in setUpClass
    super(TestSasl, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldap_schema_subentry.TestSubschemaUrlfetchSlapd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldap_syncrepl.TestSyncrepl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldap_syncrepl.py", line 265, in setUpClass
    super(BaseSyncreplTests, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldapobject.Test00_SimpleLDAPObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldapobject.py", line 75, in setUpClass
    super(Test00_SimpleLDAPObject, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldapobject.Test01_ReconnectLDAPObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldapobject.py", line 75, in setUpClass
    super(Test00_SimpleLDAPObject, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldapobject.Test03_SimpleLDAPObjectWithFileno)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldapobject.py", line 75, in setUpClass
    super(Test00_SimpleLDAPObject, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: test_context_manager (t_slapdobject.TestSlapdObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_slapdobject.py", line 8, in test_context_manager
    with slapdtest.SlapdObject() as server:
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 579, in __enter__
    self.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: test_context_manager_after_start (t_slapdobject.TestSlapdObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_slapdobject.py", line 14, in test_context_manager_after_start
    server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 406, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

----------------------------------------------------------------------
Ran 101 tests in 1.507s

FAILED (errors=12, expected failures=1)
ERROR: InvocationError for command /home/jugmac00/Projects/python-ldap/.tox/py38/bin/python -bb -Werror -m unittest discover -v -s Tests -p 't_*' (exited with code 1)
____________________________________________________________ summary ____________________________________________________________
ERROR:   py38: commands failed

Operating system:
Ubuntu 18.04

Python version:
3.8.5

python-ldap version:
current master = 2e34d75

I am bit suspicious that my tests fail while Travis, which also runs tox via tox-travis works. :-(

I installed the dev dependencies as described in the installation guide:

# apt-get install build-essential python3-dev python2.7-dev \
    libldap2-dev libsasl2-dev slapd ldap-utils tox \
    lcov valgrind

Any help is appreciated. Thanks!

@tiran
Copy link
Member

tiran commented Jul 31, 2020

Please modify Lib/slapdtest/_slapdtest.py at line 404 and replace subprocess.Popen(popen_list) with subprocess.check_call(popen_list). That should print out the error message from slapd -Ttest.

Christian

tiran added a commit to tiran/python-ldap that referenced this issue Jul 31, 2020
Related: python-ldap#370
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@jugmac00
Copy link
Author

Thanks for the quick response!

❯ tox -e py38
GLOB sdist-make: /home/jugmac00/Projects/python-ldap/setup.py
py38 inst-nodeps: /home/jugmac00/Projects/python-ldap/.tox/.tmp/package/1/python-ldap-3.3.0.zip
py38 installed: pyasn1==0.4.8,pyasn1-modules==0.2.8,python-ldap @ file:///home/jugmac00/Projects/python-ldap/.tox/.tmp/package/1/python-ldap-3.3.0.zip
py38 run-test-pre: PYTHONHASHSEED='3407328550'
py38 run-test: commands[0] | /home/jugmac00/Projects/python-ldap/.tox/py38/bin/python -bb -Werror -m unittest discover -v -s Tests -p 't_*'
ERROR
ERROR
test_cidict (t_cidict.TestCidict)
test function is_dn() ... ok
test_cidict_data (t_cidict.TestCidict)
test the deprecated data atrtribute ... ok
test_strlist_deprecated (t_cidict.TestCidict) ... ok
ERROR
test_deprecated (t_ldap_asyncsearch.TestLdapAsyncSearch) ... ok
test_assertioncontrol (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_matchedvalues (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_pagedresults_decode (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_pagedresults_encode (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_ppolicy_graceauth (t_ldap_controls_ppolicy.TestControlsPPolicy) ... ok
test_ppolicy_timebefore (t_ldap_controls_ppolicy.TestControlsPPolicy) ... ok
test_create_sss_request_control (t_ldap_controls_sss.TestControlsPPolicy) ... ok
test_dn2str (t_ldap_dn.TestDN)
test function dn2str() ... ok
test_escape_dn_chars (t_ldap_dn.TestDN)
test function escape_dn_chars() ... ok
test_explode_dn (t_ldap_dn.TestDN)
test function explode_dn() ... ok
test_explode_rdn (t_ldap_dn.TestDN)
test function explode_rdn() ... ok
test_is_dn (t_ldap_dn.TestDN)
test function is_dn() ... ok
test_str2dn (t_ldap_dn.TestDN)
test function str2dn() ... ok
test_escape_filter_chars_mode0 (t_ldap_filter.TestDN)
test function escape_filter_chars() with escape_mode=0 ... ok
test_escape_filter_chars_mode1 (t_ldap_filter.TestDN)
test function escape_filter_chars() with escape_mode=1 ... ok
test_escape_filter_chars_mode2 (t_ldap_filter.TestDN)
test function escape_filter_chars() with escape_mode=2 ... ok
test_escape_str (t_ldap_functions.TestFunction)
test function escape_string_tmpl() ... ok
test_ldap_strf_secs (t_ldap_functions.TestFunction)
test function ldap_strf_secs() ... ok
test_ldap_strp_secs (t_ldap_functions.TestFunction)
test function ldap_strp_secs() ... ok
test_addModlist (t_ldap_modlist.TestModlist) ... ok
test_modifyModlist (t_ldap_modlist.TestModlist) ... ok
test_cafile (t_ldap_options.TestGlobalOptions) ... ok
test_client_controls (t_ldap_options.TestGlobalOptions) ... ok
test_invalid (t_ldap_options.TestGlobalOptions) ... ok
test_network_timeout (t_ldap_options.TestGlobalOptions) ... ok
test_readonly (t_ldap_options.TestGlobalOptions) ... ok
test_server_controls (t_ldap_options.TestGlobalOptions) ... ok
test_timeout (t_ldap_options.TestGlobalOptions) ... ok
test_uri (t_ldap_options.TestGlobalOptions) ... ok
ERROR
ERROR
test_attributetype_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of an AttributeType object's attributes ... ok
test_empty_attributetype_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of attributes of a minimal AttributeType ... ok
test_empty_objectclass_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of attributes of a minimal ObjectClass ... ok
test_objectclass_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of an ObjectClass object's attributes ... ok
test_subschema_file (t_ldap_schema_subentry.TestSubschemaLDIF) ... ok
test_urlfetch_file (t_ldap_schema_subentry.TestSubschemaUrlfetch) ... ok
ERROR
test_origin_multi_valued (t_ldap_schema_subentry.TestXOrigin) ... ok
test_origin_multi_valued_str (t_ldap_schema_subentry.TestXOrigin)
Check string representation of an attr with multi-value X-ORIGIN ... ok
test_origin_none (t_ldap_schema_subentry.TestXOrigin) ... ok
test_origin_none_str (t_ldap_schema_subentry.TestXOrigin)
Check string representation of an attribute without X-ORIGIN ... ok
test_origin_string (t_ldap_schema_subentry.TestXOrigin) ... ok
test_origin_string_str (t_ldap_schema_subentry.TestXOrigin)
Check string representation of an attr with single-value X-ORIGIN ... ok
test_set_origin_list (t_ldap_schema_subentry.TestXOrigin)
Check that setting X-ORIGIN to a list makes entry unusable ... ok
test_set_origin_str (t_ldap_schema_subentry.TestXOrigin)
Check that setting X-ORIGIN to a string makes entry unusable ... ok
test_set_origin_tuple (t_ldap_schema_subentry.TestXOrigin)
Check that setting X-ORIGIN to a tuple works ... ok
test_basic (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_BASIC ... ok
test_broken (t_ldap_schema_tokenizer.TestSplitTokens) ... ok
test_broken_oid (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_BROKEN_OID ... ok
test_escaped_quotes (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_ESCAPED_QUOTES ... ok
test_utf8 (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_BASIC ... ok
test_syncidset_message (t_ldap_syncrepl.DecodeSyncreplProtoTests)
A syncrepl server may send a sync info message, with a syncIdSet ... ok
ERROR
ERROR
ERROR
ERROR
test_isLDAPUrl (t_ldapurl.TestIsLDAPUrl) ... ok
test_bad_urls (t_ldapurl.TestLDAPUrl) ... expected failure
test_combo (t_ldapurl.TestLDAPUrl) ... ok
test_parse_attrs (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_attrs (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_extensions (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_filter (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_hostport (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_scope (t_ldapurl.TestLDAPUrl) ... ok
test_parse_dn (t_ldapurl.TestLDAPUrl) ... ok
test_parse_empty_dn (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions_5questions (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions_novalue (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions_nulls (t_ldapurl.TestLDAPUrl) ... ok
test_parse_filter (t_ldapurl.TestLDAPUrl) ... ok
test_parse_hostport (t_ldapurl.TestLDAPUrl) ... ok
test_parse_schemes (t_ldapurl.TestLDAPUrl) ... ok
test_parse_scope (t_ldapurl.TestLDAPUrl) ... ok
test_parse_scope_default (t_ldapurl.TestLDAPUrl) ... ok
test_ldapurl (t_ldapurl.TestParseLDAPUrl) ... ok
test_bad_change_records (t_ldif.TestChangeRecords) ... ok
test_empty (t_ldif.TestChangeRecords) ... ok
test_missing_trailing_dash_separator (t_ldif.TestChangeRecords) ... ok
test_mod_increment (t_ldif.TestChangeRecords) ... ok
test_simple (t_ldif.TestChangeRecords) ... ok
test_weird_empty_lines (t_ldif.TestChangeRecords) ... ok
test_big_binary (t_ldif.TestEntryRecords) ... ok
test_binary (t_ldif.TestEntryRecords) ... ok
test_binary2 (t_ldif.TestEntryRecords) ... ok
test_comments (t_ldif.TestEntryRecords) ... ok
test_empty (t_ldif.TestEntryRecords) ... ok
test_empty_attr_values (t_ldif.TestEntryRecords) ... ok
test_folded (t_ldif.TestEntryRecords) ... ok
test_ignored_attr_types (t_ldif.TestEntryRecords) ... ok
test_max_entries (t_ldif.TestEntryRecords) ... ok
test_missing_trailing_line_separator (t_ldif.TestEntryRecords) ... ok
test_multiple (t_ldif.TestEntryRecords) ... ok
test_multiple_empty_lines (t_ldif.TestEntryRecords)
test malformed LDIF with multiple empty lines ... ok
test_simple (t_ldif.TestEntryRecords) ... ok
test_simple2 (t_ldif.TestEntryRecords) ... ok
test_sorted (t_ldif.TestEntryRecords) ... ok
test_unencoded_unicode (t_ldif.TestEntryRecords) ... ok
test_unicode (t_ldif.TestEntryRecords) ... ok
test_weird_empty_lines (t_ldif.TestEntryRecords) ... ok
test_context_manager (t_slapdobject.TestSlapdObject) ... ERROR
test_context_manager_after_start (t_slapdobject.TestSlapdObject) ... ERROR

======================================================================
ERROR: setUpClass (t_bind.TestBinds)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-43119/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: setUpClass (t_cext.TestLdapCExtension)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_cext.py", line 31, in setUpClass
    super(TestLdapCExtension, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-49819/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: setUpClass (t_edit.EditionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_edit.py", line 16, in setUpClass
    super(EditionTests, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-41785/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: setUpClass (t_ldap_options.TestLDAPObjectOptions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-43473/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: setUpClass (t_ldap_sasl.TestSasl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldap_sasl.py", line 50, in setUpClass
    super(TestSasl, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-56629/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: setUpClass (t_ldap_schema_subentry.TestSubschemaUrlfetchSlapd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-55211/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: setUpClass (t_ldap_syncrepl.TestSyncrepl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldap_syncrepl.py", line 265, in setUpClass
    super(BaseSyncreplTests, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-38699/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: setUpClass (t_ldapobject.Test00_SimpleLDAPObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldapobject.py", line 75, in setUpClass
    super(Test00_SimpleLDAPObject, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-54223/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: setUpClass (t_ldapobject.Test01_ReconnectLDAPObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldapobject.py", line 75, in setUpClass
    super(Test00_SimpleLDAPObject, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-56611/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: setUpClass (t_ldapobject.Test03_SimpleLDAPObjectWithFileno)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldapobject.py", line 75, in setUpClass
    super(Test00_SimpleLDAPObject, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 608, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-55965/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: test_context_manager (t_slapdobject.TestSlapdObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_slapdobject.py", line 8, in test_context_manager
    with slapdtest.SlapdObject() as server:
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 579, in __enter__
    self.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-48527/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

======================================================================
ERROR: test_context_manager_after_start (t_slapdobject.TestSlapdObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_slapdobject.py", line 14, in test_context_manager_after_start
    server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 458, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 404, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-51863/slapd.conf', '-u', '-Q']' returned non-zero exit status 1.

----------------------------------------------------------------------
Ran 101 tests in 1.498s

FAILED (errors=12, expected failures=1)
ERROR: InvocationError for command /home/jugmac00/Projects/python-ldap/.tox/py38/bin/python -bb -Werror -m unittest discover -v -s Tests -p 't_*' (exited with code 1)
____________________________________________________________ summary ____________________________________________________________
ERROR:   py38: commands failed

I just started with LDAP at all yesterday, set up a server which works.

Now, I tried to add data via this package, did not find a lot of documentation, had a look at Demo, found something to fix, tried to run tests.. and here we are :-)

Thanks for helping!

@jugmac00
Copy link
Author

❯ systemctl status slapd
● slapd.service - LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)
   Loaded: loaded (/etc/init.d/slapd; generated)
  Drop-In: /lib/systemd/system/slapd.service.d
           └─slapd-remain-after-exit.conf
   Active: active (running) since Fri 2020-07-31 09:18:36 CEST; 45min ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 3 (limit: 4915)
   CGroup: /system.slice/slapd.service
           └─337 /usr/sbin/slapd -h ldap:/// ldapi:/// -g openldap -u openldap -F /etc/ldap/slapd.d

Jul 31 09:18:36 jugmac00-XPS-13-9370 systemd[1]: Starting LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)
Jul 31 09:18:36 jugmac00-XPS-13-9370 slapd[314]:  * Starting OpenLDAP slapd
Jul 31 09:18:36 jugmac00-XPS-13-9370 slapd[324]: @(#) $OpenLDAP: slapd  (Ubuntu) (Jul  1 2020 19:38:55) $
                                                         Debian OpenLDAP Maintainers <pkg-openldap-devel@lists.alioth.debian.org>
Jul 31 09:18:36 jugmac00-XPS-13-9370 slapd[337]: slapd starting
Jul 31 09:18:36 jugmac00-XPS-13-9370 slapd[314]:    ...done.
Jul 31 09:18:36 jugmac00-XPS-13-9370 systemd[1]: Started LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol).
lines 1-17/17 (END)

@tiran
Copy link
Member

tiran commented Jul 31, 2020

The system service is irrelevant. The test suite is using a custom instance and custom configuration.

Now please remove the -Q flag a couple of lines before the subprocess call. You don't have to paste the entire output. The error output of one test run is good enough.

@jugmac00
Copy link
Author

ERROR: test_context_manager_after_start (t_slapdobject.TestSlapdObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_slapdobject.py", line 14, in test_context_manager_after_start
    server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 456, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 402, in _test_config
    proc = subprocess.check_call(popen_list)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-54653/slapd.conf', '-u']' returned non-zero exit status 1.

----------------------------------------------------------------------
Ran 101 tests in 1.644s

FAILED (errors=12, expected failures=1)
ERROR: InvocationError for command /home/jugmac00/Projects/python-ldap/.tox/py38/bin/python -bb -Werror -m unittest discover -v -s Tests -p 't_*' (exited with code 1)
____________________________________________________________ summary ____________________________________________________________
ERROR:   py38: commands failed

tiran added a commit to tiran/python-ldap that referenced this issue Jul 31, 2020
Related: python-ldap#370
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@tiran
Copy link
Member

tiran commented Jul 31, 2020

Please try PR #371 and post the new stderr output of slapd.

@jugmac00
Copy link
Author

jugmac00 commented Jul 31, 2020

ERROR: test_context_manager_after_start (t_slapdobject.TestSlapdObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_slapdobject.py", line 14, in test_context_manager_after_start
    server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

----------------------------------------------------------------------
Ran 101 tests in 1.682s

FAILED (errors=12, expected failures=1)
ERROR: InvocationError for command /home/jugmac00/Projects/python-ldap/.tox/py38/bin/python -bb -Werror -m unittest discover -v -s Tests -p 't_*' (exited with code 1)
____________________________________________________________ summary ____________________________________________________________
ERROR:   py38: commands failed

Just to be sure I am on your branch...

git log --oneline
0c38ad0 (HEAD -> debug_slap_test, tiran/debug_slap_test) Show stderr of slapd -Ttest

@tiran
Copy link
Member

tiran commented Jul 31, 2020

The stderr output starts with a line similar to 5f23d42f .../python-ldap/python-ldap-test-38081/slapd.conf: line 2 (serverID 0x4c1) and should end with an error message.

@jugmac00
Copy link
Author

I set a breakpoint to extract the message oO

CompletedProcess(args=['/usr/sbin/slapd', '-Ttest', '-f', '/home/jugmac00/Projects/python-ldap/python-ldap-test-42929/slapd.conf', '-u', '-v', '-d', 'config'], returncode=1, stdout=b'5f23d885 could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-42929/slapd.conf": Permission denied (13)\nslaptest: bad configuration file!\n')

@jugmac00
Copy link
Author

complete output this time :-)

❯ tox -e py38
GLOB sdist-make: /home/jugmac00/Projects/python-ldap/setup.py
py38 inst-nodeps: /home/jugmac00/Projects/python-ldap/.tox/.tmp/package/1/python-ldap-3.3.0.zip
py38 installed: pyasn1==0.4.8,pyasn1-modules==0.2.8,python-ldap @ file:///home/jugmac00/Projects/python-ldap/.tox/.tmp/package/1/python-ldap-3.3.0.zip
py38 run-test-pre: PYTHONHASHSEED='1013136741'
py38 run-test: commands[0] | /home/jugmac00/Projects/python-ldap/.tox/py38/bin/python -bb -Werror -m unittest discover -v -s Tests -p 't_*'
2020-07-31 10:39:57,556 ERROR 5f23d8dd could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-55323/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
2020-07-31 10:39:57,565 ERROR 5f23d8dd could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-58649/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
test_cidict (t_cidict.TestCidict)
test function is_dn() ... ok
test_cidict_data (t_cidict.TestCidict)
test the deprecated data atrtribute ... ok
test_strlist_deprecated (t_cidict.TestCidict) ... ok
2020-07-31 10:39:57,574 ERROR 5f23d8dd could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-42131/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
test_deprecated (t_ldap_asyncsearch.TestLdapAsyncSearch) ... ok
test_assertioncontrol (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_matchedvalues (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_pagedresults_decode (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_pagedresults_encode (t_ldap_controls_libldap.TestLibldapControls) ... ok
test_ppolicy_graceauth (t_ldap_controls_ppolicy.TestControlsPPolicy) ... ok
test_ppolicy_timebefore (t_ldap_controls_ppolicy.TestControlsPPolicy) ... ok
test_create_sss_request_control (t_ldap_controls_sss.TestControlsPPolicy) ... ok
test_dn2str (t_ldap_dn.TestDN)
test function dn2str() ... ok
test_escape_dn_chars (t_ldap_dn.TestDN)
test function escape_dn_chars() ... ok
test_explode_dn (t_ldap_dn.TestDN)
test function explode_dn() ... ok
test_explode_rdn (t_ldap_dn.TestDN)
test function explode_rdn() ... ok
test_is_dn (t_ldap_dn.TestDN)
test function is_dn() ... ok
test_str2dn (t_ldap_dn.TestDN)
test function str2dn() ... ok
test_escape_filter_chars_mode0 (t_ldap_filter.TestDN)
test function escape_filter_chars() with escape_mode=0 ... ok
test_escape_filter_chars_mode1 (t_ldap_filter.TestDN)
test function escape_filter_chars() with escape_mode=1 ... ok
test_escape_filter_chars_mode2 (t_ldap_filter.TestDN)
test function escape_filter_chars() with escape_mode=2 ... ok
test_escape_str (t_ldap_functions.TestFunction)
test function escape_string_tmpl() ... ok
test_ldap_strf_secs (t_ldap_functions.TestFunction)
test function ldap_strf_secs() ... ok
test_ldap_strp_secs (t_ldap_functions.TestFunction)
test function ldap_strp_secs() ... ok
test_addModlist (t_ldap_modlist.TestModlist) ... ok
test_modifyModlist (t_ldap_modlist.TestModlist) ... ok
test_cafile (t_ldap_options.TestGlobalOptions) ... ok
test_client_controls (t_ldap_options.TestGlobalOptions) ... ok
test_invalid (t_ldap_options.TestGlobalOptions) ... ok
test_network_timeout (t_ldap_options.TestGlobalOptions) ... ok
test_readonly (t_ldap_options.TestGlobalOptions) ... ok
test_server_controls (t_ldap_options.TestGlobalOptions) ... ok
test_timeout (t_ldap_options.TestGlobalOptions) ... ok
test_uri (t_ldap_options.TestGlobalOptions) ... ok
2020-07-31 10:39:57,589 ERROR 5f23d8dd could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-43703/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
2020-07-31 10:39:57,597 ERROR 5f23d8dd could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-35473/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
test_attributetype_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of an AttributeType object's attributes ... ok
test_empty_attributetype_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of attributes of a minimal AttributeType ... ok
test_empty_objectclass_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of attributes of a minimal ObjectClass ... ok
test_objectclass_attrs (t_ldap_schema_subentry.TestAttributes)
Check types and values of an ObjectClass object's attributes ... ok
test_subschema_file (t_ldap_schema_subentry.TestSubschemaLDIF) ... ok
test_urlfetch_file (t_ldap_schema_subentry.TestSubschemaUrlfetch) ... ok
2020-07-31 10:39:58,323 ERROR 5f23d8de could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-57165/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
test_origin_multi_valued (t_ldap_schema_subentry.TestXOrigin) ... ok
test_origin_multi_valued_str (t_ldap_schema_subentry.TestXOrigin)
Check string representation of an attr with multi-value X-ORIGIN ... ok
test_origin_none (t_ldap_schema_subentry.TestXOrigin) ... ok
test_origin_none_str (t_ldap_schema_subentry.TestXOrigin)
Check string representation of an attribute without X-ORIGIN ... ok
test_origin_string (t_ldap_schema_subentry.TestXOrigin) ... ok
test_origin_string_str (t_ldap_schema_subentry.TestXOrigin)
Check string representation of an attr with single-value X-ORIGIN ... ok
test_set_origin_list (t_ldap_schema_subentry.TestXOrigin)
Check that setting X-ORIGIN to a list makes entry unusable ... ok
test_set_origin_str (t_ldap_schema_subentry.TestXOrigin)
Check that setting X-ORIGIN to a string makes entry unusable ... ok
test_set_origin_tuple (t_ldap_schema_subentry.TestXOrigin)
Check that setting X-ORIGIN to a tuple works ... ok
test_basic (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_BASIC ... ok
test_broken (t_ldap_schema_tokenizer.TestSplitTokens) ... ok
test_broken_oid (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_BROKEN_OID ... ok
test_escaped_quotes (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_ESCAPED_QUOTES ... ok
test_utf8 (t_ldap_schema_tokenizer.TestSplitTokens)
run test cases specified in constant TESTCASES_BASIC ... ok
test_syncidset_message (t_ldap_syncrepl.DecodeSyncreplProtoTests)
A syncrepl server may send a sync info message, with a syncIdSet ... ok
2020-07-31 10:39:58,999 ERROR 5f23d8de could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-35879/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
2020-07-31 10:39:59,009 ERROR 5f23d8df could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-48451/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
2020-07-31 10:39:59,021 ERROR 5f23d8df could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-58851/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
2020-07-31 10:39:59,032 ERROR 5f23d8df could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-35575/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
test_isLDAPUrl (t_ldapurl.TestIsLDAPUrl) ... ok
test_bad_urls (t_ldapurl.TestLDAPUrl) ... expected failure
test_combo (t_ldapurl.TestLDAPUrl) ... ok
test_parse_attrs (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_attrs (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_extensions (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_filter (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_hostport (t_ldapurl.TestLDAPUrl) ... ok
test_parse_default_scope (t_ldapurl.TestLDAPUrl) ... ok
test_parse_dn (t_ldapurl.TestLDAPUrl) ... ok
test_parse_empty_dn (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions_5questions (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions_novalue (t_ldapurl.TestLDAPUrl) ... ok
test_parse_extensions_nulls (t_ldapurl.TestLDAPUrl) ... ok
test_parse_filter (t_ldapurl.TestLDAPUrl) ... ok
test_parse_hostport (t_ldapurl.TestLDAPUrl) ... ok
test_parse_schemes (t_ldapurl.TestLDAPUrl) ... ok
test_parse_scope (t_ldapurl.TestLDAPUrl) ... ok
test_parse_scope_default (t_ldapurl.TestLDAPUrl) ... ok
test_ldapurl (t_ldapurl.TestParseLDAPUrl) ... ok
test_bad_change_records (t_ldif.TestChangeRecords) ... ok
test_empty (t_ldif.TestChangeRecords) ... ok
test_missing_trailing_dash_separator (t_ldif.TestChangeRecords) ... ok
test_mod_increment (t_ldif.TestChangeRecords) ... ok
test_simple (t_ldif.TestChangeRecords) ... ok
test_weird_empty_lines (t_ldif.TestChangeRecords) ... ok
test_big_binary (t_ldif.TestEntryRecords) ... ok
test_binary (t_ldif.TestEntryRecords) ... ok
test_binary2 (t_ldif.TestEntryRecords) ... ok
test_comments (t_ldif.TestEntryRecords) ... ok
test_empty (t_ldif.TestEntryRecords) ... ok
test_empty_attr_values (t_ldif.TestEntryRecords) ... ok
test_folded (t_ldif.TestEntryRecords) ... ok
test_ignored_attr_types (t_ldif.TestEntryRecords) ... ok
test_max_entries (t_ldif.TestEntryRecords) ... ok
test_missing_trailing_line_separator (t_ldif.TestEntryRecords) ... ok
test_multiple (t_ldif.TestEntryRecords) ... ok
test_multiple_empty_lines (t_ldif.TestEntryRecords)
test malformed LDIF with multiple empty lines ... ok
test_simple (t_ldif.TestEntryRecords) ... ok
test_simple2 (t_ldif.TestEntryRecords) ... ok
test_sorted (t_ldif.TestEntryRecords) ... ok
test_unencoded_unicode (t_ldif.TestEntryRecords) ... ok
test_unicode (t_ldif.TestEntryRecords) ... ok
test_weird_empty_lines (t_ldif.TestEntryRecords) ... ok
test_context_manager (t_slapdobject.TestSlapdObject) ... 2020-07-31 10:39:59,048 ERROR 5f23d8df could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-47255/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR
test_context_manager_after_start (t_slapdobject.TestSlapdObject) ... 2020-07-31 10:39:59,057 ERROR 5f23d8df could not open config file "/home/jugmac00/Projects/python-ldap/python-ldap-test-39539/slapd.conf": Permission denied (13)
slaptest: bad configuration file!

ERROR

======================================================================
ERROR: setUpClass (t_bind.TestBinds)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 610, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_cext.TestLdapCExtension)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_cext.py", line 31, in setUpClass
    super(TestLdapCExtension, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 610, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_edit.EditionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_edit.py", line 16, in setUpClass
    super(EditionTests, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 610, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldap_options.TestLDAPObjectOptions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 610, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldap_sasl.TestSasl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldap_sasl.py", line 50, in setUpClass
    super(TestSasl, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 610, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldap_schema_subentry.TestSubschemaUrlfetchSlapd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 610, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldap_syncrepl.TestSyncrepl)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldap_syncrepl.py", line 265, in setUpClass
    super(BaseSyncreplTests, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 610, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldapobject.Test00_SimpleLDAPObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldapobject.py", line 75, in setUpClass
    super(Test00_SimpleLDAPObject, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 610, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldapobject.Test01_ReconnectLDAPObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldapobject.py", line 75, in setUpClass
    super(Test00_SimpleLDAPObject, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 610, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: setUpClass (t_ldapobject.Test03_SimpleLDAPObjectWithFileno)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_ldapobject.py", line 75, in setUpClass
    super(Test00_SimpleLDAPObject, cls).setUpClass()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 610, in setUpClass
    cls.server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: test_context_manager (t_slapdobject.TestSlapdObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_slapdobject.py", line 8, in test_context_manager
    with slapdtest.SlapdObject() as server:
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 581, in __enter__
    self.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

======================================================================
ERROR: test_context_manager_after_start (t_slapdobject.TestSlapdObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_slapdobject.py", line 14, in test_context_manager_after_start
    server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 460, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py38/lib/python3.8/site-packages/slapdtest/_slapdtest.py", line 408, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

----------------------------------------------------------------------
Ran 101 tests in 1.509s

FAILED (errors=12, expected failures=1)
ERROR: InvocationError for command /home/jugmac00/Projects/python-ldap/.tox/py38/bin/python -bb -Werror -m unittest discover -v -s Tests -p 't_*' (exited with code 1)
____________________________________________________________ summary ____________________________________________________________
ERROR:   py38: commands failed

@jugmac00
Copy link
Author

jugmac00 commented Jul 31, 2020

Hm... looks like test folders get created, but they have a different number part.

"/home/jugmac00/Projects/python-ldap/python-ldap-test-35413/slapd.conf": Permission denied (13)

vs

├── python-ldap-test-37559
│   ├── openldap-data
│   ├── schema
│   │   └── core.schema -> /etc/ldap/schema/core.schema
│   └── slapd.conf
├── python-ldap-test-42929
│   ├── openldap-data
│   ├── schema
│   │   └── core.schema -> /etc/ldap/schema/core.schema
│   └── slapd.conf
├── python-ldap-test-48081
│   ├── openldap-data
│   ├── schema
│   │   └── core.schema -> /etc/ldap/schema/core.schema
│   └── slapd.conf
├── python-ldap-test-49173
│   ├── openldap-data
│   ├── schema
│   │   └── core.schema -> /etc/ldap/schema/core.schema
│   └── slapd.conf
├── python-ldap-test-50231
│   ├── openldap-data
│   ├── schema
│   │   └── core.schema -> /etc/ldap/schema/core.schema
│   └── slapd.conf
├── python-ldap-test-53003
│   ├── openldap-data
│   ├── schema
│   │   └── core.schema -> /etc/ldap/schema/core.schema
│   └── slapd.conf

Maybe this is not the right direction.. looks like the folders get removed after the test run - at least now.

@jugmac00
Copy link
Author

@tiran Thanks for your patience!

If it would be of any help for you to speed up the debugging by having a remote session, please hit me up on Twitter with the same handle.

Otherwise I try to follow your instructions. Unfortunately, I guess I am not a big help here otherwise.

encukou pushed a commit that referenced this issue Aug 7, 2020
Related: #370
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@azmeuk
Copy link
Contributor

azmeuk commented Nov 10, 2020

@jugmac00 Things may have changed with #382.

@jugmac00
Copy link
Author

@azmeuk Thanks for pinging me. I am still facing errors when running tox.

tox -r -e py36
...
ERROR: test_context_manager_after_start (t_slapdobject.TestSlapdObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jugmac00/Projects/python-ldap/Tests/t_slapdobject.py", line 14, in test_context_manager_after_start
    server.start()
  File "/home/jugmac00/Projects/python-ldap/.tox/py36/lib/python3.6/site-packages/slapdtest/_slapdtest.py", line 450, in start
    self._test_config()
  File "/home/jugmac00/Projects/python-ldap/.tox/py36/lib/python3.6/site-packages/slapdtest/_slapdtest.py", line 399, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

----------------------------------------------------------------------
Ran 101 tests in 1.864s

FAILED (errors=12, expected failures=1)
ERROR: InvocationError for command /home/jugmac00/Projects/python-ldap/.tox/py36/bin/python -bb -Werror -m unittest discover -v -s Tests -p 't_*' (exited with code 1)
________________________________________________________ summary ________________________________________________________
ERROR:   py36: commands failed

I am not using python-ldap at work any more, so please do not spend time just for my case.

On the other hand, if you or @tiran want to give it another shot, I am here to help.

@wesleyjellis
Copy link

I'm seeing this too, although in a completely different context (no tox, my own project). It's like slapd is unable to read /tmp/user/1001/. For context, I'm using ubuntu 18.04

@wesleyjellis
Copy link

Not sure if this will help anyone, but I discovered the source of my problem was AppArmor. It has a policy that restricts /usr/sbin/slapd from reading outside a whitelist of directories, and /tmp is excluded. So the test fails when it creates a temporary .ldif file and instructs slapd to read it

@jugmac00
Copy link
Author

omg :-) Awesome!

@wesleyjellis Could you create a PR for the documentation?

I just had a look in /etc/apparmor.d/usr.sbin.slapd and I have to admit I am neither familiar with apparmor nor with the used syntax - yet.

@wesleyjellis
Copy link

Same, I'd never looked at apparmor before this, but the fix for me was to install apparmor-utils and then sudo aa-complain /usr/sbin/slapd (complain instead of enforce the policy)

I'm not sure I have the time in the next couple of weeks to look into this, so someone else can grab it before me

francoisfreitag added a commit to francoisfreitag/django-auth-ldap that referenced this issue Jan 26, 2021
@azmeuk
Copy link
Contributor

azmeuk commented Apr 6, 2021

Maybe the solution to this issue is to write the apparmor trick in some piece of documentation?

@azmeuk
Copy link
Contributor

azmeuk commented Apr 6, 2021

I just had a look in /etc/apparmor.d/usr.sbin.slapd and I have to admit I am neither familiar with apparmor nor with the used syntax - yet.

/etc/apparmor.d/usr.sbin.slapd allows slapd to read and write in /var/tmp though, I suppose we could also use this path, but we have no guarantee this will be available on other distributions.

@sdolemelipone
Copy link

Same, I'd never looked at apparmor before this, but the fix for me was to install apparmor-utils and then sudo aa-complain /usr/sbin/slapd (complain instead of enforce the policy)

I'm not sure I have the time in the next couple of weeks to look into this, so someone else can grab it before me

Thanks @wesleyjellis, this fixed this issue for me too.

@xingxing118
Copy link

This is also a problem on Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008355,can resove this question
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants