mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-06 12:39:35 +02:00
31 lines
836 B
Bash
31 lines
836 B
Bash
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
|
|
|
|
run_node_test <<'JS'
|
|
const polkit = requireFromRoot('shell/plugins/polkit/PolkitModel.js')
|
|
|
|
assert(polkit.promptLooksFingerprint('Swipe your finger'), 'polkit detects fingerprint prompts')
|
|
assert(polkit.promptLooksFingerprint('fprintd verification'), 'polkit detects fprint prompts')
|
|
assert(!polkit.promptLooksFingerprint('Password:'), 'polkit ignores password prompts')
|
|
|
|
assert(
|
|
polkit.fingerprintFirstFromPamConfig(`
|
|
# comment
|
|
auth sufficient pam_fprintd.so
|
|
auth include system-auth
|
|
`),
|
|
'polkit detects fingerprint-first PAM config'
|
|
)
|
|
assert(
|
|
!polkit.fingerprintFirstFromPamConfig(`
|
|
account include system-auth
|
|
auth include system-auth
|
|
auth sufficient pam_fprintd.so
|
|
`),
|
|
'polkit detects password-first PAM config'
|
|
)
|
|
JS
|