frysk.proc.live
Class TestRefresh

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by frysk.junit.TestCase
              extended by frysk.testbed.TestLib
                  extended by frysk.proc.live.TestRefresh
All Implemented Interfaces:
Test

public class TestRefresh
extends TestLib

Check the host's refresh mechanism.


Nested Class Summary
private  class TestRefresh.HostState
          Class to record a refresh; both saving the supplied updates, and applying the updates to a local cache of the system.
 
Field Summary
private static int DAEMONS
           
private static int EXITED_PROCESSES
           
private static int NEW_PROCESSES
           
private static int PROCESSES
          Bit-flags to indicate what processes should be found.
 
Fields inherited from class frysk.testbed.TestLib
host
 
Constructor Summary
TestRefresh()
           
 
Method Summary
private  void checkAdditionsAndRemovals(boolean daemon)
          Check that a host refresh detects a process addition then removal.
 void testDaemonAdditionAndRemoval()
          Check a daemon creation/deletion.
 void testParentChild()
          Check that a parent child relationship is correct.
 void testProcAdditionAndRemoval()
          Check a child creation/deletion.
 void testRefreshDaemon()
          Check that a process that becomes a daemon gets its parent id changed to 1.
 void testRefreshZombie()
          Check that a refresh involving a zombie is ok.
 void testRepeatedHostRefresh()
          Do several refreshes, check that the child is only added on the first pass; and never removed.
 void testUnattachedSingleExec()
          A single threaded program performs an exec, check that it is correctly tracked.
 
Methods inherited from class frysk.testbed.TestLib
addToTearDown, addToTearDown, assertRunToFindProc, assertRunUntilStop, assertRunUntilStop, getExecPath, isChildOf, isChildOfMine, isDescendantOf, isDescendantOfMine, runPending, setUp, tearDown
 
Methods inherited from class frysk.junit.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, getTimeoutMilliseconds, getTimeoutSeconds, missing32or64, unresolved, unresolvedOffUtrace, unresolvedOn32On64, unresolvedOnIA32, unresolvedOnPPC, unresolvedOnUtrace, unresolvedOnx8664, unsupported
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROCESSES

private static final int PROCESSES
Bit-flags to indicate what processes should be found.

See Also:
Constant Field Values

DAEMONS

private static final int DAEMONS
See Also:
Constant Field Values

NEW_PROCESSES

private static final int NEW_PROCESSES
See Also:
Constant Field Values

EXITED_PROCESSES

private static final int EXITED_PROCESSES
See Also:
Constant Field Values
Constructor Detail

TestRefresh

public TestRefresh()
Method Detail

testRepeatedHostRefresh

public void testRepeatedHostRefresh()
Do several refreshes, check that the child is only added on the first pass; and never removed.


checkAdditionsAndRemovals

private void checkAdditionsAndRemovals(boolean daemon)
Check that a host refresh detects a process addition then removal.


testProcAdditionAndRemoval

public void testProcAdditionAndRemoval()
Check a child creation/deletion.


testDaemonAdditionAndRemoval

public void testDaemonAdditionAndRemoval()
Check a daemon creation/deletion.


testParentChild

public void testParentChild()
Check that a parent child relationship is correct.


testRefreshDaemon

public void testRefreshDaemon()
Check that a process that becomes a daemon gets its parent id changed to 1.


testRefreshZombie

public void testRefreshZombie()
Check that a refresh involving a zombie is ok. In /proc, a zombie has no child tasks. Within PS, a zombie appears as "defunct".


testUnattachedSingleExec

public void testUnattachedSingleExec()
A single threaded program performs an exec, check that it is correctly tracked.