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 <i...@xenproject.org> --- Osstest/JobDB/Executive.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm index 4fa42e5d..04555113 100644 --- a/Osstest/JobDB/Executive.pm +++ b/Osstest/JobDB/Executive.pm @@ -588,7 +588,7 @@ END }; - if (!defined $flight) { + if (!defined $flight || !defined $tstepno) { db_retry($dbh_tests,[], sub { $insertq->execute($hostname, $ttaskid, undef,undef, -- 2.20.1