GetVersion() is equivalent to Ping() but can be used to perform version
checks.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/LibvirtTool.pl | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index 46354439a..dd330a5ab 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -365,6 +365,23 @@ sub CheckOff()
return ChangeStatus("…
[View More]dirty", "off", "done");
}
+sub SetupTestAgentd($$)
+{
+ my ($VM, $Booting) = @_;
+
+ Debug(Elapsed($Start), " Setting up the $VMKey TestAgent server\n");
+ LogMsg "Setting up the $VMKey TestAgent server\n";
+ my $TA = $VM->GetAgent();
+ $TA->SetConnectTimeout(undef, undef, $WaitForBoot) if ($Booting);
+ my $Version = $TA->GetVersion();
+ if (!$Version)
+ {
+ my $ErrMessage = $TA->GetLastError();
+ FatalError("Could not connect to the $VMKey TestAgent: $ErrMessage\n");
+ }
+ $TA->Disconnect();
+}
+
sub Revert()
{
my $VM = CreateVMs()->GetItem($VMKey);
@@ -402,18 +419,8 @@ sub Revert()
# The VM is now sleeping which may allow some tasks to run
return 1 if (ChangeStatus("reverting", "sleeping"));
- # Verify that the TestAgent server accepts connections
- Debug(Elapsed($Start), " Verifying the TestAgent server\n");
- LogMsg "Verifying the $VMKey TestAgent server\n";
- my $TA = $VM->GetAgent();
- $TA->SetConnectTimeout(undef, undef, $WaitForBoot) if ($Booting);
- my $Success = $TA->Ping();
- $TA->Disconnect();
- if (!$Success)
- {
- $ErrMessage = $TA->GetLastError();
- FatalError("Cannot connect to the $VMKey TestAgent: $ErrMessage\n");
- }
+ # Set up the TestAgent server
+ SetupTestAgentd($VM, $Booting);
if ($SleepAfterRevert != 0)
{
--
2.20.1
[View Less]
On Windows the second server will keep the old executable busy,
preventing its deletion. So give up after a while.
Usually the second server will be running with --set-time-only so
upgrading it is not as important.
If necessary this condition can be detected on the client by
attempting to delete the old executable and checking for an error.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
Note: Patch 2 only depends on this one because this fix is mentionned in
the …
[View More]comment describing version 1.8.
testbot/src/testagentd/platform_windows.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/testbot/src/testagentd/platform_windows.c b/testbot/src/testagentd/platform_windows.c
index bb52a0241..0ba7d2cdf 100644
--- a/testbot/src/testagentd/platform_windows.c
+++ b/testbot/src/testagentd/platform_windows.c
@@ -532,17 +532,20 @@ int platform_init(void)
{
/* This also serves to ensure the old server has released the port
* before we attempt to open our own.
+ * But if a second server is running the deletion will never work so
+ * give up after a while.
*/
+ int attempt = 0;
do
{
if (!DeleteFileA(oldtestagentd))
Sleep(500);
+ attempt++;
}
- while (GetLastError() == ERROR_ACCESS_DENIED);
+ while (GetLastError() == ERROR_ACCESS_DENIED && attempt < 20);
free(oldtestagentd);
}
-
wVersionRequested = MAKEWORD(2, 2);
rc = WSAStartup(wVersionRequested, &wsaData);
if (rc)
--
2.20.1
[View Less]
It's possible that the connection to the hypervisor was lost right when
the snapshot was being recreated. The TestBot may also be able to
recreate the snapshot from the powered off base snapshot. But such
failures are rare enough to warrant an investigation.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunReconfig.pl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index f00a963a9..…
[View More]5e60e9097 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -513,6 +513,11 @@ if ($NewStatus eq 'completed')
# Without the snapshot the VM is not usable anymore but FatalError() will
# just mark it as 'dirty'. It's only the next time it is used that the
# problem will be noticed and that it will be taken offline.
+ NotifyAdministrator("The ". $VM->Name ." update failed",
+ "Could not recreate the $IdleSnapshot snapshot:\n\n".
+ "$ErrMessage\n\n".
+ "See the link below for more details:\n".
+ MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n");
FatalError("Could not recreate the $IdleSnapshot snapshot: $ErrMessage\n");
}
--
2.20.1
[View Less]
Build failures prevent the TestBot snapshot from being updated
(leading to an out-of-date Wine and patches that fail to apply)
and can typically only be fixed manually.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunReconfig.pl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 5e60e9097..ccab25195 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
…
[View More]@@ -438,6 +438,11 @@ if ($TA->GetFile("Reconfig.log", "$TaskDir/log"))
{
# We should not have badpatch errors and if the result line is missing we
# probably already have an error message that explains why.
+ NotifyAdministrator("The ". $VM->Name ." build failed",
+ "The ". $VM->Name ." build failed:\n\n".
+ "$Summary->{Task}\n\n".
+ "See the link below for more details:\n".
+ MakeSecureURL(GetTaskURL($JobId, $StepNo, $TaskNo)) ."\n");
$NewStatus = "badbuild";
}
}
--
2.20.1
[View Less]