Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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']
Ejemplo n.º 3
0
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']
Ejemplo n.º 4
0
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']
Ejemplo n.º 5
0
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