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

[Xen-devel] [OSSTEST PATCH 16/27] cs-job-create: Permit creation of `synth' runvars



This will be useful if we want to set hostalloc_* runvars.  Normally
we would want to set those only on flights generated by make-flight.

Flights generated by cs-bisection-step or cs-adjust-flight ought not
to copy them, because cs-bisection-step makes its own arrangements for
host specification, as should the caller of cs-adjust-flight (perhaps
via the blessing system).

Using `synth' for this is arguably slightly wrong but it does the
right thing in all existing cases.  The alternative would be a schema
change.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 cs-job-create |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/cs-job-create b/cs-job-create
index df2738c..9812bf2 100755
--- a/cs-job-create
+++ b/cs-job-create
@@ -2,6 +2,11 @@
 #
 # args:
 #   <flight> <job> <recipe> <runvar>=<value> ...
+#
+# If <runvar> ends in ~, the ~ is stripped and the runvar is marked
+# `synth'.  (Normally runvars marked `synth' are defined during test
+# execution.  They are not taken as part of the runvar set copied
+# when cloning flights, eg for bisection.)
 
 # This is part of "osstest", an automated testing framework for Xen.
 # Copyright (C) 2009-2013 Citrix Inc.
@@ -47,9 +52,9 @@ foreach my $rv (@runvars) {
         $suppress{$1}= 1;
         next;
     }
-    $rv =~ m/^([a-z][0-9a-z_]*)\=(.*)$/ or die "$rv ?";
-    my ($name,$val) = ($1,$2);
-    $runvars{$name}= $val;
+    $rv =~ m/^([a-z][0-9a-z_]*)(\~?)\=(.*)$/ or die "$rv ?";
+    my ($name,$synth,$val) = ($1,$2,$3);
+    $runvars{$name}= [$val,$synth];
 }
 
 foreach my $name (keys %suppress) {
@@ -61,9 +66,10 @@ db_retry($flight,'constructing', $dbh_tests,[qw(flights)], 
sub {
         INSERT INTO jobs VALUES (?,'$job','$recipe','queued')
 END
     my $q= $dbh_tests->
-        prepare("INSERT INTO runvars VALUES (?,'$job',?,?,'f')");
+        prepare("INSERT INTO runvars VALUES (?,'$job',?,?,?)");
     foreach my $name (keys %runvars) {
-        $q->execute($flight, $name, $runvars{$name});
+        $q->execute($flight, $name, $runvars{$name}[0],
+                   $runvars{$name}[1] ? 't' : 'f');
         $q->finish();
     }
 });
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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