bstinson / centos / t_functional

Forked from centos/t_functional 3 years ago
Clone

Blame tests/p_cracklib/cracklib_passwordtest.sh

Christoph Galuschka 966751
#!/bin/sh
Christoph Galuschka 966751
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
Christoph Galuschka 966751
Christoph Galuschka 966751
t_Log "Running $0 - cracklib can check some passwords."
Christoph Galuschka 966751
ret_val=0
Christoph Galuschka 966751
Christoph Galuschka 966751
t_Log "checking very simple password"
Christoph Galuschka 966751
echo -e "test" | cracklib-check | grep -q 'too short'
Christoph Galuschka 966751
t_CheckExitStatus $?
Christoph Galuschka 966751
Christoph Galuschka 966751
t_Log "checking simple password"
Christoph Galuschka 966751
echo -e "testing" | cracklib-check | grep -q 'dictionary'
Christoph Galuschka 966751
t_CheckExitStatus $?
Christoph Galuschka 966751
Christoph Galuschka a8204f
if (t_GetPkgRel basesystem | grep -q el5)
Christoph Galuschka a8204f
then
Christoph Galuschka a8204f
  t_Log "Simplistic password not checked on C5"
Christoph Galuschka a8204f
else
Christoph Galuschka a8204f
  t_Log "checking simplistic password"
Christoph Galuschka a8204f
  echo -e "1234_Hgi" | cracklib-check | grep -q 'simplistic'
Christoph Galuschka a8204f
  t_CheckExitStatus $?
Christoph Galuschka a8204f
fi
Christoph Galuschka 966751
Christoph Galuschka 966751
t_Log "checking complicated password"
Christoph Galuschka 966751
echo -e "1536_Hargi" | cracklib-check | grep -q 'OK'
Christoph Galuschka 966751
t_CheckExitStatus $?