Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
8faeab5e
T
tp-qemu
项目概览
openeuler
/
tp-qemu
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tp-qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8faeab5e
编写于
3月 14, 2014
作者:
L
Lukáš Doktor
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14 from spcui/kdump_with_stress
qemu.tests: Add new test kdump_with_stress
上级
49f2e18a
cda4897e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
156 addition
and
1 deletion
+156
-1
generic/tests/cfg/kdump.cfg
generic/tests/cfg/kdump.cfg
+34
-1
qemu/tests/kdump_with_stress.py
qemu/tests/kdump_with_stress.py
+122
-0
未找到文件。
generic/tests/cfg/kdump.cfg
浏览文件 @
8faeab5e
- kdump: install setup image_copy unattended_install.cdrom
virt_test_type = qemu libvirt
only RHEL.5, RHEL.6
no Windows
no RHEL.3, RHEL.4
type = kdump
# time waited for the completion of crash dump
crash_timeout = 1200
...
...
@@ -15,11 +16,43 @@
# kdump_config = configure line1; config line2
RHEL.5:
kdump_config = core_collector makedumpfile -c -d 31
variants:
- @default:
- nmi:
kernel_param_cmd = "grubby --update-kernel=`grubby --default-kernel` --args='crashkernel=128M nmi_watchdog=1'"
crash_cmd = nmi
variants:
- @basic:
- with_stress:
only one_vm
type = kdump_with_stress
variants:
- netperf_stress:
stress_type = netperf
#netperf server is guest, the netperf client is host
wait_bg_time = 60
run_bgstress = netperf_stress
hostpasswd = redhat
netperf_download_link = ftp://ftp.netperf.org/netperf/netperf-2.6.0.tar.bz2
pkg_md5sum = 9654ffdfd4c4f2c93ce3733cd9ed9236
server_path = /var/tmp/netperf-2.6.0.tar.bz2
client_path = /var/tmp/netperf-2.6.0.tar.bz2
netperf_test_timeout = 360
netperf_para_sessions = 2
test_protocol = TCP_STREAM
check_cmd = "pidof netserver"
- io_stress:
stress_type = io
download_link = http://people.seas.harvard.edu/~apw/stress/stress-1.0.4.tar.gz
pkg_md5sum = 7b0859a66fc14eddb349f2fd19cf023e
tmp_dir = "/var/tmp"
install_cmd = "tar -xzvf ${tmp_dir}/stress-1.0.4.tar.gz -C ./ && cd stress-1.0.4 && ./configure --prefix=/usr && make && make install"
app_check_cmd = "stress --help"
start_cmd = "stress --cpu 4 --io 4 --vm 2 --vm-bytes 256M --quiet &"
check_cmd = "pidof -s stress"
variants:
- one_vm:
- multi_vms:
...
...
qemu/tests/kdump_with_stress.py
0 → 100644
浏览文件 @
8faeab5e
import
logging
from
autotest.client.shared
import
error
from
autotest.client
import
utils
from
virttest
import
utils_test
,
utils_misc
from
generic.tests
import
kdump
@
error
.
context_aware
def
run
(
test
,
params
,
env
):
"""
KVM kdump test with stress:
1) Log into a guest
2) Check, configure and enable the kdump
3) Load stress with netperf/stress tool in guest
4) Trigger a crash by 'sysrq-trigger' and check the vmcore for each vcpu,
or only trigger one crash with nmi interrupt and check vmcore.
:param test: kvm test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
def
install_stress_app
(
session
):
"""
Install stress app in guest.
"""
if
session
.
cmd_status
(
params
.
get
(
"app_check_cmd"
,
"true"
))
==
0
:
logging
.
info
(
"Stress app already installed in guest."
)
return
link
=
params
.
get
(
"download_link"
)
md5sum
=
params
.
get
(
"pkg_md5sum"
)
tmp_dir
=
params
.
get
(
"tmp_dir"
,
"/var/tmp"
)
install_cmd
=
params
.
get
(
"install_cmd"
)
logging
.
info
(
"Fetch package: '%s'"
%
link
)
pkg
=
utils
.
unmap_url_cache
(
test
.
tmpdir
,
link
,
md5sum
)
vm
.
copy_files_to
(
pkg
,
tmp_dir
)
logging
.
info
(
"Install app: '%s' in guest."
%
install_cmd
)
s
,
o
=
session
.
cmd_status_output
(
install_cmd
,
timeout
=
300
)
if
s
!=
0
:
raise
error
.
TestError
(
"Fail to install stress app(%s)"
%
o
)
logging
.
info
(
"Install app successed"
)
def
start_stress
(
session
):
"""
Load stress in guest.
"""
error
.
context
(
"Load stress in guest"
,
logging
.
info
)
stress_type
=
params
.
get
(
"stress_type"
,
"none"
)
if
stress_type
==
"none"
:
return
if
stress_type
==
"netperf"
:
bg
=
""
bg_stress_test
=
params
.
get
(
"run_bgstress"
)
bg
=
utils
.
InterruptedThread
(
utils_test
.
run_virt_sub_test
,
(
test
,
params
,
env
),
{
"sub_type"
:
bg_stress_test
})
bg
.
start
()
if
stress_type
==
"io"
:
install_stress_app
(
session
)
cmd
=
params
.
get
(
"start_cmd"
)
logging
.
info
(
"Launch stress app in guest with command: '%s'"
%
cmd
)
session
.
sendline
(
cmd
)
running
=
utils_misc
.
wait_for
(
lambda
:
stress_running
(
session
),
timeout
=
150
,
step
=
5
)
if
not
running
:
raise
error
.
TestError
(
"Stress isn't running"
)
logging
.
info
(
"Stress running now"
)
def
stress_running
(
session
):
"""
Check stress app really run in background.
"""
cmd
=
params
.
get
(
"check_cmd"
)
status
=
session
.
cmd_status
(
cmd
,
timeout
=
120
)
return
status
==
0
vm
=
env
.
get_vm
(
params
[
"main_vm"
])
vm
.
verify_alive
()
timeout
=
float
(
params
.
get
(
"login_timeout"
,
240
))
crash_timeout
=
float
(
params
.
get
(
"crash_timeout"
,
360
))
def_kernel_param_cmd
=
(
"grubby --update-kernel=`grubby --default-kernel`"
" --args=crashkernel=128M@16M"
)
kernel_param_cmd
=
params
.
get
(
"kernel_param_cmd"
,
def_kernel_param_cmd
)
def_kdump_enable_cmd
=
"chkconfig kdump on && service kdump restart"
kdump_enable_cmd
=
params
.
get
(
"kdump_enable_cmd"
,
def_kdump_enable_cmd
)
def_crash_kernel_prob_cmd
=
"grep -q 1 /sys/kernel/kexec_crash_loaded"
crash_kernel_prob_cmd
=
params
.
get
(
"crash_kernel_prob_cmd"
,
def_crash_kernel_prob_cmd
)
session
=
kdump
.
kdump_enable
(
vm
,
vm
.
name
,
crash_kernel_prob_cmd
,
kernel_param_cmd
,
kdump_enable_cmd
,
timeout
)
try
:
start_stress
(
session
)
error
.
context
(
"Kdump Testing, force the Linux kernel to crash"
,
logging
.
info
)
crash_cmd
=
params
.
get
(
"crash_cmd"
,
"echo c > /proc/sysrq-trigger"
)
if
crash_cmd
==
"nmi"
:
kdump
.
crash_test
(
vm
,
None
,
crash_cmd
,
timeout
)
else
:
# trigger crash for each vcpu
nvcpu
=
int
(
params
.
get
(
"smp"
,
1
))
for
i
in
range
(
nvcpu
):
kdump
.
crash_test
(
vm
,
i
,
crash_cmd
,
timeout
)
kdump
.
check_vmcore
(
vm
,
session
,
crash_timeout
)
finally
:
session
.
close
()
vm
.
destroy
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录