From 608dd4d40d55955a1d42bdce9ecc9ebbd4999896 Mon Sep 17 00:00:00 2001 From: Christoph Galuschka Date: Jun 29 2014 17:12:45 +0000 Subject: fix to use /usr/bin/cp in C7 and /bin/cp in C6 --- diff --git a/tests/p_ipa-server/99-postclean.sh b/tests/p_ipa-server/99-postclean.sh index 1ba0b4a..b300fac 100755 --- a/tests/p_ipa-server/99-postclean.sh +++ b/tests/p_ipa-server/99-postclean.sh @@ -4,27 +4,35 @@ if (t_GetPkgRel basesystem | grep -qE 'el(6|7)') then + if (t_GetPkgRel basesystem | grep -qE 'el(6)') + then + CP=/bin/cp + fi + if (t_GetPkgRel basesystem | grep -qE 'el(7)') + then + CP=/usr/bin/cp + fi t_Log "Running $0 - Restoring up resolv.conf" - /usr/bin/cp /tmp/resolv.conf.ipa-tests /etc/resolv.conf + ${CP} /tmp/resolv.conf.ipa-tests /etc/resolv.conf t_Log "Running $0 - Restoring nsswitch.conf" - /usr/bin/cp /tmp/nsswitch.conf.ipa-tests /etc/nsswitch.conf + ${CP} /tmp/nsswitch.conf.ipa-tests /etc/nsswitch.conf t_Log "Running $0 - Restoring hosts file" - /usr/bin/cp /tmp/hosts.ipa-tests /etc/hosts + ${CP} /tmp/hosts.ipa-tests /etc/hosts if [[ -f /tmp/ntp.conf.ipa-tests ]] then t_Log "Running $0 - Restoring ntp.conf file" - /usr/bin/cp /tmp/ntp.conf.ipa-tests /etc/ntp.conf + ${CP} /tmp/ntp.conf.ipa-tests /etc/ntp.conf fi t_Log "Running $0 - Rolling back to yum history id - this will take some time" /usr/bin/yum -y history rollback $(cat /tmp/yum-rollback-id.ipa-tests) &> /dev/null t_Log "Running $0 - Restoring ssh_config" - /usr/bin/cp /etc/ssh/ssh_config.ipa-tests /etc/ssh/ssh_config + ${CP} /etc/ssh/ssh_config.ipa-tests /etc/ssh/ssh_config rm -f /tmp/*.ipa-test /etc/httpd/conf.d/*