1 Star 0 Fork 2

凹凸曼打小怪兽/wenjian

forked from banzhuanxiaodoubi/wenjian 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
oe_test_rasdaemon_CE_timeout.sh 2.18 KB
一键复制 编辑 原始数据 按行查看 历史
banzhuanxiaodoubi 提交于 2022-03-02 12:05 . 故障注入脚本
#!/usr/bin/bash
# Copyright (c) 2020. Huawei Technologies Co.,Ltd.ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
####################################
#@Author : Li, Meiting
#@Contact : 244349477@qq.com
#@Date : 2021-05-22
#@License : Mulan PSL v2
#@Version : 1.0
#@Desc : Take the test inject CE timeout
#####################################
function pre_test() {
LOG_INFO "Start to prepare the test environment."
cp /etc/sysconfig/rasdaemon /etc/sysconfig/rasdaemon.bak
sed -i 's/CPU_ISOLATION_ENABLE="no"/CPU_ISOLATION_ENABLE="yes"/g' /etc/sysconfig/rasdaemon
sed -i 's/CPU_CE_THRESHOLD="18"/CPU_CE_THRESHOLD="5"/g' /etc/sysconfig/rasdaemon
sed -i 's/CPU_ISOLATION_CYCLE="24h"/CPU_ISOLATION_CYCLE="2min"/g' /etc/sysconfig/rasdaemon
systemctl restart rasdaemon
cd /
LOG_INFO "End to prepare the test environment."
}
function run_test() {
LOG_INFO "Start to run test."
for i in {1..4}; do
bash RAS_einj_CE.sh 2 CPU l2c 15
done
CHECK_RESULT $? 0 0 "Inject CE for cpu2 failed."
journalctl | tail -n 30 | grep 'error'
CHECK_RESULT $? 0 0 "No log on journalctl."
cat /sys/devices/system/cpu/cpu2/online | grep 1
CHECK_RESULT $? 0 0 "The cpu2 is offline unexpectly."
sleep 130
for i in {1..2}; do
bash RAS_einj_CE.sh 2 CPU l2c 15
done
CHECK_RESULT $? 0 0 "Inject CE for cpu2 failed."
journalctl | tail -n 30 | grep 'error'
CHECK_RESULT $? 0 0 "No log on journalctl."
cat /sys/devices/system/cpu/cpu2/online | grep 1
CHECK_RESULT $? 0 0 "The cpu2 is offline unexpectly."
LOG_INFO "End to run test."
}
function post_test() {
LOG_INFO "Start to restore the test environment."
LOG_INFO "End to restore the test environment."
}
pre_test
run_test
post_test
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/concave-convex-manda/wenjian.git
git@gitee.com:concave-convex-manda/wenjian.git
concave-convex-manda
wenjian
wenjian
master

搜索帮助