]> xenbits.xensource.com Git - osstest.git/commitdiff
Flight restriction: Change implementation of --max-flight
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 23 Jul 2015 17:32:16 +0000 (18:32 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 28 Jul 2015 14:30:21 +0000 (15:30 +0100)
Abolish $maxflight.  All the users outside Osstest::Executive have
been eliminated, so this is fine.  Replace it with
$restrictflight_cond, which can accumulate multiple conditions.

There is a minor functional change: when multiple --max-flight options
are specified, _all_ of them take effect (effectively using the lowest
value).  That option is not used in production, and I don't expect
people elsewhere to be passing multiple different such options.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Osstest/Executive.pm

index a1bc0ad1e985b55a73c96e360a59639925d746df..b8ab5cd02e6ace8e2ec359abca1fc9f60fecd867 100644 (file)
@@ -47,7 +47,6 @@ BEGIN {
     @EXPORT      = qw(get_harness_rev grabrepolock_reexec
                       findtask @all_lock_tables
                       restrictflight_arg restrictflight_cond
-                      $maxflight
                       report_run_getinfo report_altcolour
                       report_blessingscond report_find_push_age_info
                       tcpconnect_queuedaemon plan_search
@@ -195,12 +194,12 @@ sub opendb ($) {
 
 #---------- history reporting ----------
 
-our $maxflight;
+our $restrictflight_cond = 'TRUE';
 
 sub restrictflight_arg ($) {
     my ($arg) = @_;
     if ($arg =~ m/^--max-flight\=([1-9]\d*)$/) {
-       $maxflight = $1;
+       $restrictflight_cond .= " AND flight <= $1";
        return 1;
     } else {
        return 0;
@@ -208,7 +207,7 @@ sub restrictflight_arg ($) {
 }
 
 sub restrictflight_cond () {
-    return defined($maxflight) ? "(flight <= $maxflight)" : "TRUE";
+    return "($restrictflight_cond)";
 }
 
 our $green=  '#008800';