提交 d6cf9179 编写于 作者: J Jonas Eriksson

pipetest application: Avoid building if available

Tested by running: ipi_x2apic
Signed-off-by: NJonas Eriksson <jonas.eriksson@enea.com>
上级 c11ed208
......@@ -4,6 +4,7 @@
type = ipi_x2apic
vms = ""
check_x2apic_cmd = dmesg |grep x2apic
run_pipetest_cmd = "cd /tmp/ && gcc -o pipetest pipetest.c && ./pipetest && cd"
pipetest_cmd = "/tmp/pipetest"
build_pipetest_cmd = "cd /tmp/ && gcc -o pipetest pipetest.c"
x2apic_check_string = Enabling x2apic, Enabled x2apic, Setting APIC routing to physical x2apic
pre_command += " grep 'flags' /proc/cpuinfo|grep 'ept' && modprobe -r kvm_intel && modprobe kvm_intel ept=1 || echo ok;"
......@@ -61,12 +61,17 @@ def run(test, params, env):
msg = "%s is not displayed in output" % check_string
raise error.TestFail(msg)
file_link = os.path.join(test.virtdir, "scripts/pipetest.c")
vm.copy_files_to(file_link, "/tmp/pipetest.c")
run_pipetest_cmd = params.get("run_pipetest_cmd")
pipetest_cmd = params.get("pipetest_cmd")
if session.get_command_status("test -x %s" % pipetest_cmd):
file_link = os.path.join(test.virtdir, "scripts/pipetest.c")
vm.copy_files_to(file_link, "/tmp/pipetest.c")
build_pipetest_cmd = params.get("build_pipetest_cmd")
error.context("Build pipetest script in guest.", logging.info)
session.cmd(build_pipetest_cmd, timeout=180)
error.context("Run pipetest script in guest.", logging.info)
try:
o = session.cmd(run_pipetest_cmd, timeout=180)
o = session.cmd(pipetest_cmd, timeout=180)
except aexpect.ShellTimeoutError, e:
o = e
re_str = params.get("usec_re_str", "[0-9]*\.[0-9]+")
......@@ -88,7 +93,7 @@ def run(test, params, env):
error.context("Run pipetest script in guest again.", logging.info)
try:
o = session.cmd(run_pipetest_cmd, timeout=180)
o = session.cmd(pipetest_cmd, timeout=180)
except aexpect.ShellTimeoutError, e:
o = e
val2 = get_re_average(o, re_str)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册