def test_AuthselectScannerLibrary_step_detect_sssd_features__wrong_profile(): nsswitch = get_config(''' passwd: files sss systemd group: files sss systemd sudoers: files sss ''') obj = AuthselectScannerLibrary([], Authconfig(''), DConf(''), PAM(''), nsswitch) features = obj.step_detect_sssd_features('winbind') assert not features
def test_AuthselectScannerLibrary_step_detect_sssd_features__sudo(): nsswitch = get_config(''' passwd: files sss systemd group: files sss systemd sudoers: files sss ''') obj = AuthselectScannerLibrary([], Authconfig(''), DConf(''), PAM(''), nsswitch) features = obj.step_detect_sssd_features('sssd') assert features == ['with-sudo']
def test_AuthselectScannerLibrary_step_detect_sssd_features__smartcard(): pam = get_config(''' auth sufficient pam_unix.so auth sufficient pam_sss.so auth required pam_deny.so ''') ac = get_config(''' USESMARTCARD=yes ''') obj = AuthselectScannerLibrary([], Authconfig(ac), DConf(''), PAM(pam), '') features = obj.step_detect_sssd_features('sssd') assert features == ['with-smartcard']
def test_AuthselectScannerLibrary_step_detect_sssd_features__smartcard_lock(): pam = get_config(''' auth sufficient pam_unix.so auth sufficient pam_sss.so auth required pam_deny.so ''') dconf = get_config(''' [org/gnome/settings-daemon/peripherals/smartcard] removal-action='lock-screen' ''') obj = AuthselectScannerLibrary([], Authconfig(''), DConf(dconf), PAM(pam), '') features = obj.step_detect_sssd_features('sssd') assert features == ['with-smartcard-lock-on-removal']
def test_AuthselectScannerLibrary_step_detect_sssd_features__pkcs11(): pam = get_config(''' auth sufficient pam_unix.so auth sufficient pam_pkcs11.so auth sufficient pam_sss.so auth required pam_deny.so ''') ac = get_config(''' USESMARTCARD=yes FORCESMARTCARD=yes ''') dconf = get_config(''' [org/gnome/settings-daemon/peripherals/smartcard] removal-action='lock-screen' ''') obj = AuthselectScannerLibrary([], Authconfig(ac), DConf(dconf), PAM(pam), '') features = obj.step_detect_sssd_features('sssd') assert not features