source "${OET_PATH}/libs/locallibs/common_lib.sh"
function pre_test() {
LOG_INFO "Start environmental preparation."
DNF_INSTALL "python-twisted"
LOG_INFO "End of environmental preparation!"
}
function run_test() {
LOG_INFO "Start to run test."
twistd --help | grep "inetd"
CHECK_RESULT $? 0 0 "twistd --help does not contain inetd command"
twistd inetd --help
CHECK_RESULT $? 0 0 "twistd inetd --help failed"
twistd inetd -d ./testdir
CHECK_RESULT $? 0 0 "twistd inetd -d ./testdir failed"
twistd inetd -l ./test.log
CHECK_RESULT $? 0 0 "twistd inetd -l ./test.log failed"
twistd inetd -n
CHECK_RESULT $? 0 0 "twistd inetd -n failed"
twistd inetd -u 1000
CHECK_RESULT $? 0 0 "twistd inetd -u 1000 failed"
twistd inetd -g 1000
CHECK_RESULT $? 0 0 "twistd inetd -g 1000 failed"
twistd inetd --pidfile ./test.pid
CHECK_RESULT $? 0 0 "twistd inetd --pidfile ./test.pid failed"
twistd inetd --reactor epoll
CHECK_RESULT $? 0 0 "twistd inetd --reactor epoll failed"
LOG_INFO "End of the test."
}
function post_test() {
LOG_INFO "start environment cleanup."
DNF_REMOVE "python-twisted"
rm -rf ./testdir ./test.log ./test.pid
LOG_INFO "End of environment cleanup!"
}
main "$@"