提交 28257da8 编写于 作者: L ltx 提交者: Gitee

check if function exists before calling

上级 5a11d369
......@@ -177,19 +177,30 @@ function SSH_SCP() {
return $ret
}
function POST_TEST_DEFAULT()
{
LOG_INFO "$0 post_test"
}
function main() {
trap post_test EXIT INT TERM
if [ -n "$(type -t post_test)" ];then
trap post_test EXIT INT TERM
else
trap POST_TEST_DEFAULT EXIT INT TERM
fi
if ! rpm -qa | grep expect >/dev/null 2>&1; then
dnf install expect -y
fi
config_params
pre_test
if [ -n "$(type -t config_params)" ];then
config_params
fi
run_test
if [ -n "$(type -t pre_test)" ];then
pre_test
fi
CASE_RESULT
run_test && CASE_RESULT
test $? -eq 0 || exit 1
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册