How to gtest Linux-PAM client code? #4479
Unanswered
joseph-reynolds
asked this question in
Community Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am new to gtest and looking for guidance on how to approach testing my new Linux-PAM client code. This is new C++ code which uses the usual pam_start(), pam_authenticate(), etc. functions (ref: https://linux.die.net/man/3/pam, https://linux.die.net/man/8/pam) together with a new PAM conversation function and a new PAM config file (ref: https://linux.die.net/man/5/pam.d).
Disclaimers: I am not trying to use gtest to test my new PAM config file. I do not need to test a new PAM service module. I am not looking for help using PAM; the code was tested without using gtest, and now I want gtests. Also, I realize that gtest may not be a good fit for Linux-PAM applications.
I looked in this project, github.com/linux-pam, stackoverflow, and elsewhere but did find anyone using gtest with Linux-PAM.
I read the GoogleTest docs and have clear ideas how to proceed with wrapping mocking, and faking. But there is one question about the basic structure of the tests. Should I have
I sketched out the mocks and fakes I would need. Discussion (numbering as above).
So I am looking for pointers or advice.
Beta Was this translation helpful? Give feedback.
All reactions