Francois Gouget : testbot/WineRun*: Improve the VM and Step validation.

Alexandre Julliard julliard at winehq.org
Mon Jun 25 12:08:35 CDT 2018


Module: tools
Branch: master
Commit: bd10370745d91302ef7c4af283e2f09df62a446b
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=bd10370745d91302ef7c4af283e2f09df62a446b

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Jun 21 15:00:30 2018 +0200

testbot/WineRun*: Improve the VM and Step validation.

Check that the VM is of the expected type. Also the VM should always be
powered on (for powered off snapshots LibvirtTool.pl is responsible for
powering on the VM), even when debugging.
Move the Step validation next to the VM one.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/bin/WineRunBuild.pl    | 15 ++++++++++++---
 testbot/bin/WineRunReconfig.pl | 15 ++++++++++++---
 testbot/bin/WineRunTask.pl     | 24 ++++++++++++++----------
 3 files changed, 38 insertions(+), 16 deletions(-)

diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 60af32c..ff04ded 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -309,18 +309,27 @@ sub FatalTAError($$)
 
 
 #
-# Check the VM
+# Check the VM and Step
 #
 
-if (!$Debug and $VM->Status ne "running")
+if ($VM->Type ne "build")
+{
+  FatalError("This is not a build VM! (" . $VM->Type . ")\n");
+}
+elsif (!$Debug and $VM->Status ne "running")
 {
   FatalError("The VM is not ready for use (" . $VM->Status . ")\n");
 }
-elsif ($Debug and !$VM->GetDomain()->IsPoweredOn())
+elsif (!$VM->GetDomain()->IsPoweredOn())
 {
   FatalError("The VM is not powered on\n");
 }
 
+if ($Step->FileType ne "patchdlls")
+{
+  FatalError("Unexpected file type '". $Step->FileType ."' found\n");
+}
+
 
 #
 # Figure out what to build
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 2e338c9..23b038a 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -309,18 +309,27 @@ sub FatalTAError($$)
 
 
 #
-# Check the VM
+# Check the VM and Step
 #
 
-if (!$Debug and $VM->Status ne "running")
+if ($VM->Type ne "build")
+{
+  FatalError("This is not a build VM! (" . $VM->Type . ")\n");
+}
+elsif (!$Debug and $VM->Status ne "running")
 {
   FatalError("The VM is not ready for use (" . $VM->Status . ")\n");
 }
-elsif ($Debug and !$VM->GetDomain()->IsPoweredOn())
+elsif (!$VM->GetDomain()->IsPoweredOn())
 {
   FatalError("The VM is not powered on\n");
 }
 
+if ($Step->FileType ne "none")
+{
+  FatalError("Unexpected file type '". $Step->FileType ."' found\n");
+}
+
 
 #
 # Run the build
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 37c63b4..ff8aab9 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -364,18 +364,27 @@ sub FatalTAError($$;$)
 
 
 #
-# Check the VM
+# Check the VM and Step
 #
 
-if (!$Debug and $VM->Status ne "running")
+if ($VM->Type ne "win32" and $VM->Type ne "win64")
+{
+  FatalError("This is not a Windows VM! (" . $VM->Type . ")\n");
+}
+elsif (!$Debug and $VM->Status ne "running")
 {
   FatalError("The VM is not ready for use (" . $VM->Status . ")\n");
 }
-elsif ($Debug and !$VM->GetDomain()->IsPoweredOn())
+elsif (!$VM->GetDomain()->IsPoweredOn())
 {
   FatalError("The VM is not powered on\n");
 }
 
+if ($Step->FileType ne "exe32" and $Step->FileType ne "exe64")
+{
+  FatalError("Unexpected file type '". $Step->FileType ."' found\n");
+}
+
 
 #
 # Setup the VM
@@ -395,11 +404,6 @@ if (!$TA->SetTime())
   }
 }
 
-my $FileType = $Step->FileType;
-if ($FileType ne "exe32" && $FileType ne "exe64")
-{
-  FatalError("Unexpected file type $FileType found\n");
-}
 my $FileName = $Step->FileName;
 Debug(Elapsed($Start), " Sending '". $Step->GetFullFileName() ."'\n");
 if (!$TA->SendFile($Step->GetFullFileName(), $FileName, 0))
@@ -418,7 +422,7 @@ if ($Step->ReportSuccessfulTests)
 my $IsWineTest = 1;
 if ($Step->Type eq "single")
 {
-  my $TestLauncher = "TestLauncher" . ($FileType eq "exe64" ? "64" : "32") . ".exe";
+  my $TestLauncher = "TestLauncher" . ($Step->FileType eq "exe64" ? "64" : "32") . ".exe";
   Debug(Elapsed($Start), " Sending 'latest/$TestLauncher'\n");
   if (!$TA->SendFile("$DataDir/latest/$TestLauncher", $TestLauncher, 0))
   {
@@ -450,7 +454,7 @@ elsif ($Step->Type eq "suite")
   $Tag =~ s/[^a-zA-Z0-9]/-/g;
   if ($VM->Type eq "win64")
   {
-    $Tag .= "-" . ($FileType eq "exe64" ? "64" : "32");
+    $Tag .= "-" . ($Step->FileType eq "exe64" ? "64" : "32");
   }
   if (defined($WebHostName))
   {




More information about the wine-cvs mailing list