+ if [[ "${TEST_LEVEL}" == "testcase" ]]; then
+ TEST_CONFIG="${POSCA_TESTCASE}"
+ else
+ if [[ "${TEST_LEVEL}" == "teststory" ]]; then
+ TEST_CONFIG="${POSCA_TESTSTORY}"
+ else
+ info "Invalid name for test level: testcase or teststory"
+ fi
+ fi
+
+ # Find all the test case yaml files first
+ find $TEST_CONFIG -name "*yaml" > /tmp/all_tests.yaml
+ all_tests_insuite=`cat /tmp/all_tests.yaml | awk -F '/' '{print $NF}' | awk -F '.' '{print $1}'`
+ all_tests=(${all_tests_insuite})
+
+ if [ "${TEST_NAME}" != "" ]; then
+ TEST_EXEC=(${TEST_NAME// /})
+ for i in "${TEST_EXEC[@]}"; do
+ if [[ " ${all_tests[*]} " != *" $i "* ]]; then
+ error "Unknown $TEST_LEVEL: $i. Available $TEST_LEVEL are: ${all_tests[@]}"
+ fi
+ done
+ info "Tests to execute: ${TEST_NAME}."
+ else
+ error "Lack of $TEST_LEVEL name"
+ fi
+}
+
+# Define run test function