]> xenbits.xensource.com Git - osstest.git/commitdiff
host reuse fixes: Fix running of steps adhoc
authorIan Jackson <iwj@xenproject.org>
Wed, 21 Oct 2020 16:28:07 +0000 (17:28 +0100)
committerIan Jackson <iwj@xenproject.org>
Thu, 22 Oct 2020 16:36:47 +0000 (17:36 +0100)
When a ts script is run by hand, for adhoc testing, there is no
OSSTEST_TESTID variable in the environment and the script does not
know it's own step number.  Such adhoc runs are not tracked as steps
in the steps table.

For host lifecycle purposes, treat these as ad-hoc out-of-flight uses,
based only on the taskid (which will usually be a person's personal
static task).

Without this, these adhoc runs fail with a constraint violating trying
to insert a flight/job/step row into the host lifecycle table: the
constraint requires the step to be specified but it is NULL.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
Osstest/JobDB/Executive.pm

index 4fa42e5dee21f5745a0fae63cc282de00bc6cae2..045551130642d213924087aad4b2b1a9ec30c68c 100644 (file)
@@ -588,7 +588,7 @@ END
     };
 
 
-    if (!defined $flight) {
+    if (!defined $flight || !defined $tstepno) {
        db_retry($dbh_tests,[], sub {
            $insertq->execute($hostname, $ttaskid,
                              undef,undef,