提交 c0eaea97 编写于 作者: Y Yunping Zheng 提交者: Lucas Meneghel Rodrigues

virt.qemu.test.systemtap_tracing : make the test more robust

This patch make the systemtap_tracing test more robust.
Signed-off-by: NYunping Zheng <yunzheng@redhat.com>
上级 ca101e2d
......@@ -11,6 +11,7 @@
# cmds_exec = ls /root, monitor:info status; stop, ls;ls
type = systemtap_tracing
profilers = systemtap
kill_vm = yes
variants:
- balloon_event:
extra_params = -device virtio-balloon-pci,id=ballooning
......@@ -36,9 +37,10 @@
probe_var_key = bs sector_num nb_sectors opaque
stap_script_file = bdrv_aio_writev.stp
- bdrv_lock_medium:
start_vm = no
probe_var_key = bs locked
stap_script_file = bdrv_lock_medium.stp
cdrom_cd1 = isos/linux/RHEL3.9-i386-DVD.iso
boot_with_cdrom = yes
- @cpu:
variants:
- cpu_get_apic_base:
......@@ -68,7 +70,8 @@
probe_var_key = size
stap_script_file = qemu_vmalloc.stp
- @virtio_scsi:
cdrom_cd1 = isos/linux/RHEL3.9-i386-DVD.iso
start_vm = no
boot_with_cdrom = yes
cd_format = scsi-cd
variants:
- scsi_req_alloc:
......@@ -185,12 +188,12 @@
index_enable = yes
probe_var_key = bus port
stap_script_file = usb_port_release.stp
cmds_exec = "monitor:device_del id=usb-disk1"
cmds_exec = "monitor:device_del id=stg"
- usb_port_detach:
index_enable = yes
probe_var_key = bus port
stap_script_file = usb_port_detach.stp
cmds_exec = "monitor:device_del id=usb-disk1"
cmds_exec = "monitor:device_del id=stg"
- @set:
variants:
......
......@@ -2,8 +2,9 @@ import logging
import re
import os
import time
from autotest.client import utils
from autotest.client.shared import error
from virttest import utils_misc, env_process
from virttest import utils_misc, env_process, data_dir
@error.context_aware
......@@ -21,8 +22,8 @@ def run_systemtap_tracing(test, params, env):
def create_patterns_reg(trace_key):
"""
create a regular exp using the tracing key, the purpose is checking
the systemtap output is accord with expected.
Create a regular exp using the tracing key, the purpose is checking
the systemtap output is accord with expected.
"""
pattern_reg = ""
for tracing_key in trace_key.split():
......@@ -41,8 +42,19 @@ def run_systemtap_tracing(test, params, env):
if params.get("extra_params"):
params["extra_params"] = params.get("extra_params")
env_process.preprocess_vm(test, params, env, params.get("main_vm"))
if params.get("boot_with_cdrom") == 'yes':
iso_path = "%s/test.iso" % data_dir.get_tmp_dir()
create_cmd = "dd if=/dev/zero of=%s bs=1M count=10" % iso_path
if utils.system(create_cmd, ignore_status=True) != 0:
raise error.TestNAError("Create test iso failed")
params["cdrom_cd1"] = iso_path
if params.get("start_vm", "yes") == "no":
params["start_vm"] = "yes"
env_process.preprocess_vm(test, params, env, params.get("main_vm"))
vm = env.get_vm(params["main_vm"])
vm.verify_alive()
if params.get("cmds_exec"):
for cmd in params.get("cmds_exec").split(","):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册