#!/usr/bin/env bash # Tests for DevStack meta-config functions TOP=$(cd $(dirname "$0")/.. && pwd) # Import config functions source $TOP/inc/ini-config source $TOP/inc/meta-config set -e # check_result() tests and reports the result values # check_result "actual" "expected" function check_result { local actual=$1 local expected=$2 if [[ "$actual" == "$expected" ]]; then echo "OK" else echo -e "failed: $actual != $expected\n" exit 1 fi } # mock function-common:die so that it does not # interrupt our test script function die { exit -1 } function warn { return 0 } TEST_1C_ADD="[eee] type=new multi = foo2" function create_test1c { cat >test1c.conf <test2a.conf <test-etc/test4.conf <test.conf <