Add btests for supervisor stem/leaf process revival

This commit is contained in:
Jon Siwek 2020-01-27 10:58:40 -08:00
parent bbdf5f8938
commit 5fb01caee6
7 changed files with 165 additions and 0 deletions

View file

@ -98,3 +98,15 @@ function Supervisor::__is_supervisor%(%): bool
%{
return val_mgr->GetBool(zeek::supervisor_mgr != nullptr);
%}
function Supervisor::__stem_pid%(%): int
%{
if ( zeek::supervisor_mgr )
return val_mgr->GetInt(zeek::supervisor_mgr->StemPID());
if ( zeek::Supervisor::ThisNode() )
return val_mgr->GetInt(zeek::Supervisor::ThisNode()->parent_pid);
builtin_error("supervisor mode not enabled and not a supervised node");
return val_mgr->GetInt(-1);
%}