diff --git a/tests/p_ipa-server/7-addsudo.sh b/tests/p_ipa-server/7-addsudo.sh index fdd0a3d..03ef28e 100755 --- a/tests/p_ipa-server/7-addsudo.sh +++ b/tests/p_ipa-server/7-addsudo.sh @@ -55,10 +55,16 @@ t_Log "Running $0 - test adding sudo configuration" echo "sudoers: files sss" >> /etc/nsswitch.conf sed -i 's/services = nss, pam, ssh/services = nss, pam, ssh, sudo/' /etc/sssd/sssd.conf sed -i 's/id_provider = ipa/id_provider = ipa\nsudo_provider = ldap\nldap_sudo_search_base = ou=sudoers,dc=c6ipa,dc=local\nldap_sasl_mech = GSSAPI/' /etc/sssd/sssd.conf -/sbin/service sssd restart &> /dev/null + +t_Log "Running $0 - clearing the sssd cache" +/sbin/service sssd stop &> /dev/null +rm -rf /var/lib/sss/db/* +/sbin/service sssd start &> /dev/null /sbin/service sssd status | grep 'is running' &> /dev/null t_CheckExitStatus $? +## Leaving a little time to settle as there seems to be a slight race condition to go right away +sleep 10 t_Log "Running $0 - test sudo works" expect -f - &> /tmp/sudotestoutput.ipa-test <<EOF diff --git a/tests/p_ipa-server/99-postclean.sh b/tests/p_ipa-server/99-postclean.sh index 3c77d63..8578e08 100755 --- a/tests/p_ipa-server/99-postclean.sh +++ b/tests/p_ipa-server/99-postclean.sh @@ -11,10 +11,10 @@ cp /tmp/resolv.conf.ipa-tests /etc/resolv.conf t_Log "Running $0 - Restoring nsswitch.conf" cp /tmp/nsswitch.conf.ipa-tests /etc/nsswitch.conf -t_Log "Running $0 - Backing up hosts file" +t_Log "Running $0 - Restoring hosts file" cp /tmp/hosts.ipa-tests /etc/hosts -t_Log "Running $0 - Backing up saving yum history id" +t_Log "Running $0 - Rolling back to yum history id" /usr/bin/yum -y history rollback $(cat /tmp/yum-rollback-id.ipa-tests) &> /dev/null rm -f /tmp/*.ipa-test