From 15378d2be16c29e7966bc47cb69f3f4273a02945 Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Jan 22 2018 00:50:32 +0000 Subject: pass the tests when salt-call returns 2 due to an upstream bug https://github.com/saltstack/salt/issues/39172 when the state.sls is creating an empty file, salt-call returns exit code 2, thus showin our tests as failing. Syntax errors have different exit codes, so it seems safe to ignore the exit code 2 --- diff --git a/bin/test_show_highstate.sh b/bin/test_show_highstate.sh index f43a36e..0f5edcd 100755 --- a/bin/test_show_highstate.sh +++ b/bin/test_show_highstate.sh @@ -31,7 +31,9 @@ write_grains() { for os in ${ALL_OS[@]}; do for location in ${ALL_LOCATIONS[@]}; do write_grains ${location//,/ } ${os//,/ } - if $($RUN_TEST > /dev/null); then + $RUN_TEST > /dev/null + _STATUS=$(echo $?) + if [[ $_STATUS -eq 0 ]] || [[ $_STATUS -eq 2 ]]; then echo 'PASSED' else STATUS=1