]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Executive: Permit OSSTEST_TASK=<refkey> (for static tasks)
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 8 Dec 2015 14:11:47 +0000 (14:11 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 8 Dec 2015 14:51:24 +0000 (14:51 +0000)
If OSSTEST_TASK is not set, we construct a <refkey> from the username
and the nodename, and look for a such a static task.  If OSSTEST_TASK
/is/ set would require it to contain `<taskid> <type> <refkey>'.

In this patch, permit OSSTEST_TASK to be set simply to the <refkey>.
This is much more convenient and doesn't involve manually looking up
taskids.  The risk of error seems negligible.

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

index fcef83f08401b8b3b518642c4343c964826059ad..84c7d4667e67953d9df53f48bbcc29aa4f051c97 100644 (file)
@@ -446,13 +446,15 @@ sub findtask () {
     if (!defined $spec) {
         $!=0; $?=0; my $node=   `uname -n`; defined $node   or die "$? $!";
         chomp($node); $node =~ s/\..*//;
-        my $refkey= "$c{Username}\@$node";
-        $what= "static $refkey";
+       $spec= "$c{Username}\@$node";
+    }
+    if ($spec !~ m/\s/) {
+        $what= "static $spec";
         $q= $dbh_tests->prepare(<<END);
             SELECT * FROM tasks
                     WHERE type='static' AND refkey=?
 END
-        $q->execute($refkey);
+        $q->execute($spec);
     } else {
         my @l = split /\s+/, $spec;
         @l==3 or die "$spec ".scalar(@l)." ?";