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>
};
- if (!defined $flight) {
+ if (!defined $flight || !defined $tstepno) {
db_retry($dbh_tests,[], sub {
$insertq->execute($hostname, $ttaskid,
undef,undef,