[2/5] testbot/VMs: Remove some redundant VM log messages.
Francois Gouget
fgouget at codeweavers.com
Wed Oct 24 05:15:33 CDT 2012
The general principle is that traces should be generated by the tools, not by the Perl modules.
---
testbot/bin/Engine.pl | 2 +-
testbot/bin/RevertVM.pl | 7 ++++---
testbot/lib/WineTestBot/VMs.pm | 4 ----
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/testbot/bin/Engine.pl b/testbot/bin/Engine.pl
index d504a50..f453927 100755
--- a/testbot/bin/Engine.pl
+++ b/testbot/bin/Engine.pl
@@ -433,7 +433,7 @@ sub HandleGetScreenshot
my ($ErrMessage, $ImageSize, $ImageBytes) = $VM->CaptureScreenImage();
if (defined($ErrMessage))
{
- LogMsg "Screenshot failed: $ErrMessage\n";
+ LogMsg "Failed to take screenshot of $VMName: $ErrMessage\n";
return "0$ErrMessage";
}
diff --git a/testbot/bin/RevertVM.pl b/testbot/bin/RevertVM.pl
index d7b262e..fbf479f 100755
--- a/testbot/bin/RevertVM.pl
+++ b/testbot/bin/RevertVM.pl
@@ -71,8 +71,6 @@ if (! $VMKey)
die "Usage: RevertVM.pl VMName";
}
-LogMsg "Revert of $VMKey started\n";
-
my $VMs = CreateVMs();
my $VM = $VMs->GetItem($VMKey);
if (! defined($VM))
@@ -80,6 +78,7 @@ if (! defined($VM))
FatalError "VM $VMKey doesn't exist";
}
+LogMsg "Reverting $VMKey to ", $VM->IdleSnapshot, "\n";
$VM->Status("reverting");
my ($ErrProperty, $ErrMessage) = $VM->Save();
if (defined($ErrMessage))
@@ -103,7 +102,8 @@ if (defined($ErrMessage))
foreach my $WaitCount (1..3)
{
- $ErrMessage = $VM->WaitForToolsInGuest();
+ LogMsg "Waiting for ", $VM->Name, " (up to ${WaitForToolsInVM}s)\n";
+ $ErrMessage = $VM->WaitForToolsInGuest($WaitForToolsInVM);
if (! defined($ErrMessage))
{
last;
@@ -116,6 +116,7 @@ if (defined($ErrMessage))
if ($SleepAfterRevert != 0)
{
+ LogMsg "Letting ", $VM->Name, " settle for ${SleepAfterRevert}s\n";
sleep($SleepAfterRevert);
}
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index 2b4786e..6dc8b8a 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -195,7 +195,6 @@ use WineTestBot::Config;
use WineTestBot::Engine::Notify;
use WineTestBot::TestAgent;
use WineTestBot::WineTestBotObjects;
-use WineTestBot::Log;
use vars qw (@ISA @EXPORT);
@@ -284,7 +283,6 @@ sub _GetSnapshot($$)
sub RevertToSnapshot($$)
{
my ($self, $SnapshotName) = @_;
- LogMsg("Reverting ", $self->VirtDomain, " to $SnapshotName\n");
my ($ErrMessage, $Domain, $Snapshot) = $self->_GetSnapshot($SnapshotName);
return $ErrMessage if (defined $ErrMessage);
@@ -351,7 +349,6 @@ sub WaitForToolsInGuest($;$)
my ($self, $Timeout) = @_;
$Timeout ||= $WaitForToolsInVM;
- LogMsg("Waiting for ", $self->Name, " (up to ${Timeout}s)\n");
my ($Status, $Err) = TestAgent::GetStatus($self->Hostname, $Timeout);
# In fact we don't care about the status
return $Err;
@@ -389,7 +386,6 @@ sub _Stream2Image($$$)
sub CaptureScreenImage($)
{
my ($self) = @_;
- LogMsg("CaptureScreenImage ", $self->Name, "\n");
my ($ErrMessage, $Domain) = $self->_GetDomain();
return ($ErrMessage, undef, undef) if (defined $ErrMessage);
--
1.7.10.4
More information about the wine-patches
mailing list