Blame tests/p_ipa-server/3-verify_kerberos_tickets.sh

James Hogarth a5d690
#!/bin/bash
James Hogarth a5d690
# Author: James Hogarth <james.hogarth@gmail.com>
James Hogarth a5d690
#
James Hogarth a5d690
James Hogarth acc301
if (t_GetPkgRel basesystem | grep -q el6)
James Hogarth acc301
then
James Hogarth acc301
James Hogarth a5d690
# kinit cannot take password from stdin so use expect
James Hogarth a5d690
James Hogarth a5d690
t_InstallPackage expect
James Hogarth a5d690
James Hogarth a5d690
t_Log "Running $0 - testing host kerberos principal
James Hogarth a5d690
klist -k /etc/krb5.keytab | grep "host/c6test.c6ipa.local" &> /dev/null
James Hogarth a5d690
James Hogarth a5d690
t_CheckExitStatus $?
James Hogarth a5d690
James Hogarth a5d690
t_Log "Running $0 - testing admin user kerberos principal
James Hogarth a5d690
James Hogarth a5d690
kdestroy &> /dev/null
James Hogarth a5d690
James Hogarth a5d690
klist 2>&1  | grep "No credentials" &> /dev/null
James Hogarth a5d690
James Hogarth a5d690
t_CheckExitStatus $?
James Hogarth a5d690
James Hogarth a5d690
expect -f - &> /dev/null <
James Hogarth a5d690
set send_human {.1 .3 1 .05 2}
James Hogarth a5d690
spawn kinit admin
James Hogarth a5d690
sleep 1
James Hogarth a5d690
expect "Password for admin@C6IPA.LOCAL:"
James Hogarth a5d690
send -h "p455w0rd\r"
James Hogarth a5d690
sleep 1
James Hogarth a5d690
close
James Hogarth a5d690
EOF
James Hogarth a5d690
James Hogarth a5d690
klist | grep "admin@C6IPA.LOCAL" &> /dev/null
James Hogarth a5d690
James Hogarth a5d690
t_CheckExitStatus $?
James Hogarth a5d690
James Hogarth acc301
else
James Hogarth acc301
    echo "Skipped on CentOS 5"
James Hogarth acc301
fi
James Hogarth a5d690