Comments (5)
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.
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.
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.
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.
I'll close this issue as I've switched build systems and started implementing tests under Meson.
from pam-mysql.
Related Issues (20)
- Time to roll v0.8.2? HOT 4
- crypt() - Invalid argument when crypted PW contains " HOT 1
- Feature: Don't try_first_pass when password undefined HOT 3
- Dont erro log, and dont login with pam-mysql HOT 3
- autoreconf -f -i exits with code 1 "error: possibly undefined macro" HOT 3
- pam_mysql_check_passwd() returning 6 HOT 28
- pam_sm_authenticate() returning 3. the return :( HOT 2
- compat_make_scrambled_password_323 error HOT 5
- Email address as username. HOT 12
- I got "malloc(): invalid size (unsorted)" when using "crypt=1" HOT 2
- supressing log messages HOT 1
- install_dir is hard coded to '/lib/security' HOT 1
- Is PAM-MySQL friendly to MariaDB HOT 1
- pam-MySQL 1.0.0 built error for MySQL 8 HOT 8
- pam_MySQL is only querying the database if the username has a login account. HOT 1
- size read failed - SASLAUTHD with PAM_MYSQL Fedora 37
- Skip first pass in sasl-pam-mysql authentication HOT 1
- Centos 7: Unknown method "substring" for a string HOT 2
- Configurable Password Query HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pam-mysql.