From 175228b1c307d5ce973ab56e3bab15e8e996c5f2 Mon Sep 17 00:00:00 2001 From: James Hogarth Date: Mar 19 2015 20:47:20 +0000 Subject: make tests valid for current el6 and el7 --- diff --git a/tests/p_ipa-server/1-install_freeipa.sh b/tests/p_ipa-server/1-install_freeipa.sh index 6749a68..bb2c29b 100755 --- a/tests/p_ipa-server/1-install_freeipa.sh +++ b/tests/p_ipa-server/1-install_freeipa.sh @@ -5,7 +5,7 @@ if (t_GetPkgRel basesystem | grep -qE 'el(6|7)') then t_Log "Running $0 - Installing packages, this takes around 2-3 mins" - t_InstallPackage ipa-server bind-dyndb-ldap libsss_sudo + t_InstallPackage ipa-server bind-dyndb-ldap libsss_sudo else echo "Skipped on CentOS 5" fi diff --git a/tests/p_ipa-server/3-verify_kerberos_tickets.sh b/tests/p_ipa-server/3-verify_kerberos_tickets.sh index dc2d03f..bf924fe 100755 --- a/tests/p_ipa-server/3-verify_kerberos_tickets.sh +++ b/tests/p_ipa-server/3-verify_kerberos_tickets.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash # Author: James Hogarth # diff --git a/tests/p_ipa-server/6-dnsdetails.sh b/tests/p_ipa-server/6-dnsdetails.sh index fc01f9f..224639b 100755 --- a/tests/p_ipa-server/6-dnsdetails.sh +++ b/tests/p_ipa-server/6-dnsdetails.sh @@ -26,17 +26,26 @@ klist | grep "admin@C6IPA.LOCAL" &> /dev/null t_CheckExitStatus $? +#There's an element of asynchronous behaviour we've seen here +#Sleeping after the IPA commands to give time for changes to +#happen and named to notice through the bind-dyndb-ldap backend + #Add zone t_Log "Running $0 - Adding a subdomain 'testzone'" ipa dnszone-add --name-server=c6test.c6ipa.local. --admin-email=hostmaster.testzone.c6ipa.local. testzone.c6ipa.local &> /dev/null t_CheckExitStatus $? +sleep 5 #Can get SOA for new zone from DNS +t_Log "Running $0 - Can retrieve SOA for 'testzone'" +dig @localhost -t SOA testzone.c6ipa.local | grep "status: NOERROR" &> /dev/null +t_CheckExitStatus $? #Add record to standard zone t_Log "Running $0 - Adding a testrecord to main domain" ipa dnsrecord-add c6ipa.local testrecord --cname-hostname=c6test &> /dev/null t_CheckExitStatus $? +sleep 5 #Can get record from DNS t_Log "Running $0 - Testing can retrieve record" @@ -47,6 +56,7 @@ t_CheckExitStatus $? t_Log "Running $0 - Adding a testrecord to subdomain" ipa dnsrecord-add testzone.c6ipa.local testrecord --cname-hostname=c6test.c6ipa.local. &> /dev/null t_CheckExitStatus $? +sleep 5 #Can get record from DNS for new zone t_Log "Running $0 - Testing can retrieve record from subdomain" @@ -70,8 +80,6 @@ service named status | grep running &> /dev/null || t_CheckExitStatus $? sleep 1 done -t_CheckExitStatus $? - else echo "Skipped on CentOS 5" fi diff --git a/tests/p_ipa-server/7-addsudo.sh b/tests/p_ipa-server/7-addsudo.sh index 011cbe5..720f78a 100755 --- a/tests/p_ipa-server/7-addsudo.sh +++ b/tests/p_ipa-server/7-addsudo.sh @@ -8,7 +8,7 @@ then # Need admin credentials kdestroy &> /dev/null -klist 2>&1 | grep "No credentials" &> /dev/null +klist 2>&1 | grep -E "(No credentials|Credentials cache .* not found)" &> /dev/null t_CheckExitStatus $? @@ -71,14 +71,16 @@ expect "root@c6test ~\]# " send -- "su - ipatestuser\r" expect "sh-4.1\$ " send -- "sudo -l\r" +sleep 5 expect "password for ipatestuser: " send -- "newp455w0rd\r" -expect "(ALL) ALL\r" +sleep 2 +expect "ALL) ALL\r" EOF grep 'testuser may run the following commands' /tmp/sudotestoutput.ipa-test &> /dev/null t_CheckExitStatus $? -grep '(ALL) ALL' /tmp/sudotestoutput.ipa-test &> /dev/null +grep 'ALL) ALL' /tmp/sudotestoutput.ipa-test &> /dev/null t_CheckExitStatus $? else