Hi Ondřej,
I'm struggling to get those Python tests working. I was able to install the requirements and setup the required environment variables (which I'm not sure I gave the proper values) but I'm getting errors from executing the slapd.py (the first one that I tried).
This is the error I'm getting (I made small changes to get the proper STDERR from subprocess.run()):
E Exception: The execution of ['/home/alceu/Projetos/openldap/openldap/servers/slapd/slapd', '-T', 'add', '-d', '-1', '-n0', '-F', '/tmp/pytest-of-alceu/pytest-17/slapd_py0/tmpiha1b2nw/slapd.d'] failed with the following error: E slapadd init: initiated tool. E mdb_back_initialize: initialize MDB backend E mdb_back_initialize: LMDB 0.9.30: (October 19, 2021) E backend_startup_one: starting "cn=config" E ldif_read_file: no entry file "/tmp/pytest-of-alceu/pytest-17/slapd_py0/tmpiha1b2nw/slapd.d/cn=config.ldif"
The path "/tmp/pytest-of-alceu/pytest-17/slapd_py0/tmpiha1b2nw/slapd.d" doesn't exist, but "/tmp/pytest-of-alceu/pytest-17/slapd_py0/" was created as expected.
Since the LDIF is given as STDIN to the slapd binary, I'm not really understand what is going on or what I missing.
These are the values I used for the environment variables:
TOP_SRCDIR=/home/alceu/Projetos/openldap/openldap TOP_BUILDDIR=/home/alceu/Projetos/openldap/openldap
I used the Makefile available under TOP_BUILDDIR=/home/alceu/Projetos/openldap/openldap/tests directory to configure those environment variables.
The OpenLDAP repository is available at the related path. I made sure to execute the tests with "make tests" in order to generate the binaries and execute the tests (and none of them failed).
Thank you in advance,
Alceu
Em 05/10/2022 09:05, Ondřej Kuzník escreveu:
On Tue, Oct 04, 2022 at 06:38:36PM -0300, Alceu Rodrigues de Freitas Junior wrote:
We've work underway on a python based testing suite for the future.
That's great!
Is this project available for the general public? I would like to take a look to it and see if I can contribute.
A first draft is available in tests/python in the master branch, work is needed to expand the infrastructure and eventually port the existing tests to Python (with a fallback to the existing scripts if requested or where Python tests can't be run).
Regards,