Module: tools Branch: master Commit: 05e5686eb1ccf95f92de00d93804ae5fdbccb346 URL: https://gitlab.winehq.org/winehq/tools/-/commit/05e5686eb1ccf95f92de00d93804...
Author: Francois Gouget fgouget@codeweavers.com Date: Mon Sep 19 17:26:33 2022 +0200
testbot/LibvirtTool: Disable the Windows time service.
The TestBot already sets the VM's current time before starting a task. But the Windows Time service could still be making small time adjustmenents (including backwards) by small (<1s) amounts while the tests are running, which could cause failures.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53516 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53273
---
testbot/bin/LibvirtTool.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl index d087b358..0c070da6 100755 --- a/testbot/bin/LibvirtTool.pl +++ b/testbot/bin/LibvirtTool.pl @@ -716,6 +716,21 @@ sub CreateSnapshot($$$$) Error("Could not change the Windows boot delay on $VMKey\n"); }
+ # Stop and disable the Windows time service to be sure it won't change + # the time while a test is running. + if (RunAndWait($PTA, ["net.exe", "stop", "w32time"])) + { + Error("Could not stop the $VMKey Windows time service\n"); + } + if (RunAndWait($PTA, ["sc.exe", "config", "w32time", "start=", "disabled"])) + { + Error("Could not disable the $VMKey Windows time service\n"); + } + if (RunAndWait($TA, ["reg.exe", "add", "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters", "/v", "Type", "/t", "REG_SZ", "/d", "NoSync", "/f"])) + { + FatalError("Could not set the $VMKey Windows Time service to NoSync\n"); + } + if ($Config->{tsign}) { # Takes effect after the next reboot