diff --git a/tests/shell/006_search.sh b/tests/shell/006_search.sh index d338b2b0..58be6d04 100644 --- a/tests/shell/006_search.sh +++ b/tests/shell/006_search.sh @@ -12,6 +12,6 @@ cfbs search mpf > mpf.log cfbs search masterfiles > masterfiles.log grep "python" all.log -! grep "python" mpf.log +if grep "python" mpf.log; then exit 1; fi grep "masterfiles" mpf.log grep "masterfiles" masterfiles.log diff --git a/tests/shell/008_remove.sh b/tests/shell/008_remove.sh index dec19c88..79c0ac7d 100644 --- a/tests/shell/008_remove.sh +++ b/tests/shell/008_remove.sh @@ -9,4 +9,4 @@ rm -rf .git cfbs --non-interactive init grep '"name": "masterfiles"' cfbs.json cfbs --non-interactive remove masterfiles --non-interactive -! grep '"name": "masterfiles"' cfbs.json +if grep '"name": "masterfiles"' cfbs.json; then exit 1; fi diff --git a/tests/shell/009_clean.sh b/tests/shell/009_clean.sh index d971c298..47e26d96 100644 --- a/tests/shell/009_clean.sh +++ b/tests/shell/009_clean.sh @@ -11,8 +11,8 @@ cfbs --non-interactive add promise-type-git grep '"name": "library-for-promise-types-in-python"' cfbs.json grep '"name": "promise-type-git"' cfbs.json cfbs --non-interactive remove promise-type-git --non-interactive -! grep '"name": "library-for-promise-types-in-python"' cfbs.json -! grep '"name": "promise-type-git"' cfbs.json +if grep '"name": "library-for-promise-types-in-python"' cfbs.json; then exit 1; fi +if grep '"name": "promise-type-git"' cfbs.json; then exit 1; fi # Check that clean does nothing: cat cfbs.json > before.json diff --git a/tests/shell/029_init_masterfiles_version_3.18.1-1.sh b/tests/shell/029_init_masterfiles_version_3.18.1-1.sh index d040c1dc..af23b16b 100644 --- a/tests/shell/029_init_masterfiles_version_3.18.1-1.sh +++ b/tests/shell/029_init_masterfiles_version_3.18.1-1.sh @@ -12,5 +12,5 @@ grep '"version": "3.18.1-1"' cfbs.json grep '"commit": "b6e9eacc65c797f4c2b4a59056293636c320d0c9"' cfbs.json cfbs build cfbs --non-interactive update -! grep '"version": "3.18.1-1"' cfbs.json -! grep '"commit": "b6e9eacc65c797f4c2b4a59056293636c320d0c9"' cfbs.json +if grep '"version": "3.18.1-1"' cfbs.json; then exit 1; fi +if grep '"commit": "b6e9eacc65c797f4c2b4a59056293636c320d0c9"' cfbs.json; then exit 1; fi diff --git a/tests/shell/030_get_set_input.sh b/tests/shell/030_get_set_input.sh index be7cd70b..b91243f9 100644 --- a/tests/shell/030_get_set_input.sh +++ b/tests/shell/030_get_set_input.sh @@ -93,7 +93,7 @@ echo '[ "response": "/tmp/test-2.txt" } ]' > igors-input.json -! cfbs set-input create-single-file igors-input.json +if cfbs set-input create-single-file igors-input.json; then exit 1; fi # Now Igor instead changes a key echo '[ @@ -105,7 +105,7 @@ echo '[ "response": "/tmp/test-2.txt" } ]' > igors-input.json -! cfbs set-input create-single-file igors-input.json +if cfbs set-input create-single-file igors-input.json; then exit 1; fi # Igor changes the order but that's all right echo '[ diff --git a/tests/shell/041_add_multidep.sh b/tests/shell/041_add_multidep.sh index 22578051..887f971d 100644 --- a/tests/shell/041_add_multidep.sh +++ b/tests/shell/041_add_multidep.sh @@ -17,5 +17,5 @@ grep -F "Added module: test-inventory-local-groups" ./output.log grep -F "Added module: test-inventory-local-users" ./output.log # Adding modules together with their dependencies should not display skipping messages (CFE-3841): -! ( grep -F "Skipping already added" ./output.log ) +if ( grep -F "Skipping already added" ./output.log ); then exit 1; fi diff --git a/tests/shell/043_replace_version.sh b/tests/shell/043_replace_version.sh index f78c87e5..c1da79d7 100644 --- a/tests/shell/043_replace_version.sh +++ b/tests/shell/043_replace_version.sh @@ -13,17 +13,17 @@ cp ../shell/043_replace_version/subdir/example.py ./subdir/example.py # Before building, version number is 0.0.0: grep 'print("Version: 0.0.0")' ./subdir/example.py -! grep 'print("Version: 1.2.3")' ./subdir/example.py +if grep 'print("Version: 1.2.3")' ./subdir/example.py; then exit 1; fi cfbs build # After building, input and output should be different: -! diff ./subdir/example.py ./out/masterfiles/services/cfbs/subdir/example.py +if diff ./subdir/example.py ./out/masterfiles/services/cfbs/subdir/example.py; then exit 1; fi # Check that version number is correct in output: grep 'print("Version: 1.2.3")' ./out/masterfiles/services/cfbs/subdir/example.py -! grep 'print("Version: 0.0.0")' ./out/masterfiles/services/cfbs/subdir/example.py +if grep 'print("Version: 0.0.0")' ./out/masterfiles/services/cfbs/subdir/example.py; then exit 1; fi # Also check that the input was not modified: grep 'print("Version: 0.0.0")' ./subdir/example.py -! grep 'print("Version: 1.2.3")' ./subdir/example.py +if grep 'print("Version: 1.2.3")' ./subdir/example.py; then exit 1; fi diff --git a/tests/shell/044_replace.sh b/tests/shell/044_replace.sh index ca4eff18..b1352236 100644 --- a/tests/shell/044_replace.sh +++ b/tests/shell/044_replace.sh @@ -17,7 +17,7 @@ cfbs build ls out/masterfiles/services/cfbs/subdir/example.py # Replace should have changed it: -! diff ./subdir/example.py out/masterfiles/services/cfbs/subdir/example.py > /dev/null +if diff ./subdir/example.py out/masterfiles/services/cfbs/subdir/example.py > /dev/null; then exit 1; fi # This is the expected content: diff ./subdir/example.expected.py out/masterfiles/services/cfbs/subdir/example.py diff --git a/tests/shell/048_remove_with_dependencies.sh b/tests/shell/048_remove_with_dependencies.sh index 2d4afd2b..9f77db4d 100644 --- a/tests/shell/048_remove_with_dependencies.sh +++ b/tests/shell/048_remove_with_dependencies.sh @@ -15,8 +15,8 @@ grep '"name": "example-dependency"' cfbs.json cfbs --non-interactive remove example-module --non-interactive cfbs validate -! grep '"name": "example-module"' cfbs.json -! grep '"name": "example-dependency"' cfbs.json +if grep '"name": "example-module"' cfbs.json; then exit 1; fi +if grep '"name": "example-dependency"' cfbs.json; then exit 1; fi @@ -30,4 +30,4 @@ cfbs --non-interactive remove example-dependency --non-interactive cfbs validate grep '"name": "example-module"' cfbs.json -! grep '"name": "example-dependency"' cfbs.json +if grep '"name": "example-dependency"' cfbs.json; then exit 1; fi diff --git a/tests/shell/049_remove_with_circular_dependencies.sh b/tests/shell/049_remove_with_circular_dependencies.sh index e0b9b6a4..6da2f994 100644 --- a/tests/shell/049_remove_with_circular_dependencies.sh +++ b/tests/shell/049_remove_with_circular_dependencies.sh @@ -15,8 +15,8 @@ grep '"name": "example-dependency"' cfbs.json cfbs --non-interactive remove example-module --non-interactive cfbs validate -! grep '"name": "example-module"' cfbs.json -! grep '"name": "example-dependency"' cfbs.json +if grep '"name": "example-module"' cfbs.json; then exit 1; fi +if grep '"name": "example-dependency"' cfbs.json; then exit 1; fi @@ -29,5 +29,5 @@ grep '"name": "example-dependency"' cfbs.json cfbs --non-interactive remove example-dependency --non-interactive cfbs validate -! grep '"name": "example-module"' cfbs.json -! grep '"name": "example-dependency"' cfbs.json +if grep '"name": "example-module"' cfbs.json; then exit 1; fi +if grep '"name": "example-dependency"' cfbs.json; then exit 1; fi diff --git a/tests/shell/052_get_input_module_not_found.sh b/tests/shell/052_get_input_module_not_found.sh index 441abdfc..02eb1d9b 100644 --- a/tests/shell/052_get_input_module_not_found.sh +++ b/tests/shell/052_get_input_module_not_found.sh @@ -26,11 +26,11 @@ echo '{ # Asks for the input of a module which is neither in the project nor in the # index. This used to crash with an uncaught KeyError from the index, instead of # reporting that the module was not found: -! cfbs get-input no-such-module-anywhere - 2> actual.error +if cfbs get-input no-such-module-anywhere - 2> actual.error; then exit 1; fi grep "Module 'no-such-module-anywhere' not found" actual.error -! grep "Traceback" actual.error +if grep "Traceback" actual.error; then exit 1; fi # Asks for the input of a module where version does not exist -! cfbs get-input delete-files@9.9.9 - 2> actual.error +if cfbs get-input delete-files@9.9.9 - 2> actual.error; then exit 1; fi grep "Module 'delete-files@9.9.9' not found" actual.error -! grep "Traceback" actual.error +if grep "Traceback" actual.error; then exit 1; fi diff --git a/tests/shell/053_set_input_not_a_list.sh b/tests/shell/053_set_input_not_a_list.sh index 0998d6e2..9952249b 100644 --- a/tests/shell/053_set_input_not_a_list.sh +++ b/tests/shell/053_set_input_not_a_list.sh @@ -26,15 +26,15 @@ echo '{ # Input data which is not a list of input definitions used to crash with an # uncaught TypeError, instead of reporting that it doesn't conform: echo '0' > actual.input -! cfbs set-input create-single-file actual.input 2> actual.error +if cfbs set-input create-single-file actual.input 2> actual.error; then exit 1; fi grep "does not conform with input definition" actual.error -! grep "Traceback" actual.error +if grep "Traceback" actual.error; then exit 1; fi # An empty object was silently accepted, since there was nothing to compare: echo '{}' > actual.input -! cfbs set-input create-single-file actual.input 2> actual.error +if cfbs set-input create-single-file actual.input 2> actual.error; then exit 1; fi grep "does not conform with input definition" actual.error -! grep "Traceback" actual.error +if grep "Traceback" actual.error; then exit 1; fi # None of it was stored in the project: test ! -e create-single-file/input.json diff --git a/tests/shell/058_render_input_fail.sh b/tests/shell/058_render_input_fail.sh index dae87dbb..91d21b1d 100644 --- a/tests/shell/058_render_input_fail.sh +++ b/tests/shell/058_render_input_fail.sh @@ -36,7 +36,7 @@ echo '[ "response": "/tmp/create-single-file.txt" } ]' > actual.input -! cfbs render-input create-single-file actual.input - +if cfbs render-input create-single-file actual.input -; then exit 1; fi # Neither does a renamed key: echo '[ @@ -48,19 +48,19 @@ echo '[ "response": "/tmp/create-single-file.txt" } ]' > actual.input -! cfbs render-input create-single-file actual.input - +if cfbs render-input create-single-file actual.input -; then exit 1; fi # Input data which doesn't parse as json: echo 'not json' > actual.input -! cfbs render-input create-single-file actual.input - +if cfbs render-input create-single-file actual.input -; then exit 1; fi # A module which doesn't accept any input: echo '[]' > actual.input -! cfbs render-input autorun actual.input - +if cfbs render-input autorun actual.input -; then exit 1; fi # A module which doesn't exist: -! cfbs render-input no-such-module-anywhere actual.input - +if cfbs render-input no-such-module-anywhere actual.input -; then exit 1; fi # A missing outfile, and one argument too many: -! cfbs render-input create-single-file actual.input -! cfbs render-input create-single-file actual.input - - +if cfbs render-input create-single-file actual.input; then exit 1; fi +if cfbs render-input create-single-file actual.input - -; then exit 1; fi