[PATCH] testbot: Always update the VM guest time after a revert.

Francois Gouget fgouget at codeweavers.com
Thu Oct 24 07:12:05 CDT 2019


All VMs support it nowadays and having the current time is important not
only for the tests but also for builds (due to a ccache bug).

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

See also:
https://github.com/ccache/ccache/issues/480


 testbot/bin/LibvirtTool.pl     | 16 ++++++++++++++++
 testbot/bin/WineRunTask.pl     | 13 -------------
 testbot/bin/WineRunWineTest.pl | 13 -------------
 3 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index d5901910c..127c15c5c 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -420,6 +420,22 @@ sub SetupTestAgentd($$$$)
     # A side effect is that it will force TestAgentd.exe.old to stay around.
   }
 
+  # Always update the guest's system time
+  # This is needed not only for the tests (date is important when checking
+  # HTTPS certificates), but also for the build (if the time moves forward
+  # during the build some ccache versions will return a compilation error).
+  if (!$TA->SetTime())
+  {
+    # Not a fatal error. Try the next port in case the VM runs a privileged
+    # TestAgentd daemon there.
+    my $PrivilegedTA = $VM->GetAgent(1);
+    if (!$PrivilegedTA->SetTime())
+    {
+      FatalError("Unable to set the VM system time: ". $PrivilegedTA->GetLastError() ."\n");
+    }
+    $PrivilegedTA->Disconnect();
+  }
+
   if ($Booting and $VM->Type eq "wine")
   {
     # Make sure the X session has had time to start
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index c862ddd81..57535af18 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -433,19 +433,6 @@ my $Mission = $Missions->[0]->{Missions}->[0];
 #
 
 my $TA = $VM->GetAgent();
-Debug(Elapsed($Start), " Setting the time\n");
-if (!$TA->SetTime())
-{
-  # Not a fatal error. Try the next port in case the VM runs a privileged
-  # TestAgentd daemon there.
-  my $PrivilegedTA = $VM->GetAgent("privileged");
-  if (!$PrivilegedTA->SetTime())
-  {
-    LogTaskError("Unable to set the VM system time: ". $PrivilegedTA->GetLastError() .". Maybe the TestAgentd process is missing the required privileges.\n");
-    $PrivilegedTA->Disconnect();
-  }
-}
-
 my $FileName = $Step->FileName;
 Debug(Elapsed($Start), " Sending '". $Step->GetFullFileName() ."'\n");
 if (!$TA->SendFile($Step->GetFullFileName(), $FileName, 0))
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 4b66ee226..f837f9e38 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -432,19 +432,6 @@ $TaskMissions = $Missions->[0];
 # Setup the VM
 #
 my $TA = $VM->GetAgent();
-Debug(Elapsed($Start), " Setting the time\n");
-if (!$TA->SetTime())
-{
-  # Not a fatal error. Try the next port in case the VM runs a privileged
-  # TestAgentd daemon there.
-  my $PrivilegedTA = $VM->GetAgent(1);
-  if (!$PrivilegedTA->SetTime())
-  {
-    LogTaskError("Unable to set the VM system time: ". $PrivilegedTA->GetLastError() .". Maybe the TestAgentd process is missing the required privileges.\n");
-    $PrivilegedTA->Disconnect();
-  }
-}
-
 my $FileName = $Step->FileName;
 if (defined $FileName)
 {
-- 
2.20.1



More information about the wine-devel mailing list