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)')
c3b6d5
  then
James Hogarth 62aaba
c3b6d5
  t_Log "Running $0 - Restoring up resolv.conf"
c3b6d5
  cp /tmp/resolv.conf.ipa-tests /etc/resolv.conf
James Hogarth 62aaba
c3b6d5
  t_Log "Running $0 - Restoring nsswitch.conf"
c3b6d5
  cp /tmp/nsswitch.conf.ipa-tests /etc/nsswitch.conf
James Hogarth 62aaba
c3b6d5
  t_Log "Running $0 - Restoring  hosts file"
c3b6d5
  cp /tmp/hosts.ipa-tests /etc/hosts
James Hogarth 62aaba
c3b6d5
  if [[ -f /tmp/ntp.conf.ipa-tests ]]
c3b6d5
    then
c3b6d5
    t_Log "Running $0 - Restoring  ntp.conf file"
c3b6d5
    cp /tmp/ntp.conf.ipa-tests /etc/ntp.conf
c3b6d5
  fi
c3b6d5
c3b6d5
  t_Log "Running $0 - Rolling back to yum history id - this will take some time"
c3b6d5
    /usr/bin/yum -y history rollback $(cat /tmp/yum-rollback-id.ipa-tests) &> /dev/null
James Hogarth 1deb36
c3b6d5
  rm -f /tmp/*.ipa-test /etc/httpd/conf.d/*
James Hogarth 62aaba
c3b6d5
  if [ "$centos_ver" = "7" ] ; then
c3b6d5
    hostnamectl set-hostname $(cat /tmp/hostname.ipa-tests) 
c3b6d5
  else
c3b6d5
    hostname $(cat /tmp/hostname.ipa-tests)
c3b6d5
  fi
James Hogarth 62aaba
James Hogarth 62aaba
else
James Hogarth 62aaba
    echo "Skipped on CentOS 5"
James Hogarth 62aaba
fi
James Hogarth 62aaba