From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 17/33] cs-job-create: Permit creation of `synth' runvars Date: Thu, 17 Sep 2015 18:37:44 +0100 Message-ID: <1442511480-32587-18-git-send-email-ian.jackson@eu.citrix.com> References: <1442511480-32587-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.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zcd8S-0006QV-B5 for xen-devel@lists.xenproject.org; Thu, 17 Sep 2015 17:38:16 +0000 In-Reply-To: <1442511480-32587-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 for some hostalloc_* runvars which we are going to introduce shortly. This is going to be the way to set a runvar which is not copied by cs-bisection-step or cs-adjust-flight. 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 Acked-by: Ian Campbell --- v2: Defer some of the discussion to later commit messages. --- 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