Skip to contentSkip to conversation

simplify testing with adhoc jobs

RFC PATCH In review Ian Campbell 2 participants 5 messages Sep 15, 2015

lore
Share & tools
lore
#0 lore raw

cover simplify testing with adhoc jobs

While I was doing some adhoc testing on chardonnay I needed to define some adhoc recipes and ended up writing the following two patches.

In the end I didn't end up using the first (I just created the job out of whole cloth rather than copying an existing template and modifying).

For the second I was using an sg-run-job-adhoc containing:

    proc need-hosts/adhoc-xen-boot-x5 {} { return host }
    proc run-job/adhoc-xen-boot-x5 {} {
        repeat-ts 5 xen-boot.repeat \
                   ts-host-reboot     host \; \
                   ts-host-ping-check host 
    }

Which arguably could a useful addition to sg-run-job proper.

Anyway, here they are...

We also discussed making it possible to invert the bisector (i.e. to look for a patch which fixed an issue), in the end by the time I'd done a bit of adhoc work to narrow the range down to something the bisector wouldn't balk at I had a pretty good guess which merge commit it was going to be, so finding the commit was just a few more adhoc jobs.

Ian.

#1 lore raw

RFC PATCH 1/2 cs-adjust-flight: add recipe-set to adjust the recipe for a set of jobs

When constructing an adhoc test it may be useful to copy an existing job's configuration but run it with a custom recipe.

---
 cs-adjust-flight | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
cs-adjust-flight +16 -0
index 9e011c6..662b8e9 100755
@@ -12,6 +12,7 @@
 #   runvar-del <job-spec> <var-spec>
 #   runvar-change <job-spec> <var-spec> <old-value> <new-value>
 #   runvar-perlop <job-spec> <var-spec> <perl-expr>
+#   recipe-set <job-spec> <new-value>
 #   intended-blessing <intended-blessing>
 #
 # <foo-spec>:
@@ -276,6 +277,21 @@ sub change__runvar_perlop {
     }, 'IGNORE');
 }
 
+sub change__recipe_set {
+    die unless @changes >= 2;
+    my $jobs = shift @changes;
+    my $recipe = shift @changes;
+
+    for_jobs($dstflight, $jobs, sub {
+	my ($job) = @_;
+	$dbh_tests->do("UPDATE jobs".
+		       "   SET recipe = ?".
+		       " WHERE flight = ? AND job = ?",
+		       {}, $recipe, $dstflight, $job);
+	verbose "$dstflight $job recipe set to $recipe\n";
+    });
+}
+
 sub change__intended_blessing {
     die unless @changes >= 1;
     my $blessing = shift @changes;
Signature · 1 line
2.5.1
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH OSSTEST RFC 1/2] cs-adjust-flight: add recipe-set to adjust the recipe for a set of jobs

Ian Campbell writes ("[PATCH OSSTEST RFC 1/2] cs-adjust-flight: add recipe-set to adjust the recipe for a set of jobs"):

Quoted 2 lines

When constructing an adhoc test it may be useful to copy an existing job's configuration but run it with a custom recipe.

#3 lore raw

RFC PATCH 2/2 sg-run-job: support dropping in adhoc test recipes

In reply to Ian Campbell

By reading sg-run-job-adhoc if it exists.

---
 sg-run-job | 4 ++++
 1 file changed, 4 insertions(+)
sg-run-job +4 -0
index 0b0449b..c51a508 100755
@@ -370,6 +370,10 @@ proc run-job/test-rumpuserxen {} {
                  ts-guest-destroy-hard            host   $g   +
 }
 
+if {[file exists sg-run-job-adhoc]} {
+    source sg-run-job-adhoc
+}
+
 #---------- builds ----------
 
 proc need-hosts/build {} { return BUILD }
Signature · 1 line
2.5.1
Acked-by on v1 2/2
#4 lore raw

Re: [PATCH OSSTEST RFC 2/2] sg-run-job: support dropping in adhoc test recipes

Ian Campbell writes ("[PATCH OSSTEST RFC 2/2] sg-run-job: support dropping in adhoc test recipes"):

Quoted 1 line

By reading sg-run-job-adhoc if it exists.

...

sg-run-job proc run-job/test-rumpuserxen {} { · line 376

Quoted 4 lines
sg-run-job +4 -0
+if {[file exists sg-run-job-adhoc]} {
+    source sg-run-job-adhoc
+}
+