anchor.diff:      argv,
       environment
   }).
  +
  +-define(IS_DYING(State),
  +        State =:= killed orelse State =:= stopped).
   
   -include("systest.hrl").
   
  
positive.code: handle_msg({Port, closed}, _Proc, Sh=#sh{id=Id, port=Port}) ->
      log({framework, Id}, "~p closed~n", [Port]),
      {stop, {port_closed, Port}, Sh};
  handle_msg({'EXIT', Pid, {ok, StopAcc}}, _Proc, Sh=#sh{shutdown_port=Pid,
                                                         detached=Detached,
                                                         state=killed,
                                                         log=Fd,
                                                         id=Id}) ->
      log({framework, Id}, "termination Port completed ok~n"),
      io:format(Fd, "Halt Log ==============~n~s~n", [StopAcc]),
      case Detached of
  
negative.code:     log({framework, Id},
          "os process ~p shut down with error/status code ~p~n",
          [Proc#proc.id, Exit]),
      ShutdownType = case ?IS_DYING(State) of
                         true  -> normal;
                         false -> Rc
                     end,
      {stop, ShutdownType, Sh};
  handle_msg({Port, closed}, Proc,
              Sh=#sh{id=Id, port=Port,
                     state=State, detached=false}) when ?IS_DYING(State) ->
      log({framework, Id}, "~p (attached) closed~n", [Port]),
      case Sh#sh.rpc_enabled of
          true ->
              %% to account for a potential timing issue when the calling test
              %% execution process is sitting in `kill_and_wait` - we force a
              %% call to net_adm:ping/1, which gives the net_kernel more time to
              %% to try and its knickers out of a twist before proceeding....
              Id = systest_proc:get(id, Proc),
              systest_proc:status_check(Id);
          false ->
  