Menu

#9 Running tests without root

1.0
open
None
2020-04-05
2020-04-02
No

I've managed to get the test suite working without root access using pam_wrapper. This makes it much easier for users, packagers and especially automated tools to run the regression tests and ensure that the program is working properly.

The (manual) procedure for doing so is as follows:

  1. Build pam_wrapper (from https://cwrap.org/pam_wrapper.html): cd /tmp && git clone git clone git://git.samba.org/pam_wrapper.git && cd pam_wrapper && cmake -S . -B build && make -C build
  2. Build pam-python
  3. Set up the config: cd src && mkdir pam.d && ln -s ../test-pam_python.pam pam.d
  4. Run the test like this: LD_PRELOAD=/tmp/pam_wrapper/build/src/libpam_wrapper.so PAM_WRAPPER=1 PAM_WRAPPER_SERVICE_DIR="$PWD"/pam.d sh -c './ctest; python3 test.py'

ctest warns that "This test requires ./test-pam_python.pam" but it executes fine.

Discussion

  • Dan Fandrich

    Dan Fandrich - 2020-04-02

    To be explicit, this is a feature request for automatically using pam_wrapper for tests if autodetected or requested by the user.

     
  • Russell Stuart

    Russell Stuart - 2020-04-05
    • assigned_to: Russell Stuart
     
  • Russell Stuart

    Russell Stuart - 2020-04-05

    I'll look at it as part of the Python3 port.

     

Log in to post a comment.