Module: tools
Branch: master
Commit: ff8bceb9dd42c957ebb35800aa539530995856f1
URL: https://source.winehq.org/git/tools.git/?a=commit;h=ff8bceb9dd42c957ebb3580…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Dec 2 13:53:34 2019 +0100
testbot/LibvirtTool: Only check the start count after a reboot.
The start count check is not related to taking live snapshots.
And we can skip it if the VM was not freshly booted.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/bin/LibvirtTool.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/LibvirtTool.pl b/testbot/bin/LibvirtTool.pl
index bc45533..faac0b3 100755
--- a/testbot/bin/LibvirtTool.pl
+++ b/testbot/bin/LibvirtTool.pl
@@ -460,14 +460,14 @@ sub SetupTestAgentd($$$$)
# So it all works out.
$TA->SetProperty("start.count", 0);
}
- else
+ elsif ($Booting)
{
# Check that TestAgentd is not displaying the "Has Windows rebooted?"
# warning.
my $Count = $TA->GetProperties("start.count");
if (defined $Count and $Count > 1)
{
- FatalError("Cannot take a live snapshot because start.count=$Count > 1");
+ FatalError("The VM has been rebooted too many times: start.count=$Count > 1");
}
}
$TA->Disconnect();
Module: tools
Branch: master
Commit: 77c97d74279b208bf05d2da7453d4defbe2464fb
URL: https://source.winehq.org/git/tools.git/?a=commit;h=77c97d74279b208bf05d2da…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Mon Dec 2 13:51:16 2019 +0100
testbot: Fix the VM Missions validation.
$Item->Xxx("foo") does not go through PutColValue()!
Instead AUTOLOAD sets the specified property directly, maybe fori
performance reasons, and PutColValue() is only used by DBIBackend.pm.
WineTestBot::VMs was overriding PutColValue() to only revalidate a VM's
missions field if either the VM Type of Missions field were modified.
But instead ValidateMissions was always true after loading a VM from the
database (because of the PutColValue() calls), and not when creating a
new VM (in which case all the properties are set through AUTOLOAD).
So take a snapshot of the initial Type and Missions values when the
database code resets the IsModified field by calling ResetModified();
and then revalidate them whenever they have changed.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
testbot/lib/WineTestBot/VMs.pm | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index 37ebf9a..279b7bc 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -304,15 +304,13 @@ sub KillChild($)
$self->ChildPid(undef);
}
-sub PutColValue($$$)
+sub ResetModified($)
{
- my ($self, $ColName, $Value) = @_;
+ my ($self) = @_;
- $self->SUPER::PutColValue($ColName, $Value);
- if ($self->{IsModified} and ($ColName eq "Type" or $ColName eq "Missions"))
- {
- $self->{ValidateMissions} = 1;
- }
+ $self->SUPER::ResetModified();
+ $self->{OldType} = $self->Type;
+ $self->{OldMissions} = $self->Missions;
}
my $_SupportedMissions = {
@@ -331,7 +329,8 @@ sub Validate($)
{
return ("Role", "Only win32, win64 and wine VMs can have a role of '" . $self->Role . "'");
}
- if ($self->{ValidateMissions})
+ if ($self->ValuesDiffer($self->{OldType}, $self->Type) or
+ $self->ValuesDiffer($self->{OldMissions}, $self->Missions))
{
my ($ErrMessage, $Missions) = ParseMissionStatement($self->Missions);
return ("Missions", $ErrMessage) if (defined $ErrMessage);
@@ -350,7 +349,8 @@ sub Validate($)
}
}
}
- delete $self->{ValidateMissions};
+ $self->{OldType} = $self->Type;
+ $self->{OldMissions} = $self->Missions;
}
return $self->SUPER::Validate();