[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 57/82] TestSupport: Provide runvar_is_synth



From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

Internally we use an array %r_notsynth.  This allows us to avoid
adding code to store_runvar etc.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 634d6d2e..ce13d3a6 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -52,7 +52,7 @@ BEGIN {
                       store_runvar get_runvar get_runvar_maybe
                       get_runvar_default need_runvars
                       unique_incrementing_runvar next_unique_name
-                      stashfilecontents
+                      stashfilecontents runvar_is_synth
 
                       target_cmd_root_status target_cmd_output_root_status
                       target_cmd_root target_cmd target_cmd_build
@@ -147,7 +147,7 @@ BEGIN {
     @EXPORT_OK   = qw();
 }
 
-our (%r,$flight,$job,$stash);
+our (%r,$flight,$job,$stash,%r_,%r_notsynth);
 
 our %timeout= qw(RebootDown   100
                  RebootUp     400
@@ -178,12 +178,13 @@ sub tsreadconfig () {
         logm("starting $flight.$job");
 
         my $q= $dbh_tests->prepare(<<END);
-            SELECT name, val FROM runvars WHERE flight=? AND job=?
+            SELECT name, val, synth FROM runvars WHERE flight=? AND job=?
 END
         $q->execute($flight, $job);
         my $row;
         while ($row= $q->fetchrow_hashref()) {
             $r{ $row->{name} }= $row->{val};
+           $r_notsynth{ $row->{name} }= !$row->{synth};
             logm("setting $row->{name}=$row->{val}");
         }
         $q->finish();
@@ -434,6 +435,11 @@ END
     return $value;
 }
 
+sub runvar_is_synth ($) {
+    my ($key) = @_;
+    return !$r_notsynth{$key};
+}
+
 sub target_adjust_timeout ($$) {
     my ($ho,$timeoutref) = @_; # $ho might be a $gho
     my $nestinglvl = $ho->{NestingLevel} // $ho->{Host}{NestingLevel};
-- 
2.20.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.