bstinson / centos / t_functional

Forked from centos/t_functional 4 years ago
Clone

Blame tests/p_ipa-server/99-postclean.sh

James Hogarth 62aaba
#!/bin/bash
James Hogarth 62aaba
# Author: James Hogarth <james.hogarth@gmail.com>
James Hogarth 62aaba
#
James Hogarth 62aaba
James Hogarth abe41f
if (t_GetPkgRel basesystem | grep -qE 'el(6|7)')
James Hogarth 62aaba
then
James Hogarth 62aaba
James Hogarth 62aaba
t_Log "Running $0 - Restoring up resolv.conf"
James Hogarth 62aaba
cp /tmp/resolv.conf.ipa-tests /etc/resolv.conf
James Hogarth 62aaba
James Hogarth 62aaba
t_Log "Running $0 - Restoring nsswitch.conf"
James Hogarth 62aaba
cp /tmp/nsswitch.conf.ipa-tests /etc/nsswitch.conf
James Hogarth 62aaba
James Hogarth db0e0b
t_Log "Running $0 - Restoring  hosts file"
James Hogarth 62aaba
cp /tmp/hosts.ipa-tests /etc/hosts
James Hogarth 62aaba
James Hogarth abe41f
if [[ -f /tmp/ntp.conf.ipa-tests ]]
James Hogarth abe41f
then
James Hogarth 1deb36
t_Log "Running $0 - Restoring  ntp.conf file"
James Hogarth 1deb36
cp /tmp/ntp.conf.ipa-tests /etc/ntp.conf
James Hogarth abe41f
fi
James Hogarth 1deb36
James Hogarth db0e0b
t_Log "Running $0 - Rolling back to yum history id"
James Hogarth 62aaba
/usr/bin/yum -y history rollback $(cat /tmp/yum-rollback-id.ipa-tests) &> /dev/null
James Hogarth 62aaba
James Hogarth 8c426b
rm -f /tmp/*.ipa-test /etc/httpd/conf.d/*
James Hogarth af79cd
sed -i "s/$(ip a s dev eth0 | awk '$0 ~ /scope global eth0/ {print $2}' | cut -d'/' -f 1) $(hostname)//" /etc/hosts
James Hogarth af79cd
hostname localhost.localdomain
James Hogarth 62aaba
James Hogarth 62aaba
else
James Hogarth 62aaba
    echo "Skipped on CentOS 5"
James Hogarth 62aaba
fi
James Hogarth 62aaba