diff mbox

[OSSTEST,02/26] Executive: Allow out-of-order manipulations of flights intended play

Message ID 1473084154-396-3-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson Sept. 5, 2016, 2:02 p.m. UTC
Flights being operated on by a developer hacking about with the code,
which were created with intended blessing `play', are usually blessed
`running' or `broken' or something.  So the safety catch bypass needs
to look at the intended blessing too.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/JobDB/Executive.pm | 6 +++---
 README.dev                 | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index 51c1ebb..c21eba7 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -102,14 +102,14 @@  sub dbfl_check ($$) { #method
     }
     die unless ref($flok) eq 'ARRAY';
 
-    my ($bless) = $dbh_tests->selectrow_array(<<END, {}, $fl);
-        SELECT blessing FROM flights WHERE flight=?
+    my ($bless, $intended) = $dbh_tests->selectrow_array(<<END, {}, $fl);
+        SELECT blessing, intended FROM flights WHERE flight=?
 END
 
     die "modifying flight $fl but flight not found\n"
         unless defined $bless;
 
-    unless ($bless =~ m/\bplay\b/) {
+    unless ($bless =~ m/\bplay\b/ || $intended =~ m/\bplay\b/) {
 	die "modifying flight $fl blessing $bless expected @$flok\n"
 	    unless grep { $_ eq $bless } @$flok;
     }
diff --git a/README.dev b/README.dev
index 351cd25..a5b23b0 100644
--- a/README.dev
+++ b/README.dev
@@ -341,4 +341,5 @@  they crashed, are simply left with whatever blessing they had at the
 time.
 
 There is a special exception to the tools' flight status checks: any
-flight whose blessing contains `play' can be operated on out of order.
+flight whose blessing (or intended blessing) contains `play' can be
+operated on out of order.