barectf_config_check_fail(): check that failure is caused by cfg. error
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 15 May 2020 19:31:59 +0000 (15:31 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 22 May 2020 16:30:18 +0000 (12:30 -0400)
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 <eeppeliteloop@gmail.com>
tests/config/common.bash

index 154afec442dbfdd704a9df666fc7a5ffcc7c70e7..e79ca901b690be993c23090cb3278eb3ab48b9ca 100644 (file)
@@ -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
This page took 0.024425 seconds and 4 git commands to generate.