Project:Perl/maint-notes/dev-perl/Authen-PAM

From Gentoo Wiki
Jump to:navigation Jump to:search

Testing

Unfortunately, this module by necessity does some stuff with privileges, and so its not really viable to test statically.

Interactive testing may also require you to use local access passwords.

  1. Install dev-perl/Authen-PAM with USE=examples
  2. Locate test.pl in the installed dist
    #qlist dev-perl/Authen-PAM | grep test.pl
    /usr/share/doc/Authen-PAM-0.160.0-r2/examples/test.pl
  3. #/usr/bin/perl /usr/share/doc/Authen-PAM-0.160.0-r2/examples/test.pl
  4. CODE
    1..10
    ok 1
    ---- The remaining tests will be run for service 'login', user 'kent' and
    ---- device '/dev/pts/8'.
    ok 2
    ok 3
    ok 4
    ok 5
    ok 6
    ok 7
    ok 8
    ---- Now, you may be prompted to enter the password of 'kent'.
    SSH passphrase: 
    ok 9
    ok 10
    ok 11
    

If you enter your password incorrectly, you should expect the following in place of test 9

CODE
---- Now, you may be prompted to enter the password of 'kent'.
SSH passphrase: 
not ok 9 (7 - Authentication failure)
---- The failure of test 9 could be due to your PAM configuration
---- or typing an incorrect password.