diff --git a/tests/0_common/40_update_hosts.sh b/tests/0_common/40_update_hosts.sh index 49fb4b8..1e0bdfc 100755 --- a/tests/0_common/40_update_hosts.sh +++ b/tests/0_common/40_update_hosts.sh @@ -4,5 +4,5 @@ t_Log "Running $0 - Update /etc/hosts" -echo "$(ip a s dev eth0 | awk '$0 ~ /scope global eth0/ {print $2}' | cut -d'/' -f 1) `hostname` " >> /etc/hosts +echo "127.0.0.1 `hostname`" >> /etc/hosts diff --git a/tests/p_ipa-server/0-preclean.sh b/tests/p_ipa-server/0-preclean.sh index 6b0e913..cfa2a3e 100755 --- a/tests/p_ipa-server/0-preclean.sh +++ b/tests/p_ipa-server/0-preclean.sh @@ -43,6 +43,10 @@ cp /etc/ntp.conf /tmp/ntp.conf.ipa-tests t_Log "Running $0 - Backing up saving yum history id" /usr/bin/yum history list | awk 'NR == 4 {print $1}' > /tmp/yum-rollback-id.ipa-tests +t_Log "Running $0 - Cleaning up hosts file" +sed -i "s/127.0.0.1 $(hostname)//" /etc/hosts + + else echo "Skipped on CentOS 5" fi diff --git a/tests/p_ipa-server/2-configure_freeipa.sh b/tests/p_ipa-server/2-configure_freeipa.sh index 0604460..bd7325a 100755 --- a/tests/p_ipa-server/2-configure_freeipa.sh +++ b/tests/p_ipa-server/2-configure_freeipa.sh @@ -4,6 +4,13 @@ if (t_GetPkgRel basesystem | grep -q el6) then +t_Log "Running $0 - setting hostname of system" +hostname c6test.c6ipa.local +echo "$(ip a s dev eth0 | awk '$0 ~ /scope global eth0/ {print $2}' | cut -d'/' -f 1) $(hostname)" >> /etc/hosts +hostname | grep "c6test.c6ipa.local" &> /dev/null +t_CheckExitStatus $? + + t_Log "Running $0 - Configuring IPA server" ipa-server-install -U --hostname=c6test.c6ipa.local --ip-address=$(ip a s dev eth0 | awk '$0 ~ /scope global eth0/ {print $2}' | cut -d'/' -f 1) -r C6IPA.LOCAL -n c6ipa.local -p p455w0rd -a p455w0rd --ssh-trust-dns --setup-dns --forwarder=$(awk '$0 ~ /nameserver/ {print $2}' /etc/resolv.conf | head -n 1) diff --git a/tests/p_ipa-server/99-postclean.sh b/tests/p_ipa-server/99-postclean.sh index 8299d43..1da2c94 100755 --- a/tests/p_ipa-server/99-postclean.sh +++ b/tests/p_ipa-server/99-postclean.sh @@ -21,6 +21,8 @@ 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 /etc/httpd/conf.d/* +sed -i "s/$(ip a s dev eth0 | awk '$0 ~ /scope global eth0/ {print $2}' | cut -d'/' -f 1) $(hostname)//" /etc/hosts +hostname localhost.localdomain else echo "Skipped on CentOS 5"