diff --git a/mugen/libs/locallibs/common_lib.sh b/mugen/libs/locallibs/common_lib.sh index 7bfb12513c4f4a17f073bd9b6c58bb0fba8fbf23..ba63d44d0a4d8f220894c58491eccbe757b60a34 100644 --- a/mugen/libs/locallibs/common_lib.sh +++ b/mugen/libs/locallibs/common_lib.sh @@ -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 }