From 5485fe6f1853aed72c95b9f3fe51cff59e0b279f Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 8 Apr 2013 10:41:55 +0200 Subject: [PATCH] run: add support to query qemu support To be used by the base-* specific run/env scripts to choose the appropriate test backend. --- tool/run | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/tool/run b/tool/run index e863ce1f37..5476637eae 100755 --- a/tool/run +++ b/tool/run @@ -418,9 +418,7 @@ proc spawn_qemu { wait_for_re timeout_value } { # # Back out on platforms w/o Qemu support # - if {[have_spec platform_panda] || [have_spec platform_arndale]} { - puts stderr "skipping execution because platform is not supported by qemu" - return 0 } + if {![is_qemu_available]} { return 0 } if {[have_spec x86_32]} { set qemu "qemu-system-i386" } if {[have_spec x86_64]} { set qemu "qemu-system-x86_64" } @@ -470,6 +468,16 @@ proc spawn_qemu { wait_for_re timeout_value } { set output $expect_out(buffer) } +## +# Check whether Qemu support is available +# +proc is_qemu_available { } { + if {[have_spec platform_panda] || [have_spec platform_arndale]} { + puts stderr "skipping execution because platform is not supported by qemu" + return false + } + return true +} ## # Check whether AMT support is available @@ -481,19 +489,20 @@ proc is_amt_available { } { [info exists ::env(AMT_TEST_MACHINE_PWD)] && [have_installed amtterm] && [have_installed amttool]} { - return true; + return true } puts "No support for Intel's AMT detected." - return false; + return false } ## # Execute scenario using Intel's AMT # -proc spawn_amt { wait_for_re timeout_value } { - if {![is_amt_available]} { - return } +proc spawn_amt { wait_for_re timeout_value} { + global spawn_id + + if {![is_amt_available]} { return 0 } # # amttool expects in the environment variable AMT_PASSWORD the password