From 25b9c2fe64a4a7c3d4471ae84be48fb3c6eb2efe Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 15 May 2020 15:31:59 -0400 Subject: [PATCH] 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 --- tests/config/common.bash | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.34.1