toolkit/func/core/pkg_cracklib/10-test-passwords.sh

19 lines
580 B
Bash
Raw Normal View History

2021-07-05 06:50:25 +00:00
#!/bin/bash
r_log "cracklib" "Test that cracklib can check passwords"
r_log "cracklib" "Test a very simple password"
echo -e "test" | cracklib-check | grep -q "too short"
r_checkExitStatus $?
r_log "cracklib" "Test a simple/dictionary password"
echo -e "testing" | cracklib-check | grep -q "dictionary"
r_checkExitStatus $?
r_log "cracklib" "Testing simplistic password"
echo -e "1234_abc" | cracklib-check | grep -q 'simplistic'
r_checkExitStatus $?
r_log "cracklib" "Testing a complicated password"
echo -e "2948_Obaym-" | cracklib-check | grep -q "OK"
2023-11-21 08:23:44 +00:00
r_checkExitStatus $?