From 1d629e8e0d365ab5765062b82f125cfe95e37594 Mon Sep 17 00:00:00 2001 From: David Shea Date: Fri, 31 Jul 2015 14:12:17 -0400 Subject: [PATCH] Fix and expand nfs-repo-and-addon.ks Make the file checks actually match the comments, and add checks for whether the repo file that is supposed to be installed is actually installed. --- tests/kickstart_tests/nfs-repo-and-addon.ks | 46 +++++++++++++++++---- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/tests/kickstart_tests/nfs-repo-and-addon.ks b/tests/kickstart_tests/nfs-repo-and-addon.ks index 9d57b85d48a..5c586249d43 100644 --- a/tests/kickstart_tests/nfs-repo-and-addon.ks +++ b/tests/kickstart_tests/nfs-repo-and-addon.ks @@ -4,16 +4,17 @@ nfs --server=NFS-SERVER --dir=NFS-PATH # NFS: # - testpkg-nfs-core, to be installed with @core # - testpkg-nfs-addon, to be installed because we ask for it -# - testpkg-share1, contains a file /usr/share/testpkg-2/nfs. To be installed by excluding -# the HTTP version. -# - testpkg-share2, contains a file /usr/share/testpkg-3/nfs. To be excluded via cost +# - testpkg-share1, contains a file /usr/share/testpkg-1/nfs. To be installed by excluding +# the HTTP version, despite http's lower cost. +# - testpkg-share2, contains a file /usr/share/testpkg-2/nfs. To be excluded via cost # HTTP: # - testpkg-http-core, to be installed with @core # - testpkg-http-addon, to be installed because we ask for it -# - testpkg-share1, contains a file /usr/share/testpkg-2/http. To be excluded via excludepkgs. -# - testpkg-share2, contains a file /usr/share/testpkg-3/http. To be included via cost. -repo --name=kstest-nfs --baseurl=NFS-ADDON-REPO --cost=50 --install -repo --name=kstest-http --baseurl=HTTP-ADDON-REPO --cost=25 --excludepkgs=testpkg-share2 --install +# - testpkg-share1, contains a file /usr/share/testpkg-1/http. To be excluded via excludepkgs. +# - testpkg-share2, contains a file /usr/share/testpkg-2/http. To be included because the cost +# is lower. +repo --name=kstest-nfs --baseurl=NFS-ADDON-REPO --cost=50 +repo --name=kstest-http --baseurl=HTTP-ADDON-REPO --cost=25 --excludepkgs=testpkg-share1 --install install network --bootproto=dhcp @@ -61,17 +62,44 @@ if [[ "${status}" -eq 0 ]]; then fi # Double check that the correct marker files are in place - if [[ -e /usr/share/testpkg-1/nfs ]]; then + if [[ ! -e /usr/share/testpkg-1/nfs ]]; then echo "*** unable to find marker for testpkg-share1" >> /root/RESULT status=1 fi - if [[ -e /usr/share/testpkg-2/http ]]; then + if [[ ! -e /usr/share/testpkg-2/http ]]; then echo "*** unable to find marker for testpkg-share2" >> /root/RESULT status=1 fi fi +repofile=/etc/yum.repos.d/kstest-http.repo +if [[ "${status}" -eq 0 ]]; then + # Check that the repo file got installed + if [[ ! -e $repofile ]]; then + echo "*** kstest-http.repo was not installed" >> /root/RESULT + status=1 + # Check that is has all the options + elif ! grep -q '^baseurl=HTTP-ADDON-REPO$' $repofile ; then + echo "*** kstest-http.repo is missing the baseurl" >> /root/RESULT + status=1 + elif ! grep -q '^cost=25$' $repofile; then + echo "*** kstest-http.repo is missing the cost" >> /root/RESULT + status=1 + elif ! grep -q '^exclude=testpkg-share1$' $repofile; then + echo "*** kstest-http.repo is missing the exclude" >> /root/RESULT + status=1 + fi +fi + +if [[ "${status}" -eq 0 ]]; then + # Check that the NFS repo file was not installed + if [[ -e /etc/yum.repos.d/kstest-nfs.repo ]]; then + echo "*** kstest-nfs.repo was installed with --install" >> /root/RESULT + status=1 + fi +fi + if [[ "${status}" -eq 0 ]]; then echo SUCCESS > /root/RESULT fi