Module: tools
Branch: master
Commit: 89ec21a5445fde7d66000371d3b725d0bee8ee42
URL: http://source.winehq.org/git/tools.git/?a=commit;h=89ec21a5445fde7d66000371…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Mar 27 11:13:35 2013 +0100
testbot/VMs: Add a maintenance status for VMs.
This makes it possible to distinguish between broken (offline) VMs,
and VMs the administrator is reconfiguring.
---
testbot/ddl/update22.sql | 4 ++++
testbot/ddl/winetestbot.sql | 2 +-
testbot/lib/WineTestBot/VMs.pm | 10 ++++++++--
testbot/web/Submit.pl | 8 ++++++--
testbot/web/index.pl | 31 +++++++++++++++++++++++--------
5 files changed, 42 insertions(+), 13 deletions(-)
diff --git a/testbot/ddl/update22.sql b/testbot/ddl/update22.sql
new file mode 100644
index 0000000..cd4f5a2
--- /dev/null
+++ b/testbot/ddl/update22.sql
@@ -0,0 +1,4 @@
+USE winetestbot;
+
+ALTER TABLE VMs
+ MODIFY Status ENUM('dirty', 'reverting', 'sleeping', 'idle', 'running', 'offline', 'maintenance') NOT NULL;
diff --git a/testbot/ddl/winetestbot.sql b/testbot/ddl/winetestbot.sql
index 4763d86..4912a59 100644
--- a/testbot/ddl/winetestbot.sql
+++ b/testbot/ddl/winetestbot.sql
@@ -48,7 +48,7 @@ CREATE TABLE VMs
SortOrder INT(3) NOT NULL,
Type ENUM('win32', 'win64', 'build') NOT NULL,
Role ENUM('extra', 'base', 'winetest', 'retired', 'deleted') NOT NULL,
- Status ENUM('dirty', 'reverting', 'sleeping', 'idle', 'running', 'offline') NOT NULL,
+ Status ENUM('dirty', 'reverting', 'sleeping', 'idle', 'running', 'offline', 'maintenance') NOT NULL,
ChildPid INT(5) NULL,
VirtURI VARCHAR(64) NOT NULL,
VirtDomain VARCHAR(32) NOT NULL,
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index 826b0f6..04aeb3c 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -185,6 +185,12 @@ responding anymore), making it temporarily unusable. New jobs can still be
added for this VM but they won't be run until an administrator fixes it.
The main web status page has a warning indicator on when some VMs are offline.
+=item maintenance
+
+A WineTestBot administrator is working on the VM so that it cannot be used for
+the tests. The main web status page has a warning indicator on when some VMs
+are undergoing maintenance.
+
=back
=cut
@@ -572,7 +578,7 @@ BEGIN
CreateBasicPropertyDescriptor("SortOrder", "Display order", !1, 1, "N", 3),
CreateEnumPropertyDescriptor("Type", "Type of VM", !1, 1, ['win32', 'win64', 'build']),
CreateEnumPropertyDescriptor("Role", "VM Role", !1, 1, ['extra', 'base', 'winetest', 'retired', 'deleted']),
- CreateEnumPropertyDescriptor("Status", "Current status", !1, 1, ['dirty', 'reverting', 'sleeping', 'idle', 'running', 'offline']),
+ CreateEnumPropertyDescriptor("Status", "Current status", !1, 1, ['dirty', 'reverting', 'sleeping', 'idle', 'running', 'offline', 'maintenance']),
# Note: ChildPid is only valid when Status == 'reverting' or 'sleeping'.
CreateBasicPropertyDescriptor("ChildPid", "Child process id", !1, !1, "N", 5),
CreateBasicPropertyDescriptor("VirtURI", "LibVirt URI of the VM", !1, 1, "A", 64),
@@ -668,7 +674,7 @@ sub FilterEnabledRole($)
sub FilterEnabledStatus($)
{
my ($self) = @_;
- # Filter out the disabled VMs, that is the offline ones
+ # Filter out the disabled VMs, that is the offline and maintenance ones
$self->AddFilter("Status", ["dirty", "reverting", "sleeping", "idle", "running"]);
}
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 88a27dc..1288bf0 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -83,10 +83,10 @@ sub GetHeaderText
{
my $HeaderText = "Select the VMs on which you want to run your test.";
my $VMs = CreateVMs();
- $VMs->AddFilter("Status", ["offline"]);
+ $VMs->AddFilter("Status", ["offline", "maintenance"]);
if (!$VMs->IsEmpty())
{
- $HeaderText .= "<br>NOTE: Offline VMs will not be able to run your tests right away.";
+ $HeaderText .= "<br>NOTE: Offline VMs and those undergoing maintenance will not be able to run your tests right away.";
}
return $HeaderText;
}
@@ -260,6 +260,10 @@ sub GenerateFields
{
print " [offline]";
}
+ elsif ($VM->Status eq 'maintenance')
+ {
+ print " [maintenance]";
+ }
print "</label><div class='ItemValue'><input type='checkbox' name='$FieldName'";
if ($self->GetParam("Page") == 1 || $self->GetParam($FieldName))
{
diff --git a/testbot/web/index.pl b/testbot/web/index.pl
index 94d8254..1dffaf7 100644
--- a/testbot/web/index.pl
+++ b/testbot/web/index.pl
@@ -234,22 +234,37 @@ sub GenerateBody
}
print "</div>\n";
- print "<div class='GeneralStatusItem'>";
- my $VMs = CreateVMs();
- $VMs->FilterEnabledRole();
- $VMs->AddFilter("Status", ["offline"]);
- if ($VMs->IsEmpty())
+ my $OfflineVMs = CreateVMs();
+ $OfflineVMs->FilterEnabledRole();
+ $OfflineVMs->AddFilter("Status", ["offline"]);
+ my $MaintenanceVMs = CreateVMs();
+ $MaintenanceVMs->FilterEnabledRole();
+ $MaintenanceVMs->AddFilter("Status", ["maintenance"]);
+ if ($OfflineVMs->IsEmpty() and $MaintenanceVMs->IsEmpty())
{
+ print "<div class='GeneralStatusItem'>";
$self->OutputDot("green");
print "<div class='GeneralStatusItemText'><a href='#vms'>All VMs are online</a></div>";
+ print "</div>\n";
}
else
{
- $self->OutputDot("red");
- print "<div class='GeneralStatusItemText'><a href='#vms'>One or more VMs are offline</a></div>";
+ if (!$OfflineVMs->IsEmpty())
+ {
+ print "<div class='GeneralStatusItem'>";
+ $self->OutputDot("red");
+ print "<div class='GeneralStatusItemText'><a href='#vms'>One or more VMs are offline</a></div>";
+ print "</div>\n";
+ }
+ if (!$MaintenanceVMs->IsEmpty())
+ {
+ print "<div class='GeneralStatusItem'>";
+ $self->OutputDot("red");
+ print "<div class='GeneralStatusItemText'><a href='#vms'>One or more VMs are undergoing maintenance</a></div>";
+ print "</div>\n";
+ }
}
print "</div>\n";
- print "</div>\n";
print "<h2><a name='jobs'></a>Jobs</h2>\n";
my $Jobs = CreateJobs();
Module: tools
Branch: master
Commit: e7ea34bd527a38065ddf63f6e3036f1bd09b0cf8
URL: http://source.winehq.org/git/tools.git/?a=commit;h=e7ea34bd527a38065ddf63f6…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Mar 27 11:13:30 2013 +0100
testbot/VMs: Schedule jobs on offline VMs.
Being 'offline' is supposed to be temporary so jobs can still be
scheduled on these VMs (especially the WineTest ones). These jobs will
just be run later, once an administrator has fixed the VM.
---
testbot/bin/CheckForWinetestUpdate.pl | 1 -
testbot/lib/WineTestBot/Jobs.pm | 1 -
testbot/lib/WineTestBot/Patches.pm | 1 -
testbot/lib/WineTestBot/VMs.pm | 8 ++++----
testbot/web/Submit.pl | 11 ++++++-----
5 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index c8909e6..8cbcc9c 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -92,7 +92,6 @@ sub AddJob
$VMs->AddFilter("Type", ["win32", "win64"]);
$VMs->AddFilter("Role", ["winetest"]);
}
- $VMs->FilterEnabledStatus();
foreach my $VMKey (@{$VMs->SortKeysBySortOrder($VMs->GetKeys())})
{
my $Task = $Tasks->Add();
diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index 4b7d425..c6421e9 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -542,7 +542,6 @@ sub ScheduleJobs()
my %Hosts;
my $VMs = CreateVMs();
$VMs->FilterEnabledRole();
- $VMs->FilterEnabledStatus();
foreach my $VM (@{$VMs->GetItems()})
{
my $Host = $VM->GetHost();
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index e8143ca..186398d 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -236,7 +236,6 @@ sub Submit
$VMs = CreateVMs();
$VMs->AddFilter("Type", $Bits eq "32" ? ["win32", "win64"] : ["win64"]);
$VMs->AddFilter("Role", ["base"]);
- $VMs->FilterEnabledStatus();
if (@{$VMs->GetKeys()})
{
# Create the corresponding Step
diff --git a/testbot/lib/WineTestBot/VMs.pm b/testbot/lib/WineTestBot/VMs.pm
index eea9e78..826b0f6 100644
--- a/testbot/lib/WineTestBot/VMs.pm
+++ b/testbot/lib/WineTestBot/VMs.pm
@@ -180,10 +180,10 @@ next step will be to revert it to the idle snapshot so it can be used again.
=item offline
-This VM should not be used. The WineTestBot automatically puts VMs into this
-state if errors happen when manipulating them, such as if they fail to revert,
-etc. The main web status page has a warning indicator on when some VMs are
-offline.
+An error occurred with this VM (typically it failed to revert or is not
+responding anymore), making it temporarily unusable. New jobs can still be
+added for this VM but they won't be run until an administrator fixes it.
+The main web status page has a warning indicator on when some VMs are offline.
=back
diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 56e542d..88a27dc 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -84,10 +84,9 @@ sub GetHeaderText
my $HeaderText = "Select the VMs on which you want to run your test.";
my $VMs = CreateVMs();
$VMs->AddFilter("Status", ["offline"]);
- if (! $VMs->IsEmpty())
+ if (!$VMs->IsEmpty())
{
- $HeaderText .= "<br>NOTE: Some VMs are currently offline and are not " .
- "shown here.";
+ $HeaderText .= "<br>NOTE: Offline VMs will not be able to run your tests right away.";
}
return $HeaderText;
}
@@ -237,8 +236,6 @@ sub GenerateFields
{
$VMs->AddFilter("Type", ["win32", "win64"]);
}
- # Scheduling jobs on offline VMs is not allowed
- $VMs->FilterNotOffline();
if ($self->{ShowAll})
{
# All but the retired and deleted ones
@@ -259,6 +256,10 @@ sub GenerateFields
{
print " (", $self->CGI->escapeHTML($VM->Description), ")";
}
+ if ($VM->Status eq 'offline')
+ {
+ print " [offline]";
+ }
print "</label><div class='ItemValue'><input type='checkbox' name='$FieldName'";
if ($self->GetParam("Page") == 1 || $self->GetParam($FieldName))
{