Code Monkey home page Code Monkey logo

Comments (5)

kevgreen-ebay-com avatar kevgreen-ebay-com commented on September 4, 2024

First thoughts on a minimum requirement....

Any test harness should probably test:

  • The code builds "manually" with no distro packaging applied.
  • Possibly also that the code builds properly into packages on one or more of both RH and Debian derived Linux versions.
  • A library is deposited in the right location for pam.

Then pre-seed some SQL data for test users, and set up a different mysql table + saslauthd profile + pam profile for each different authentication method to allow them to be tested independently.

And for each authentication method:

  • Users can authenticate.
  • Bad passwords are not authenticated.
  • Any more complicated aspects to other authentication methods are tested for positive and negative results (eg. auth methods that give you a token, if any are at play here?).

Also do we need to test for this (and does it apply to all crypt/auth types?):

  • Change password.
  • Re-test correct authentication.
  • Re-test incorrect authentication.
  • Test that original authentication details for that test user have stopped working (sasl caches and stuff masking issues?).

from pam-mysql.

wferi avatar wferi commented on September 4, 2024

For a start I think GitHub CI could be employed to at least build-test any pull requests.
Meanwhile the Debian package has an autopkgtest, which now tests authentication with a bunch of crypt methods: creates a database, configures PAM for itself and does some authenticate() calls. That's not a unit test, though, but rather an integration test: it tests the installed module.

from pam-mysql.

kevgreen-ebay-com avatar kevgreen-ebay-com commented on September 4, 2024

This issue may have been created from the wrong login, and things said by me here with this login are personal and no reflection on the activities or opinions of ECG or Ebay. Disclaimer ends.

from pam-mysql.

NigelCunningham avatar NigelCunningham commented on September 4, 2024

Thanks for the suggestion and apologies for being slow to the party. I just never seem to see the email notifications that I assume Github sends.

Anyway...

Totally independently of this thread, I've been wanting for some time to get some testing into pam-MySQL too. I've recently completed a switch to using Meson as the build system, and have also split the monolith that was pam-mysql.c into a number of separate files. This has made it possible for me to then replace parts of the system (think mysql calls and pam calls) with mocks, so we now have the ability to have unit tests. I've implemented some straight forward, end-to-end tests for a start; more could be added over time. I'll have to take a look at the autopkgtest; perhaps I can make use of some of that too, @wferi?

In the meantime, I've downloaded FreeBSD to check I can get it to compile and work there.

Thanks again!

from pam-mysql.

NigelCunningham avatar NigelCunningham commented on September 4, 2024

I'll close this issue as I've switched build systems and started implementing tests under Meson.

from pam-mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.