Module: tools
Branch: master
Commit: aae43a05737a693f784c8a719b6084b44c5411fc
URL: http://source.winehq.org/git/tools.git/?a=commit;h=aae43a05737a693f784c8a71…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Mar 13 16:52:30 2013 +0100
testbot: Tighten handling of the VM status in the task scripts.
---
testbot/bin/WineRunBuild.pl | 15 +++++++++++++--
testbot/bin/WineRunReconfig.pl | 17 ++++++++++++++---
testbot/bin/WineRunTask.pl | 15 ++++++++++-----
3 files changed, 37 insertions(+), 10 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 236d3d0..3f5b592 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -61,8 +61,11 @@ sub FatalError($$$$)
$Job->UpdateStatus();
my $VM = $Task->VM;
- $VM->Status('dirty');
- $VM->Save();
+ if ($VM->Status eq 'running')
+ {
+ $VM->Status('dirty');
+ $VM->Save();
+ }
TaskComplete($JobKey, $StepKey, $TaskKey);
exit 1;
@@ -217,6 +220,13 @@ if (! defined($BaseName))
FatalError "Can't determine base name\n", $FullErrFileName, $Job, $Task;
}
+# Normally the Engine has already set the VM status to 'running'.
+# Do it anyway in case we're called manually from the command line.
+if ($VM->Status ne "idle" and $VM->Status ne "running")
+{
+ FatalError "The VM is not ready for use (" . $VM->Status . ")\n",
+ $FullErrFileName, $Job, $Task;
+}
$VM->Status('running');
my ($ErrProperty, $ErrMessage) = $VM->Save();
if (defined($ErrMessage))
@@ -224,6 +234,7 @@ if (defined($ErrMessage))
FatalError "Can't set VM status to running: $ErrMessage\n",
$FullErrFileName, $Job, $Task;
}
+
my $FileName = $Step->FileName;
if (!$TA->SendFile("$StepDir/$FileName", "staging/$FileName", 0))
{
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 7588045..0333705 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -61,8 +61,11 @@ sub FatalError($$$$)
$Job->UpdateStatus();
my $VM = $Task->VM;
- $VM->Status('dirty');
- $VM->Save();
+ if ($VM->Status eq 'running')
+ {
+ $VM->Status('dirty');
+ $VM->Save();
+ }
TaskComplete($JobKey, $StepKey, $TaskKey);
exit 1;
@@ -190,13 +193,21 @@ my $FullRawlogFileName = "$TaskDir/rawlog";
my $FullLogFileName = "$TaskDir/log";
my $FullErrFileName = "$TaskDir/err";
+# Normally the Engine has already set the VM status to 'running'.
+# Do it anyway in case we're called manually from the command line.
+if ($VM->Status ne "idle" and $VM->Status ne "running")
+{
+ FatalError "The VM is not ready for use (" . $VM->Status . ")\n",
+ $FullErrFileName, $Job, $Task;
+}
$VM->Status('running');
my ($ErrProperty, $ErrMessage) = $VM->Save();
-if (defined($ErrMessage))
+if (defined $ErrMessage)
{
FatalError "Can't set VM status to running: $ErrMessage\n",
$FullErrFileName, $Job, $Task;
}
+
my $Script = "#!/bin/sh\n" .
"rm -f Reconfig.log\n" .
"../bin/build/Reconfig.pl >>Reconfig.log 2>&1\n";
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index ffbb421..abb92e0 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -204,9 +204,16 @@ my $FullLogFileName = "$TaskDir/log";
my $FullErrFileName = "$TaskDir/err";
my $FullScreenshotFileName = "$TaskDir/screenshot.png";
+# Normally the Engine has already set the VM status to 'running'.
+# Do it anyway in case we're called manually from the command line.
+if ($VM->Status ne "idle" and $VM->Status ne "running")
+{
+ FatalError "The VM is not ready for use (" . $VM->Status . ")\n",
+ $FullErrFileName, $Job, $Step, $Task;
+}
$VM->Status('running');
my ($ErrProperty, $ErrMessage) = $VM->Save();
-if (defined($ErrMessage))
+if (defined $ErrMessage)
{
FatalError "Can't set VM status to running: $ErrMessage\n",
$FullErrFileName, $Job, $Step, $Task;
@@ -349,10 +356,8 @@ if (!defined $TestFailures)
$Task->TestFailures($TestFailures);
$Task->Save();
$Job->UpdateStatus();
-if ($Task->VM->Role ne "base")
-{
- $Task->VM->PowerOff();
-}
+
+$VM->PowerOff() if ($VM->Role ne "base");
$VM->Status('dirty');
$VM->Save();
Module: tools
Branch: master
Commit: eb909209aa2686f6fd5ba093e39fbb11b9ce35d6
URL: http://source.winehq.org/git/tools.git/?a=commit;h=eb909209aa2686f6fd5ba093…
Author: Francois Gouget <fgouget(a)codeweavers.com>
Date: Wed Mar 13 16:37:38 2013 +0100
testbot: Document the user account management procedures.
---
testbot/README | 25 +++++++++++++++++++++++++
testbot/doc/INSTALL.txt | 3 +++
2 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/testbot/README b/testbot/README
index 4f4cbc9..f15f82a 100644
--- a/testbot/README
+++ b/testbot/README
@@ -68,3 +68,28 @@ WineTestBot:
---------------
See the doc/INSTALL.txt file.
+
+
+5. USER ACCOUNT MANAGEMENT
+--------------------------
+
+When a user asks for an account, a provisional account is created immediately
+but has to be 'activated' before it can be used. Also an email is sent to the
+WineTestBot administrators.
+
+If the request is considered to be illegitimate / spam, the administrator
+should directly delete the provisional account. Otherwise the account should
+be approved.
+
+Approving the account will generate a 'password reset code' and send an email
+to the user with a URL to visit to set the account password. That will activate
+the account and make it usable.
+
+
+Notes:
+* Existing accounts can be suspended by unchecking the 'active' field. This
+ prevents the user from logging in and changing the password.
+* Only accounts that have the 'wine-devel' role can submit jobs. So
+ administrators who also want to submit jobs should add it to their account
+ (see the doc/INSTALL.txt file).
+* FIXME: Document how the LDAP integration works.
diff --git a/testbot/doc/INSTALL.txt b/testbot/doc/INSTALL.txt
index 4c14668..a5655ec 100644
--- a/testbot/doc/INSTALL.txt
+++ b/testbot/doc/INSTALL.txt
@@ -58,6 +58,9 @@ General setup for the web site:
the resetcode you just updated and a new password.
- Make yourself admin by adding a row to UserRoles:
mysql> insert into UserRoles values('<username>', 'admin');
+- If you want to be able to submit jobs from the same account you will likely
+ need to also give it the 'wine-devel' role:
+ mysql> insert into UserRoles values('<username>', wine-devel);
- When you refresh the home page, you should now have an "Admin" menu
in the sidebar.