Open kloczek opened 5 months ago
Just found get_PYKCS11LIB
in source root directory 😋
Nevertheless that location is not well suited for parts of the test suite..
Probably the best would be just integrate that into run_test.py.
To build the documentation use:
docs/generate.sh
To run the tests:
./run_test.py
You are using unittest and correctly written test suite i correctly handled by pytest. Conclusion: your test suite is not correct even for unittest. It would be good to fix that.
Building: every module should be compliant with PEP517 methodology. As you see that methodology build procedurę shows warnings.
For the tests:
export $(./get_PYKCS11LIB.py)
pytest -ra -m 'not network'
works for me.
Feel free to propose a patch if you need something more/else.
For the tests:
export $(./get_PYKCS11LIB.py) pytest -ra -m 'not network'
works for me.
For me it does not work because that script is not checking arch dependent libdir. Other thing is that instead using env variable better would be detect on build stage where this library is and than generate PyKCS11/init.py to hardcode that path into that file.
Just tested with export PYKCS11LIB=/usr/lib64/softhsm/libsofthsm2.so
and test suite still fails
libsofthsm2 is just ONE PKCS#11 library that can be used with PyKCS11. I use it for testing but in "the real life" you would use another PKCS#11 library and a smart card.
You need to setup your software libsofthsm2 token using https://github.com/LudovicRousseau/PyKCS11/blob/master/test/reset_softHSM.sh
Why are you using PyKCS11?
You need to setup your software libsofthsm2 token using https://github.com/LudovicRousseau/PyKCS11/blob/master/test/reset_softHSM.sh
Looks like it can be done from non-root account so it can be done as well in pytest session as part of it.
Why are you using PyKCS11?
Quote from opening this ticket:
On building documentation sphinx shows warnings about circular imports
Can you propose a patch?
Can you propose a patch?
First would be good to resolve all those PyKCS11.PyKCS11Error: CKR_GENERAL_ERROR (0x00000005)
fails.
IMO possible patch could make location of the libsofthsm2.so detection in setu.py and than generate PyKCS11/init.py with proper path.
On building documentation sphinx shows warnings about circular imports
And looks like test suite needs
get_PYKCS11LIB
module but I cannot find on pypi what provides it.May I ask for some hint? 🤔