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

James Hogarth 175228
#!/bin/bash 
James Hogarth a5d690
# Author: James Hogarth <james.hogarth@gmail.com>
James Hogarth a5d690
#
James Hogarth a5d690
c1e011
if (t_GetPkgRel basesystem | grep -qE 'el(6|7)') && !(t_GetArch | grep -qE 'aarch64')
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
Christoph Galuschka a8fd60
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
Christoph Galuschka a8fd60
t_Log "Running $0 - testing admin user kerberos principal"
James Hogarth a5d690
James Hogarth a5d690
kdestroy &> /dev/null
James Hogarth a5d690
James Hogarth 6c929b
klist 2>&1  | grep -E "(No credentials|Credentials cache .* not found)" &> /dev/null
James Hogarth a5d690
James Hogarth a5d690
t_CheckExitStatus $?
James Hogarth a5d690
James Hogarth 19cf3b
expect -f - <
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 8030de
sleep 5
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
c1e011
    echo "Skipped on CentOS 5 and AArch64"
James Hogarth acc301
fi
James Hogarth a5d690