def test_AuthselectScannerLibrary_step_detect_features__mkhomedir_oddjob(): pam = get_config(''' auth sufficient pam_unix.so auth sufficient pam_sss.so auth required pam_deny.so session optional pam_oddjob_mkhomedir.so umask=0077 ''') obj = AuthselectScannerLibrary([], Authconfig(''), DConf(''), PAM(pam), '') assert obj.step_detect_features() == ['with-mkhomedir']
def test_AuthselectScannerLibrary_step_detect_features__fingerprint(): pam = get_config(''' auth sufficient pam_unix.so auth sufficient pam_sss.so auth sufficient pam_fprintd.so auth required pam_deny.so ''') obj = AuthselectScannerLibrary([], Authconfig(''), DConf(''), PAM(pam), '') assert obj.step_detect_features() == ['with-fingerprint']
def test_AuthselectScannerLibrary_step_detect_features__access(): pam = get_config(''' auth sufficient pam_unix.so auth sufficient pam_sss.so auth required pam_deny.so account required pam_access.so ''') obj = AuthselectScannerLibrary([], Authconfig(''), DConf(''), PAM(pam), '') assert obj.step_detect_features() == ['with-pamaccess']
def test_AuthselectScannerLibrary_step_detect_features__faillock(): pam = get_config(''' auth required pam_faillock.so preauth silent deny=4 unlock_time=1200 auth sufficient pam_unix.so auth sufficient pam_sss.so auth required pam_deny.so ''') obj = AuthselectScannerLibrary([], Authconfig(''), DConf(''), PAM(pam), '') assert obj.step_detect_features() == ['with-faillock']
def test_AuthselectScannerLibrary_step_detect_features__all(): pam = get_config(''' auth required pam_faillock.so preauth silent deny=4 unlock_time=1200 auth sufficient pam_unix.so auth sufficient pam_sss.so auth sufficient pam_fprintd.so auth required pam_deny.so account required pam_access.so session optional pam_oddjob_mkhomedir.so umask=0077 ''') obj = AuthselectScannerLibrary([], Authconfig(''), DConf(''), PAM(pam), '') features = obj.step_detect_features() assert len(features) == 4 assert 'with-faillock' in features assert 'with-fingerprint' in features assert 'with-pamaccess' in features assert 'with-mkhomedir' in features