minrk / pamela

Python PAM interface
Other
34 stars 10 forks source link

test_session fails #21

Closed opoplawski closed 1 year ago

opoplawski commented 3 years ago

Bug description

test_session fails

Expected behaviour

Tests pass

Actual behaviour

+ cd pamela-1.0.0
+ py.test-3.10 -v
============================= test session starts ==============================
platform linux -- Python 3.10.0rc1, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/orion/fedora/python-pamela/pamela-1.0.0
plugins: forked-1.3.0, cov-2.12.1, arraydiff-0.3, mpi-0+unknown, xdist-2.3.0, remotedata-0.3.2, doctestplus-0.9.0, pyfakefs-4.4.0, mock-3.6.1, openfiles-0.5.0, timeout-1.4.2
collecting ... collected 7 items

test_pamela.py::test_pam_error_noargs PASSED                             [ 14%]
test_pamela.py::test_pam_error_errno PASSED                              [ 28%]
test_pamela.py::test_auth_nouser PASSED                                  [ 42%]
test_pamela.py::test_auth_badpassword PASSED                             [ 57%]
test_pamela.py::test_all PASSED                                          [ 71%]
test_pamela.py::test_environment PASSED                                  [ 85%]
test_pamela.py::test_session FAILED                                      [100%]

=================================== FAILURES ===================================
_________________________________ test_session _________________________________

    def test_session():
        handle = pamela.pam_start(getpass.getuser(), 'login')
>       handle.open_session()

test_pamela.py:76: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pamela.PamHandle object at 0x7f2d087312c0>

    def open_session(self):
        retval = PAM_OPEN_SESSION(self, 0)
        if retval != PAM_SUCCESS:
>           raise PAMError(errno=retval)
E           pamela.PAMError: [PAM Error 14] Cannot make/remove an entry for the specified session

pamela.py:150: PAMError
=========================== short test summary info ============================
FAILED test_pamela.py::test_session - pamela.PAMError: [PAM Error 14] Cannot ...
========================= 1 failed, 6 passed in 4.54s ==========================

Your personal set up

Fedora Rawhide and CentOS 8

minrk commented 3 years ago

The user running the test may not have the necessary permissions. Do you have a reproducible environment?

opoplawski commented 3 years ago

The user does not have any special privileges. I would have expected the test suite to determine that and skip the test rather than fail.

opoplawski commented 1 year ago

Looks like this is skipped now with 1.1.0