From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 16/27] cs-job-create: Permit creation of `synth' runvars Date: Wed, 16 Sep 2015 14:35:19 +0100 Message-ID: <1442410530-9665-17-git-send-email-ian.jackson@eu.citrix.com> References: <1442410530-9665-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZcCsU-0000uq-46 for xen-devel@lists.xenproject.org; Wed, 16 Sep 2015 13:36:02 +0000 In-Reply-To: <1442410530-9665-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org 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 --- 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: # = ... +# +# If 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