From 07cbb939fd33e16bb45bea316ff683ddde556daf Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Nov 15 2017 18:47:54 +0000 Subject: bin/test_show_highstate.sh: fixes: - fix the arguments on write_grains() - move the show_highstate command and the print of the results out of write_grains() --- diff --git a/bin/test_show_highstate.sh b/bin/test_show_highstate.sh index 5ee198c..b787c74 100755 --- a/bin/test_show_highstate.sh +++ b/bin/test_show_highstate.sh @@ -23,20 +23,20 @@ ALL_LOCATIONS=( ) write_grains() { - $SUDO sed -i -e "s/\(city:\).*/\1 $1/" -e "s/\(country:\).*/\1 $2/" -e "s/\(osfullname:\).*/\1 $1/" -e "s/\(osmajorrelease:\).*/\1 $2/" \ - -e "s/\(osrelease_info:\).*/\1 [$2, $3]/" -e "s/\(virt_cluster:\).*/\1 $3/ "etc/salt/grains + $SUDO sed -i -e "s/\(city:\).*/\1 $1/" -e "s/\(country:\).*/\1 $2/" -e "s/\(osfullname:\).*/\1 $4/" -e "s/\(osmajorrelease:\).*/\1 $5/" \ + -e "s/\(osrelease_info:\).*/\1 [$5, $6]/" -e "s/\(virt_cluster:\).*/\1 $3/" /etc/salt/grains echo "Grains: osfullname: $4, osmajorrelease: $5, city: $1, country: $2, virt_cluster: $3" - if $($SUDO $RUN_TEST > /dev/null); then - echo 'PASSED' - else - STATUS=1 - fi - echo } for os in ${ALL_OS[@]}; do for location in ${ALL_LOCATIONS[@]}; do write_grains ${location//,/ } ${os//,/ } + if $($SUDO $RUN_TEST > /dev/null); then + echo 'PASSED' + else + STATUS=1 + fi + echo done done