From: Philippe Proulx Date: Fri, 15 May 2020 19:31:59 +0000 (-0400) Subject: barectf_config_check_fail(): check that failure is caused by cfg. error X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=25b9c2fe64a4a7c3d4471ae84be48fb3c6eb2efe;p=deliverable%2Fbarectf.git barectf_config_check_fail(): check that failure is caused by cfg. error This patch makes barectf_config_check_fail() in `config/common.bash` check that the output of `barectf` contains the string configuration: cannot create configuration so as to ensure that the failure is _at least_ caused by a configuration error, even if we don't know if the real failure cause matches what the test intends to verify. Signed-off-by: Philippe Proulx --- diff --git a/tests/config/common.bash b/tests/config/common.bash index 154afec..e79ca90 100644 --- a/tests/config/common.bash +++ b/tests/config/common.bash @@ -59,6 +59,12 @@ barectf_config_check_fail() { run barectf "$1" + if [[ $output != *'configuration: cannot create configuration'* ]]; then + echo "Fail: barectf does not print a configuration error" 1>&2 + popd >/dev/null + return 1 + fi + if [ "$status" -eq 0 ]; then echo "Fail: exit code is 0" 1>&2 popd >/dev/null