4 Star 18 Fork 184

Fengguang/lkp-tests

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
return 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
caoxueliang 提交于 10个月前 . fix cci return error
#!/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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wu_fengguang/lkp-tests.git
git@gitee.com:wu_fengguang/lkp-tests.git
wu_fengguang
lkp-tests
lkp-tests
master

搜索帮助