frysk.testbed
Class TearDownProcess

java.lang.Object
  extended by frysk.testbed.TearDownProcess

public class TearDownProcess
extends Object

Framework for cleaning up temporary processes created as part of a test run.


Field Summary
private static Log fine
           
private static Set pidsToKillDuringTearDown
          A set of children that are to be killed off at the end of a test run during tearDown.
 
Constructor Summary
TearDownProcess()
           
 
Method Summary
static void add(ProcessIdentifier pid)
          Add the pid to the set of pidsToKillDuringTearDown that should be killed off during tearDown.
private static ProcessIdentifier capturedSendDetachContKill(ProcessIdentifier pid)
          Sequence a task through CONT, detach, and KILL.
private static boolean capturedSendTkill(ProcessIdentifier pid)
          Try to blow away the child, catch a failure.
static boolean contains(ProcessIdentifier pid)
          Return true if PID is a process identified for kill during tearDown.
static void tearDown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fine

private static final Log fine

pidsToKillDuringTearDown

private static final Set pidsToKillDuringTearDown
A set of children that are to be killed off at the end of a test run during tearDown.

Constructor Detail

TearDownProcess

public TearDownProcess()
Method Detail

add

public static void add(ProcessIdentifier pid)
Add the pid to the set of pidsToKillDuringTearDown that should be killed off during tearDown.


contains

public static boolean contains(ProcessIdentifier pid)
Return true if PID is a process identified for kill during tearDown.


capturedSendTkill

private static boolean capturedSendTkill(ProcessIdentifier pid)
Try to blow away the child, catch a failure.


capturedSendDetachContKill

private static ProcessIdentifier capturedSendDetachContKill(ProcessIdentifier pid)
Sequence a task through CONT, detach, and KILL. Return false if it is suspected that the task no longer exists. Detaching with KILL on early utrace kernels has proven problematic - nothing happened (now fixed) - avoid any such issues by doing a simple detach followed by a KILL. There is a problem with both stopped and attached tasks. The Signal.KILL won't be delivered, and consequently the task won't exit, until that task has been continued. Work around this by first sending all tasks a continue ...


tearDown

public static void tearDown()