]> xenbits.xensource.com Git - osstest.git/commitdiff
osstest migrate support check catch -> variables
authorIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 16 Dec 2014 12:12:44 +0000 (12:12 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 30 Jul 2015 14:22:13 +0000 (15:22 +0100)
The goal here is to skip the following test steps if the check fails.

Instead of using catch to turn an exception into value, we can just
use spawn-ts and reap-ts to do that. This pattern is useful when we add
in extra check for save / restore check later.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ wei: write commit message ]
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
sg-run-job

index bba52eddd17a0c4f5dbdfa8a2bdca493a92c10be..d77744fa8ac7e4e45e93fb258e4ec51950385f2c 100755 (executable)
@@ -311,7 +311,9 @@ proc run-job/test-pair {} {
 }
 
 proc test-guest-migr {g} {
-    if {[catch { run-ts . = ts-migrate-support-check + host $g }]} return
+    set to_reap [spawn-ts . = ts-migrate-support-check + host $g]
+    set can_migrate [reap-ts $to_reap]
+    if {!$can_migrate} return
 
     foreach iteration {{} .2} {
         run-ts . =$iteration ts-guest-saverestore + host $g