代码拉取完成,页面将自动刷新
#!/usr/bin/env sh
usage()
{
cat <<-EOF
Usage: cci return [option]
return current testbox right now
option:
-h --help show this message
EOF
exit
}
if [[ "$#" != 0 ]]; then
usage
fi
echo 'The command is used to return the testbox!'
while [[ "$flag" != [yY] ]]
do
read -p 'Return immediately [y/Y] or Cancel return [n/N]: ' flag
[[ "$flag" == [nN] ]] && exit
done
kill_lkp()
{
local pid=$(ps -ef | grep /lkp/lkp/src/bin/run-lkp | grep -v "grep" | awk '{print $2}')
kill -9 "$pid"
}
# close job
# set job_health to return
close_job()
{
url_profix="http://${LKP_SERVER}:${LKP_CGI_PORT:-3000}"
url="${url_profix}/~lkp/cgi-bin/lkp-post-run?job_id=${id}&job_health=return"
local response=$(curl -s "$url")
if [ "$response" != \"success\" ];then
echo "close failed: $response"
exit
fi
}
# dc has no reboot command
# so need to kill the lkp process
# if vm kills the lkp process will hang for a while
# so vm use reboot
return_testbox()
{
if [[ "$tbox_group" =~ ^dc.* ]];then
kill_lkp
else
reboot
fi
}
. /lkp/scheduled/job.sh >/dev/null 2>&1
. /lkp/lkp/src/lib/env.sh
has_cmd export_top_env && export_top_env
has_cmd read_job_vars && read_job_vars
close_job
return_testbox
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。