# Includes
shellcheck_test -s sh \
"${TEST_SCRIPTS_DIR}/common.sh" \
- "${TEST_SCRIPTS_DIR}/script_install_paths.sh" \
- "${TEST_SCRIPTS_DIR}/unit.sh"
+ "${TEST_SCRIPTS_DIR}/script_install_paths.sh"
shellcheck_test -s bash \
"${TEST_SCRIPTS_DIR}/cluster.bash" \
required_error ()
{
- rc=$(errcode "$1")
+ rc=$(errcode $1)
shift
- required_result "$rc" "$@"
+ required_result $rc "$@"
}
ok ()
--------------------------------------------------
EOF
# Avoid echo, which might expand unintentional escapes
- printf '%s\n' "$_out" | \
- result_filter | \
- cat "${CTDB_TEST_CAT_RESULTS_OPTS:--}"
+ printf '%s\n' "$_out" | result_filter | cat $CTDB_TEST_CAT_RESULTS_OPTS
fi
if ! $_passed ; then
--------------------------------------------------
EOF
# Avoid echo, which might expand unintentional escapes
- printf '%s\n' "$required_output" | \
- cat "${CTDB_TEST_CAT_RESULTS_OPTS:--}"
+ printf '%s\n' "$required_output" | cat $CTDB_TEST_CAT_RESULTS_OPTS
if $CTDB_TEST_DIFF_RESULTS ; then
_outr=$(mktemp)
_date_time_pid='[0-9/][0-9/]*\ [0-9:\.][0-9:\.]*\ \[[\ 0-9][\ 0-9]*\]'
sed -e "s@^${_date_time_pid}:@DATE\ TIME\ \[PID\]:@"
}
-# Used in testcases
-# shellcheck disable=SC2034
TEST_DATE_STAMP=""
# Override this function to customise output filtering.
# Avoid echo, which might expand unintentional escapes
_fout=$(printf '%s\n' "$_out" | result_filter)
- if [ "$_fout" = "$required_output" ] && [ "$_rc" = "$required_rc" ] ; then
+ if [ "$_fout" = "$required_output" -a $_rc = $required_rc ] ; then
_passed=true
else
_passed=false